Correections due to refactoring .
This commit is contained in:
parent
5a68116240
commit
e8dfaa71e6
@ -810,7 +810,7 @@ pub fn maybe_get_item_ast<'tcx>(cdata: Cmd, tcx: &TyCtxt<'tcx>, id: DefIndex)
|
||||
let mut parent_path = item_path(item_doc);
|
||||
parent_path.pop();
|
||||
let mut parent_def_path = def_path(cdata, id);
|
||||
parent_def_path.pop();
|
||||
parent_def_path.data.pop();
|
||||
if let Some(ast_doc) = reader::maybe_get_doc(item_doc, tag_ast as usize) {
|
||||
let ii = decode_inlined_item(cdata,
|
||||
tcx,
|
||||
@ -830,7 +830,7 @@ pub fn maybe_get_item_ast<'tcx>(cdata: Cmd, tcx: &TyCtxt<'tcx>, id: DefIndex)
|
||||
let mut grandparent_path = parent_path;
|
||||
grandparent_path.pop();
|
||||
let mut grandparent_def_path = parent_def_path;
|
||||
grandparent_def_path.pop();
|
||||
grandparent_def_path.data.pop();
|
||||
let parent_doc = cdata.lookup_item(parent_did.index);
|
||||
if let Some(ast_doc) = reader::maybe_get_doc(parent_doc, tag_ast as usize) {
|
||||
let ii = decode_inlined_item(cdata,
|
||||
|
@ -49,12 +49,11 @@ pub fn get_or_insert_link_guard<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>)
|
||||
}
|
||||
|
||||
let llfty = Type::func(&[], &Type::void(ccx));
|
||||
let guard_function = declare::define_cfn(ccx,
|
||||
&guard_name[..],
|
||||
llfty,
|
||||
ccx.tcx().mk_nil()).unwrap_or_else(|| {
|
||||
ccx.sess().bug("Link guard already defined.");
|
||||
});
|
||||
if declare::get_defined_value(ccx, &guard_name[..]).is_some() {
|
||||
ccx.sess().bug(
|
||||
&format!("Link guard already defined"));
|
||||
}
|
||||
let guard_function = declare::declare_cfn(ccx, &guard_name[..], llfty);
|
||||
|
||||
attributes::emit_uwtable(guard_function, true);
|
||||
attributes::unwind(guard_function, false);
|
||||
@ -76,10 +75,12 @@ pub fn get_or_insert_link_guard<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>)
|
||||
|
||||
let dependency_guard_name = link_guard_name(&crate_name[..], &svh);
|
||||
|
||||
let decl = declare::declare_cfn(ccx,
|
||||
&dependency_guard_name[..],
|
||||
llfty,
|
||||
ccx.tcx().mk_nil());
|
||||
if declare::get_defined_value(ccx, &dependency_guard_name[..]).is_some() {
|
||||
ccx.sess().bug(
|
||||
&format!("Link guard already defined for dependency `{}`",
|
||||
crate_name));
|
||||
}
|
||||
let decl = declare::declare_cfn(ccx, &dependency_guard_name[..], llfty);
|
||||
attributes::unwind(decl, false);
|
||||
|
||||
llvm::LLVMPositionBuilderAtEnd(bld, llbb);
|
||||
|
@ -21,6 +21,7 @@ use rustc_front::intravisit::{self, Visitor};
|
||||
use syntax::ast;
|
||||
use syntax::attr::AttrMetaMethods;
|
||||
use trans::common::CrateContext;
|
||||
use trans::monomorphize::Instance;
|
||||
|
||||
const SYMBOL_NAME: &'static str = "rustc_symbol_name";
|
||||
const ITEM_PATH: &'static str = "rustc_item_path";
|
||||
@ -50,8 +51,9 @@ impl<'a, 'tcx> SymbolNamesTest<'a, 'tcx> {
|
||||
let def_id = self.tcx.map.local_def_id(node_id);
|
||||
for attr in self.tcx.get_attrs(def_id).iter() {
|
||||
if attr.check_name(SYMBOL_NAME) {
|
||||
// for now, just monomorphic names
|
||||
let name = symbol_names::exported_name(self.ccx, def_id, &[]);
|
||||
// for now, can only use on monomorphic names
|
||||
let instance = Instance::mono(self.tcx, def_id);
|
||||
let name = symbol_names::exported_name(self.ccx, &instance);
|
||||
self.tcx.sess.span_err(attr.span, &format!("symbol-name({})", name));
|
||||
} else if attr.check_name(ITEM_PATH) {
|
||||
let path = self.tcx.item_path_str(def_id);
|
||||
|
Loading…
Reference in New Issue
Block a user