about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/declare.rs
diff options
context:
space:
mode:
authorDenis Merigoux <denis.merigoux@gmail.com>2018-08-22 17:48:32 +0200
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2018-11-16 14:11:34 +0200
commit9c41e1aa109e27eef4e6d21e90ecbbb1a12e6468 (patch)
treef80386a91a7d17ecf0dbb6298e1ab4d4ce69b6a0 /src/librustc_codegen_llvm/declare.rs
parent1ca750683ef1fc6db178c2fff8c0d0fb713690ab (diff)
downloadrust-9c41e1aa109e27eef4e6d21e90ecbbb1a12e6468.tar.gz
rust-9c41e1aa109e27eef4e6d21e90ecbbb1a12e6468.zip
Removed genericity over Value in various functions
Prelude to using associated types in traits rather than type parameters
Diffstat (limited to 'src/librustc_codegen_llvm/declare.rs')
-rw-r--r--src/librustc_codegen_llvm/declare.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/librustc_codegen_llvm/declare.rs b/src/librustc_codegen_llvm/declare.rs
index d0680151893..973a322fcb1 100644
--- a/src/librustc_codegen_llvm/declare.rs
+++ b/src/librustc_codegen_llvm/declare.rs
@@ -31,7 +31,7 @@ use abi::{Abi, FnType, FnTypeExt};
 use attributes;
 use context::CodegenCx;
 use type_::Type;
-use value::{Value, ValueTrait};
+use value::Value;
 
 
 /// Declare a global value.
@@ -51,12 +51,12 @@ pub fn declare_global(cx: &CodegenCx<'ll, '_>, name: &str, ty: &'ll Type) -> &'l
 ///
 /// If there’s a value with the same name already declared, the function will
 /// update the declaration and return existing Value instead.
-fn declare_raw_fn<Value : ?Sized>(
-    cx: &CodegenCx<'ll, '_, &'ll Value>,
+fn declare_raw_fn(
+    cx: &CodegenCx<'ll, '_>,
     name: &str,
     callconv: llvm::CallConv,
     ty: &'ll Type,
-) -> &'ll Value where Value : ValueTrait {
+) -> &'ll Value {
     debug!("declare_raw_fn(name={:?}, ty={:?})", name, ty);
     let namebuf = SmallCStr::new(name);
     let llfn = unsafe {
@@ -105,7 +105,7 @@ fn declare_raw_fn<Value : ?Sized>(
 
     attributes::non_lazy_bind(cx.sess(), llfn);
 
-    Value::of_llvm(llfn)
+    llfn
 }
 
 
@@ -116,11 +116,11 @@ fn declare_raw_fn<Value : ?Sized>(
 ///
 /// If there’s a value with the same name already declared, the function will
 /// update the declaration and return existing Value instead.
-pub fn declare_cfn<Value : ?Sized>(
-    cx: &CodegenCx<'ll, '_, &'ll Value>,
+pub fn declare_cfn(
+    cx: &CodegenCx<'ll, '_>,
     name: &str,
     fn_type: &'ll Type
-) -> &'ll Value where Value : ValueTrait {
+) -> &'ll Value {
     declare_raw_fn(cx, name, llvm::CCallConv, fn_type)
 }
 
@@ -172,7 +172,7 @@ pub fn define_global(cx: &CodegenCx<'ll, '_>, name: &str, ty: &'ll Type) -> Opti
 /// Declare a private global
 ///
 /// Use this function when you intend to define a global without a name.
-pub fn define_private_global(cx: &CodegenCx<'ll, '_, &'ll Value>, ty: &'ll Type) -> &'ll Value {
+pub fn define_private_global(cx: &CodegenCx<'ll, '_>, ty: &'ll Type) -> &'ll Value {
     unsafe {
         llvm::LLVMRustInsertPrivateGlobal(cx.llmod, ty)
     }