1
Fork 0

Implement a file-path remapping feature in support of debuginfo and reproducible builds.

This commit is contained in:
Michael Woerister 2017-04-24 19:01:19 +02:00
parent b0a4074c5e
commit 39ffea31df
34 changed files with 464 additions and 315 deletions

View file

@ -142,7 +142,7 @@ pub fn expand_include_str(cx: &mut ExtCtxt, sp: Span, tts: &[tokenstream::TokenT
// Add this input file to the code map to make it available as
// dependency information
let filename = format!("{}", file.display());
cx.codemap().new_filemap_and_lines(&filename, None, &src);
cx.codemap().new_filemap_and_lines(&filename, &src);
base::MacEager::expr(cx.expr_str(sp, Symbol::intern(&src)))
}
@ -173,7 +173,7 @@ pub fn expand_include_bytes(cx: &mut ExtCtxt, sp: Span, tts: &[tokenstream::Toke
// Add this input file to the code map to make it available as
// dependency information, but don't enter it's contents
let filename = format!("{}", file.display());
cx.codemap().new_filemap_and_lines(&filename, None, "");
cx.codemap().new_filemap_and_lines(&filename, "");
base::MacEager::expr(cx.expr_lit(sp, ast::LitKind::ByteStr(Rc::new(bytes))))
}