match cgcx.lto_ctxt {
Some((sess, _)) => {
- sess.codemap().with_expn_info(ExpnId::from_llvm_cookie(cookie), |info| match info {
+ sess.codemap().with_expn_info(ExpnId::from_u32(cookie), |info| match info {
Some(ei) => sess.span_err(ei.call_site, msg),
None => sess.err(msg),
});
let kind = llvm::LLVMGetMDKindIDInContext(bcx.ccx().llcx(),
key.as_ptr() as *const c_char, key.len() as c_uint);
- let val: llvm::ValueRef = C_i32(bcx.ccx(), ia.expn_id.to_llvm_cookie());
+ let val: llvm::ValueRef = C_i32(bcx.ccx(), ia.expn_id.into_u32() as i32);
llvm::LLVMSetMetadata(r, kind,
llvm::LLVMMDNodeInContext(bcx.ccx().llcx(), &val, 1));
use std::fmt;
-use libc::c_uint;
use serialize::{Encodable, Decodable, Encoder, Decoder};
pub const COMMAND_LINE_EXPN: ExpnId = ExpnId(!1);
impl ExpnId {
- pub fn from_llvm_cookie(cookie: c_uint) -> ExpnId {
- ExpnId(cookie)
+ pub fn from_u32(id: u32) -> ExpnId {
+ ExpnId(id)
}
- pub fn to_llvm_cookie(self) -> i32 {
- let ExpnId(cookie) = self;
- cookie as i32
+ pub fn into_u32(self) -> u32 {
+ self.0
}
}