@@ -219,21 +219,6 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> {
219
219
}
220
220
221
221
impl < ' ll , CX : Borrow < SCx < ' ll > > > GenericCx < ' ll , CX > {
222
- /// Gets declared value by name.
223
- pub ( crate ) fn get_declared_value ( & self , name : & str ) -> Option < & ' ll Value > {
224
- debug ! ( "get_declared_value(name={:?})" , name) ;
225
- unsafe { llvm:: LLVMRustGetNamedValue ( self . llmod ( ) , name. as_c_char_ptr ( ) , name. len ( ) ) }
226
- }
227
-
228
- /// Gets defined or externally defined (AvailableExternally linkage) value by
229
- /// name.
230
- pub ( crate ) fn get_defined_value ( & self , name : & str ) -> Option < & ' ll Value > {
231
- self . get_declared_value ( name) . and_then ( |val| {
232
- let declaration = llvm:: is_declaration ( val) ;
233
- if !declaration { Some ( val) } else { None }
234
- } )
235
- }
236
-
237
222
/// Declare a global with an intention to define it.
238
223
///
239
224
/// Use this function when you intend to define a global. This function will
@@ -254,4 +239,19 @@ impl<'ll, CX: Borrow<SCx<'ll>>> GenericCx<'ll, CX> {
254
239
pub ( crate ) fn define_private_global ( & self , ty : & ' ll Type ) -> & ' ll Value {
255
240
unsafe { llvm:: LLVMRustInsertPrivateGlobal ( self . llmod ( ) , ty) }
256
241
}
242
+
243
+ /// Gets declared value by name.
244
+ pub ( crate ) fn get_declared_value ( & self , name : & str ) -> Option < & ' ll Value > {
245
+ debug ! ( "get_declared_value(name={:?})" , name) ;
246
+ unsafe { llvm:: LLVMRustGetNamedValue ( self . llmod ( ) , name. as_c_char_ptr ( ) , name. len ( ) ) }
247
+ }
248
+
249
+ /// Gets defined or externally defined (AvailableExternally linkage) value by
250
+ /// name.
251
+ pub ( crate ) fn get_defined_value ( & self , name : & str ) -> Option < & ' ll Value > {
252
+ self . get_declared_value ( name) . and_then ( |val| {
253
+ let declaration = llvm:: is_declaration ( val) ;
254
+ if !declaration { Some ( val) } else { None }
255
+ } )
256
+ }
257
257
}
0 commit comments