Skip to content

Commit 9e850a4

Browse files
committed
---
yaml --- r: 273573 b: refs/heads/beta c: cd5cf09 h: refs/heads/master i: 273571: 8ac56e3
1 parent 3364b0c commit 9e850a4

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
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: ab9b8441468aed505f83a2ddf74454f9cdfeab33
26+
refs/heads/beta: cd5cf09635c41e3f9b6df79a50c1fb24ee855153
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/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/beta/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)