@@ -206,71 +206,71 @@ impl Backend for CodegenCx<'ll, 'tcx, &'ll Value> {
206206impl < ' ll , ' tcx : ' ll > CommonMethods for CodegenCx < ' ll , ' tcx , & ' ll Value > {
207207
208208 // LLVM constant constructors.
209- fn c_null ( & self , t : & ' ll Type ) -> & ' ll Value {
209+ fn const_null ( & self , t : & ' ll Type ) -> & ' ll Value {
210210 unsafe {
211211 llvm:: LLVMConstNull ( t)
212212 }
213213 }
214214
215- fn c_undef ( & self , t : & ' ll Type ) -> & ' ll Value {
215+ fn const_undef ( & self , t : & ' ll Type ) -> & ' ll Value {
216216 unsafe {
217217 llvm:: LLVMGetUndef ( t)
218218 }
219219 }
220220
221- fn c_int ( & self , t : & ' ll Type , i : i64 ) -> & ' ll Value {
221+ fn const_int ( & self , t : & ' ll Type , i : i64 ) -> & ' ll Value {
222222 unsafe {
223223 llvm:: LLVMConstInt ( t, i as u64 , True )
224224 }
225225 }
226226
227- fn c_uint ( & self , t : & ' ll Type , i : u64 ) -> & ' ll Value {
227+ fn const_uint ( & self , t : & ' ll Type , i : u64 ) -> & ' ll Value {
228228 unsafe {
229229 llvm:: LLVMConstInt ( t, i, False )
230230 }
231231 }
232232
233- fn c_uint_big ( & self , t : & ' ll Type , u : u128 ) -> & ' ll Value {
233+ fn const_uint_big ( & self , t : & ' ll Type , u : u128 ) -> & ' ll Value {
234234 unsafe {
235235 let words = [ u as u64 , ( u >> 64 ) as u64 ] ;
236236 llvm:: LLVMConstIntOfArbitraryPrecision ( t, 2 , words. as_ptr ( ) )
237237 }
238238 }
239239
240- fn c_bool ( & self , val : bool ) -> & ' ll Value {
241- & self . c_uint ( & self . i1 ( ) , val as u64 )
240+ fn const_bool ( & self , val : bool ) -> & ' ll Value {
241+ & self . const_uint ( & self . i1 ( ) , val as u64 )
242242 }
243243
244- fn c_i32 ( & self , i : i32 ) -> & ' ll Value {
245- & self . c_int ( & self . i32 ( ) , i as i64 )
244+ fn const_i32 ( & self , i : i32 ) -> & ' ll Value {
245+ & self . const_int ( & self . i32 ( ) , i as i64 )
246246 }
247247
248- fn c_u32 ( & self , i : u32 ) -> & ' ll Value {
249- & self . c_uint ( & self . i32 ( ) , i as u64 )
248+ fn const_u32 ( & self , i : u32 ) -> & ' ll Value {
249+ & self . const_uint ( & self . i32 ( ) , i as u64 )
250250 }
251251
252- fn c_u64 ( & self , i : u64 ) -> & ' ll Value {
253- & self . c_uint ( & self . i64 ( ) , i)
252+ fn const_u64 ( & self , i : u64 ) -> & ' ll Value {
253+ & self . const_uint ( & self . i64 ( ) , i)
254254 }
255255
256- fn c_usize ( & self , i : u64 ) -> & ' ll Value {
256+ fn const_usize ( & self , i : u64 ) -> & ' ll Value {
257257 let bit_size = self . data_layout ( ) . pointer_size . bits ( ) ;
258258 if bit_size < 64 {
259259 // make sure it doesn't overflow
260260 assert ! ( i < ( 1 <<bit_size) ) ;
261261 }
262262
263- & self . c_uint ( & self . isize_ty , i)
263+ & self . const_uint ( & self . isize_ty , i)
264264 }
265265
266- fn c_u8 ( & self , i : u8 ) -> & ' ll Value {
267- & self . c_uint ( & self . i8 ( ) , i as u64 )
266+ fn const_u8 ( & self , i : u8 ) -> & ' ll Value {
267+ & self . const_uint ( & self . i8 ( ) , i as u64 )
268268 }
269269
270270
271271 // This is a 'c-like' raw string, which differs from
272272 // our boxed-and-length-annotated strings.
273- fn c_cstr (
273+ fn const_cstr (
274274 & self ,
275275 s : LocalInternedString ,
276276 null_terminated : bool ,
@@ -299,45 +299,45 @@ impl<'ll, 'tcx : 'll> CommonMethods for CodegenCx<'ll, 'tcx, &'ll Value> {
299299
300300 // NB: Do not use `do_spill_noroot` to make this into a constant string, or
301301 // you will be kicked off fast isel. See issue #4352 for an example of this.
302- fn c_str_slice ( & self , s : LocalInternedString ) -> & ' ll Value {
302+ fn const_str_slice ( & self , s : LocalInternedString ) -> & ' ll Value {
303303 let len = s. len ( ) ;
304- let cs = consts:: ptrcast ( & self . c_cstr ( s, false ) ,
304+ let cs = consts:: ptrcast ( & self . const_cstr ( s, false ) ,
305305 & self . ptr_to ( & self . layout_of ( & self . tcx . mk_str ( ) ) . llvm_type ( & self ) ) ) ;
306- & self . c_fat_ptr ( cs, & self . c_usize ( len as u64 ) )
306+ & self . const_fat_ptr ( cs, & self . const_usize ( len as u64 ) )
307307 }
308308
309- fn c_fat_ptr (
309+ fn const_fat_ptr (
310310 & self ,
311311 ptr : & ' ll Value ,
312312 meta : & ' ll Value
313313 ) -> & ' ll Value {
314314 assert_eq ! ( abi:: FAT_PTR_ADDR , 0 ) ;
315315 assert_eq ! ( abi:: FAT_PTR_EXTRA , 1 ) ;
316- & self . c_struct ( & [ ptr, meta] , false )
316+ & self . const_struct ( & [ ptr, meta] , false )
317317 }
318318
319- fn c_struct (
319+ fn const_struct (
320320 & self ,
321321 elts : & [ & ' ll Value ] ,
322322 packed : bool
323323 ) -> & ' ll Value {
324- & self . c_struct_in_context ( & self . llcx , elts, packed)
324+ & self . const_struct_in_context ( & self . llcx , elts, packed)
325325 }
326326
327- fn c_array ( & self , ty : & ' ll Type , elts : & [ & ' ll Value ] ) -> & ' ll Value {
327+ fn const_array ( & self , ty : & ' ll Type , elts : & [ & ' ll Value ] ) -> & ' ll Value {
328328 unsafe {
329329 return llvm:: LLVMConstArray ( ty, elts. as_ptr ( ) , elts. len ( ) as c_uint ) ;
330330 }
331331 }
332332
333- fn c_vector ( & self , elts : & [ & ' ll Value ] ) -> & ' ll Value {
333+ fn const_vector ( & self , elts : & [ & ' ll Value ] ) -> & ' ll Value {
334334 unsafe {
335335 return llvm:: LLVMConstVector ( elts. as_ptr ( ) , elts. len ( ) as c_uint ) ;
336336 }
337337 }
338338
339- fn c_bytes ( & self , bytes : & [ u8 ] ) -> & ' ll Value {
340- & self . c_bytes_in_context ( & self . llcx , bytes)
339+ fn const_bytes ( & self , bytes : & [ u8 ] ) -> & ' ll Value {
340+ & self . const_bytes_in_context ( & self . llcx , bytes)
341341 }
342342
343343 fn const_get_elt ( & self , v : & ' ll Value , idx : u64 ) -> & ' ll Value {
@@ -408,14 +408,14 @@ pub fn val_ty(v: &'ll Value) -> &'ll Type {
408408 }
409409}
410410
411- pub fn c_bytes_in_context ( llcx : & ' ll llvm:: Context , bytes : & [ u8 ] ) -> & ' ll Value {
411+ pub fn const_bytes_in_context ( llcx : & ' ll llvm:: Context , bytes : & [ u8 ] ) -> & ' ll Value {
412412 unsafe {
413413 let ptr = bytes. as_ptr ( ) as * const c_char ;
414414 return llvm:: LLVMConstStringInContext ( llcx, ptr, bytes. len ( ) as c_uint , True ) ;
415415 }
416416}
417417
418- pub fn c_struct_in_context (
418+ pub fn const_struct_in_context (
419419 llcx : & ' a llvm:: Context ,
420420 elts : & [ & ' a Value ] ,
421421 packed : bool ,
@@ -432,17 +432,17 @@ impl<'ll, 'tcx : 'll> CommonWriteMethods for CodegenCx<'ll, 'tcx, &'ll Value> {
432432 val_ty ( v)
433433 }
434434
435- fn c_bytes_in_context ( & self , llcx : & ' ll llvm:: Context , bytes : & [ u8 ] ) -> & ' ll Value {
436- c_bytes_in_context ( llcx, bytes)
435+ fn const_bytes_in_context ( & self , llcx : & ' ll llvm:: Context , bytes : & [ u8 ] ) -> & ' ll Value {
436+ const_bytes_in_context ( llcx, bytes)
437437 }
438438
439- fn c_struct_in_context (
439+ fn const_struct_in_context (
440440 & self ,
441441 llcx : & ' a llvm:: Context ,
442442 elts : & [ & ' a Value ] ,
443443 packed : bool ,
444444 ) -> & ' a Value {
445- c_struct_in_context ( llcx, elts, packed)
445+ const_struct_in_context ( llcx, elts, packed)
446446 }
447447}
448448
@@ -516,9 +516,9 @@ pub fn shift_mask_val(
516516 // i8/u8 can shift by at most 7, i16/u16 by at most 15, etc.
517517 let val = bx. cx ( ) . int_width ( llty) - 1 ;
518518 if invert {
519- bx. cx . c_int ( mask_llty, !val as i64 )
519+ bx. cx . const_int ( mask_llty, !val as i64 )
520520 } else {
521- bx. cx . c_uint ( mask_llty, val)
521+ bx. cx . const_uint ( mask_llty, val)
522522 }
523523 } ,
524524 TypeKind :: Vector => {
0 commit comments