Skip to content

Commit e71a512

Browse files
committed
---
yaml --- r: 271535 b: refs/heads/auto c: cd5cf09 h: refs/heads/master i: 271533: 344eb8b 271531: 5468c2e 271527: 793f338 271519: 8ecce88
1 parent 555e682 commit e71a512

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: ab9b8441468aed505f83a2ddf74454f9cdfeab33
11+
refs/heads/auto: cd5cf09635c41e3f9b6df79a50c1fb24ee855153
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/src/librustc/front/map/mod.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use dep_graph::{DepGraph, DepNode};
1919

2020
use middle::cstore::InlinedItem;
2121
use middle::cstore::InlinedItem as II;
22-
use middle::def_id::DefId;
22+
use middle::def_id::{CRATE_DEF_INDEX, DefId};
2323

2424
use syntax::abi::Abi;
2525
use syntax::ast::{self, Name, NodeId, DUMMY_NODE_ID};
@@ -388,6 +388,15 @@ impl<'ast> Map<'ast> {
388388
self.forest.krate()
389389
}
390390

391+
/// Get the attributes on the krate. This is preferable to
392+
/// invoking `krate.attrs` because it registers a tighter
393+
/// dep-graph access.
394+
pub fn krate_attrs(&self) -> &'ast [ast::Attribute] {
395+
let crate_root_def_id = DefId::local(CRATE_DEF_INDEX);
396+
self.dep_graph.read(DepNode::Hir(crate_root_def_id));
397+
&self.forest.krate.attrs
398+
}
399+
391400
/// Retrieve the Node corresponding to `id`, panicking if it cannot
392401
/// be found.
393402
pub fn get(&self, id: NodeId) -> Node<'ast> {

branches/auto/src/librustc_trans/trans/debuginfo/gdb.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,7 @@ pub fn get_or_insert_gdb_debug_scripts_section_global(ccx: &CrateContext)
9090

9191
pub fn needs_gdb_debug_scripts_section(ccx: &CrateContext) -> bool {
9292
let omit_gdb_pretty_printer_section =
93-
attr::contains_name(&ccx.tcx()
94-
.map
95-
.krate()
96-
.attrs,
93+
attr::contains_name(&ccx.tcx().map.krate_attrs(),
9794
"omit_gdb_pretty_printer_section");
9895

9996
!omit_gdb_pretty_printer_section &&

0 commit comments

Comments
 (0)