1
Fork 0

Add some more with_ignore to get tests passing

This commit is contained in:
Alex Crichton 2017-09-07 07:21:49 -07:00
parent c6445ba25b
commit 2ee7493b2a
3 changed files with 26 additions and 15 deletions

View file

@ -1101,10 +1101,10 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
} }
pub fn lang_items(self) -> Rc<middle::lang_items::LanguageItems> { pub fn lang_items(self) -> Rc<middle::lang_items::LanguageItems> {
// Right now we insert a `with_ignore` node in the dep graph here to // FIXME(#42293) Right now we insert a `with_ignore` node in the dep
// ignore the fact that `get_lang_items` below depends on the entire // graph here to ignore the fact that `get_lang_items` below depends on
// crate. For now this'll prevent false positives of recompiling too // the entire crate. For now this'll prevent false positives of
// much when anything changes. // recompiling too much when anything changes.
// //
// Once red/green incremental compilation lands we should be able to // Once red/green incremental compilation lands we should be able to
// remove this because while the crate changes often the lint level map // remove this because while the crate changes often the lint level map
@ -1115,6 +1115,8 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
} }
pub fn stability(self) -> Rc<stability::Index<'tcx>> { pub fn stability(self) -> Rc<stability::Index<'tcx>> {
// FIXME(#42293) we should actually track this, but fails too many tests
// today.
self.dep_graph.with_ignore(|| { self.dep_graph.with_ignore(|| {
self.stability_index(LOCAL_CRATE) self.stability_index(LOCAL_CRATE)
}) })

View file

@ -124,13 +124,17 @@ pub fn get_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
} }
} }
if ccx.use_dll_storage_attrs() && // FIXME(#42293) we should actually track this, but fails too many tests
tcx.is_dllimport_foreign_item(instance_def_id) // today.
{ tcx.dep_graph.with_ignore(|| {
unsafe { if ccx.use_dll_storage_attrs() &&
llvm::LLVMSetDLLStorageClass(llfn, llvm::DLLStorageClass::DllImport); tcx.is_dllimport_foreign_item(instance_def_id)
{
unsafe {
llvm::LLVMSetDLLStorageClass(llfn, llvm::DLLStorageClass::DllImport);
}
} }
} });
llfn llfn
}; };

View file

@ -211,12 +211,17 @@ pub fn get_static(ccx: &CrateContext, def_id: DefId) -> ValueRef {
g g
}; };
if ccx.use_dll_storage_attrs() && ccx.tcx().is_dllimport_foreign_item(def_id) {
// For foreign (native) libs we know the exact storage type to use. // FIXME(#42293) we should actually track this, but fails too many tests
unsafe { // today.
llvm::LLVMSetDLLStorageClass(g, llvm::DLLStorageClass::DllImport); ccx.tcx().dep_graph.with_ignore(|| {
if ccx.use_dll_storage_attrs() && ccx.tcx().is_dllimport_foreign_item(def_id) {
// For foreign (native) libs we know the exact storage type to use.
unsafe {
llvm::LLVMSetDLLStorageClass(g, llvm::DLLStorageClass::DllImport);
}
} }
} });
ccx.instances().borrow_mut().insert(instance, g); ccx.instances().borrow_mut().insert(instance, g);
ccx.statics().borrow_mut().insert(g, def_id); ccx.statics().borrow_mut().insert(g, def_id);
g g