Skip to content

Commit 7f9180f

Browse files
committed
syntax: Change ExpnId::{from,to}_llvm_cookie to {from,to}_u32
1 parent 83b1d7f commit 7f9180f

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

src/librustc_trans/back/write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ unsafe extern "C" fn report_inline_asm<'a, 'b>(cgcx: &'a CodegenContext<'a>,
348348

349349
match cgcx.lto_ctxt {
350350
Some((sess, _)) => {
351-
sess.codemap().with_expn_info(ExpnId::from_llvm_cookie(cookie), |info| match info {
351+
sess.codemap().with_expn_info(ExpnId::from_u32(cookie), |info| match info {
352352
Some(ei) => sess.span_err(ei.call_site, msg),
353353
None => sess.err(msg),
354354
});

src/librustc_trans/trans/asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ pub fn trans_inline_asm<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, ia: &ast::InlineAsm)
138138
let kind = llvm::LLVMGetMDKindIDInContext(bcx.ccx().llcx(),
139139
key.as_ptr() as *const c_char, key.len() as c_uint);
140140

141-
let val: llvm::ValueRef = C_i32(bcx.ccx(), ia.expn_id.to_llvm_cookie());
141+
let val: llvm::ValueRef = C_i32(bcx.ccx(), ia.expn_id.into_u32() as i32);
142142

143143
llvm::LLVMSetMetadata(r, kind,
144144
llvm::LLVMMDNodeInContext(bcx.ccx().llcx(), &val, 1));

src/libsyntax/codemap.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ use std::rc::Rc;
2626

2727
use std::fmt;
2828

29-
use libc::c_uint;
3029
use serialize::{Encodable, Decodable, Encoder, Decoder};
3130

3231

@@ -287,13 +286,12 @@ pub const NO_EXPANSION: ExpnId = ExpnId(!0);
287286
pub const COMMAND_LINE_EXPN: ExpnId = ExpnId(!1);
288287

289288
impl ExpnId {
290-
pub fn from_llvm_cookie(cookie: c_uint) -> ExpnId {
291-
ExpnId(cookie)
289+
pub fn from_u32(id: u32) -> ExpnId {
290+
ExpnId(id)
292291
}
293292

294-
pub fn to_llvm_cookie(self) -> i32 {
295-
let ExpnId(cookie) = self;
296-
cookie as i32
293+
pub fn into_u32(self) -> u32 {
294+
self.0
297295
}
298296
}
299297

0 commit comments

Comments
 (0)