DEPS_green := std native:context_switch
DEPS_rustuv := std native:uv native:uv_support
DEPS_native := std
-DEPS_syntax := std term serialize log fmt_macros debug arena
+DEPS_syntax := std term serialize log fmt_macros debug arena libc
DEPS_rustc := syntax flate arena serialize getopts rbml \
time log graphviz debug rustc_llvm rustc_back
DEPS_rustc_llvm := native:rustllvm libc std
match cgcx.lto_ctxt {
Some((sess, _)) => {
- sess.codemap().with_expn_info(ExpnId(cookie as u32), |info| match info {
+ sess.codemap().with_expn_info(ExpnId::from_llvm_cookie(cookie), |info| match info {
Some(ei) => sess.span_err(ei.call_site, msg.as_slice()),
None => sess.err(msg.as_slice()),
});
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 as i32);
+ let val: llvm::ValueRef = C_i32(bcx.ccx(), ia.expn_id.to_llvm_cookie());
llvm::LLVMSetMetadata(r, kind,
llvm::LLVMMDNodeInContext(bcx.ccx().llcx(), &val, 1));
// The Rust abstract syntax tree.
-use codemap::{Span, Spanned, DUMMY_SP};
+use codemap::{Span, Spanned, DUMMY_SP, ExpnId};
use abi::Abi;
use ast_util;
use owned_slice::OwnedSlice;
pub volatile: bool,
pub alignstack: bool,
pub dialect: AsmDialect,
- pub expn_id: u32,
+ pub expn_id: ExpnId,
}
/// represents an argument in a function header
use serialize::{Encodable, Decodable, Encoder, Decoder};
use std::cell::RefCell;
use std::rc::Rc;
+use libc::c_uint;
pub trait Pos {
fn from_uint(n: uint) -> Self;
pub callee: NameAndSpan
}
-#[deriving(PartialEq, Eq, Clone, Show, Hash)]
-pub struct ExpnId(pub u32);
+#[deriving(PartialEq, Eq, Clone, Show, Hash, Encodable, Decodable)]
+pub struct ExpnId(u32);
pub static NO_EXPANSION: ExpnId = ExpnId(-1);
+impl ExpnId {
+ pub fn from_llvm_cookie(cookie: c_uint) -> ExpnId {
+ ExpnId(cookie as u32)
+ }
+
+ pub fn to_llvm_cookie(self) -> i32 {
+ let ExpnId(cookie) = self;
+ cookie as i32
+ }
+}
+
pub type FileName = String;
pub struct FileLines {
}
}
- let codemap::ExpnId(expn_id) = cx.codemap().record_expansion(codemap::ExpnInfo {
+ let expn_id = cx.codemap().record_expansion(codemap::ExpnInfo {
call_site: sp,
callee: codemap::NameAndSpan {
name: "asm".to_string(),
#[phase(plugin, link)] extern crate log;
extern crate serialize;
extern crate term;
+extern crate libc;
pub mod util {
pub mod interner;