diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2020-04-17 18:55:23 +0200 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2020-04-30 17:06:11 +0200 |
| commit | b2395a5ea6031d541ae8ee0c47caba7fdf20e19e (patch) | |
| tree | 22671e7b2650c796f1e2497cba284454e8109aae /src/librustc_codegen_llvm | |
| parent | 582d52f0bdead9f40600d468bbe8c3be7842248a (diff) | |
Add a convenience function for testing whether a static is `#[thread_local]`
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/consts.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/librustc_codegen_llvm/consts.rs b/src/librustc_codegen_llvm/consts.rs index 43ced8ee5b1..9d9b53fc4a8 100644 --- a/src/librustc_codegen_llvm/consts.rs +++ b/src/librustc_codegen_llvm/consts.rs @@ -212,6 +212,7 @@ impl CodegenCx<'ll, 'tcx> { let g = if let Some(def_id) = def_id.as_local() { let id = self.tcx.hir().as_local_hir_id(def_id); let llty = self.layout_of(ty).llvm_type(self); + // FIXME: refactor this to work without accessing the HIR let (g, attrs) = match self.tcx.hir().get(id) { Node::Item(&hir::Item { attrs, span, kind: hir::ItemKind::Static(..), .. }) => { let sym_str = sym.as_str(); |
