about summary refs log tree commit diff
path: root/src/librustc_metadata/encoder.rs
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-04-14 17:41:03 -0400
committerGitHub <noreply@github.com>2017-04-14 17:41:03 -0400
commite6f6b445aa2fc71f626dff7f7c7988b04f4a292d (patch)
tree7ecc980b1e110fbf55b96cf7ac88825d77244f54 /src/librustc_metadata/encoder.rs
parentba377982a3fde98a3cac02493c16dc623b02a421 (diff)
parenta35c4e354a65fdbbb61741db3a9dd1c190f2f146 (diff)
Rollup merge of #40702 - mrhota:global_asm, r=nagisa
Implement global_asm!() (RFC 1548)

This is a first attempt. ~~One (potential) problem I haven't solved is how to handle multiple usages of `global_asm!` in a module/crate. It looks like `LLVMSetModuleInlineAsm` overwrites module asm, and `LLVMAppendModuleInlineAsm` is not provided in LLVM C headers 😦~~

I can provide more detail as needed, but honestly, there's not a lot going on here.

r? @eddyb

CC @Amanieu @jackpot51

Tracking issue: #35119
Diffstat (limited to 'src/librustc_metadata/encoder.rs')
-rw-r--r--src/librustc_metadata/encoder.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/librustc_metadata/encoder.rs b/src/librustc_metadata/encoder.rs
index 3bf22f8a6c8..0e204695e8f 100644
--- a/src/librustc_metadata/encoder.rs
+++ b/src/librustc_metadata/encoder.rs
@@ -677,6 +677,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> EntryBuilder<'a, 'b, 'tcx> {
                 return self.encode_info_for_mod(FromId(item.id, (m, &item.attrs, &item.vis)));
             }
             hir::ItemForeignMod(_) => EntryKind::ForeignMod,
+            hir::ItemGlobalAsm(..) => EntryKind::GlobalAsm,
             hir::ItemTy(..) => EntryKind::Type,
             hir::ItemEnum(..) => EntryKind::Enum(get_repr_options(&tcx, def_id)),
             hir::ItemStruct(ref struct_def, _) => {
@@ -917,6 +918,7 @@ impl<'a, 'b, 'tcx> IndexBuilder<'a, 'b, 'tcx> {
             hir::ItemFn(..) |
             hir::ItemMod(..) |
             hir::ItemForeignMod(..) |
+            hir::ItemGlobalAsm(..) |
             hir::ItemExternCrate(..) |
             hir::ItemUse(..) |
             hir::ItemDefaultImpl(..) |