about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/declare.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustc_codegen_llvm/declare.rs')
-rw-r--r--src/librustc_codegen_llvm/declare.rs40
1 files changed, 0 insertions, 40 deletions
diff --git a/src/librustc_codegen_llvm/declare.rs b/src/librustc_codegen_llvm/declare.rs
index 4d1a28ad6e2..b5c64adb427 100644
--- a/src/librustc_codegen_llvm/declare.rs
+++ b/src/librustc_codegen_llvm/declare.rs
@@ -97,10 +97,6 @@ fn declare_raw_fn(
 
 impl DeclareMethods<'tcx> for CodegenCx<'ll, 'tcx> {
 
-    /// Declare a global value.
-    ///
-    /// If there’s a value with the same name already declared, the function will
-    /// return its Value instead.
     fn declare_global(
         &self,
         name: &str, ty: &'ll Type
@@ -112,13 +108,6 @@ impl DeclareMethods<'tcx> for CodegenCx<'ll, 'tcx> {
         }
     }
 
-    /// Declare a C ABI function.
-    ///
-    /// Only use this for foreign function ABIs and glue. For Rust functions use
-    /// `declare_fn` instead.
-    ///
-    /// If there’s a value with the same name already declared, the function will
-    /// update the declaration and return existing Value instead.
     fn declare_cfn(
         &self,
         name: &str,
@@ -127,11 +116,6 @@ impl DeclareMethods<'tcx> for CodegenCx<'ll, 'tcx> {
         declare_raw_fn(self, name, llvm::CCallConv, fn_type)
     }
 
-
-    /// Declare a Rust function.
-    ///
-    /// If there’s a value with the same name already declared, the function will
-    /// update the declaration and return existing Value instead.
     fn declare_fn(
         &self,
         name: &str,
@@ -157,13 +141,6 @@ impl DeclareMethods<'tcx> for CodegenCx<'ll, 'tcx> {
         llfn
     }
 
-
-    /// Declare a global with an intention to define it.
-    ///
-    /// Use this function when you intend to define a global. This function will
-    /// return None if the name already has a definition associated with it. In that
-    /// case an error should be reported to the user, because it usually happens due
-    /// to user’s fault (e.g. misuse of #[no_mangle] or #[export_name] attributes).
     fn define_global(
         &self,
         name: &str,
@@ -176,20 +153,12 @@ impl DeclareMethods<'tcx> for CodegenCx<'ll, 'tcx> {
         }
     }
 
-    /// Declare a private global
-    ///
-    /// Use this function when you intend to define a global without a name.
     fn define_private_global(&self, ty: &'ll Type) -> &'ll Value {
         unsafe {
             llvm::LLVMRustInsertPrivateGlobal(self.llmod, ty)
         }
     }
 
-    /// Declare a Rust function with an intention to define it.
-    ///
-    /// Use this function when you intend to define a function. This function will
-    /// return panic if the name already has a definition associated with it. This
-    /// can happen with #[no_mangle] or #[export_name], for example.
     fn define_fn(
         &self,
         name: &str,
@@ -202,11 +171,6 @@ impl DeclareMethods<'tcx> for CodegenCx<'ll, 'tcx> {
         }
     }
 
-    /// Declare a Rust function with an intention to define it.
-    ///
-    /// Use this function when you intend to define a function. This function will
-    /// return panic if the name already has a definition associated with it. This
-    /// can happen with #[no_mangle] or #[export_name], for example.
     fn define_internal_fn(
         &self,
         name: &str,
@@ -217,16 +181,12 @@ impl DeclareMethods<'tcx> for CodegenCx<'ll, 'tcx> {
         llfn
     }
 
-
-    /// Get declared value by name.
     fn get_declared_value(&self, name: &str) -> Option<&'ll Value> {
         debug!("get_declared_value(name={:?})", name);
         let namebuf = SmallCStr::new(name);
         unsafe { llvm::LLVMRustGetNamedValue(self.llmod, namebuf.as_ptr()) }
     }
 
-    /// Get defined or externally defined (AvailableExternally linkage) value by
-    /// name.
     fn get_defined_value(&self, name: &str) -> Option<&'ll Value> {
         self.get_declared_value(name).and_then(|val|{
             let declaration = unsafe {