[PATCH] D47398: [WebAssembly] MC: Add compile-twice test and fix corresponding bug
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 29 20:01:27 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL333494: [WebAssembly] MC: Add compile-twice test and fix corresponding bug (authored by sbc, committed by ).
Repository:
rL LLVM
https://reviews.llvm.org/D47398
Files:
llvm/trunk/lib/MC/MCContext.cpp
llvm/trunk/lib/MC/WasmObjectWriter.cpp
llvm/trunk/test/MC/WebAssembly/compile-twice.ll
Index: llvm/trunk/test/MC/WebAssembly/compile-twice.ll
===================================================================
--- llvm/trunk/test/MC/WebAssembly/compile-twice.ll
+++ llvm/trunk/test/MC/WebAssembly/compile-twice.ll
@@ -0,0 +1,14 @@
+; Check that there is no persistent state in the WabAssembly emitter that cause
+; issues when reusing the pass manager.
+; RUN: llc -mtriple=wasm32-unknown-unknown -compile-twice -filetype=obj %s -o -
+
+; Force the creation of a DWARF section
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!3, !4}
+
+ at myglobal = global i32 0, align 4
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "LLVM", isOptimized: true, emissionKind: FullDebug)
+!1 = !DIFile(filename: "<stdin>", directory: "/")
+!3 = !{i32 2, !"Dwarf Version", i32 4}
+!4 = !{i32 2, !"Debug Info Version", i32 3}
Index: llvm/trunk/lib/MC/WasmObjectWriter.cpp
===================================================================
--- llvm/trunk/lib/MC/WasmObjectWriter.cpp
+++ llvm/trunk/lib/MC/WasmObjectWriter.cpp
@@ -270,9 +270,9 @@
Globals.clear();
DataSegments.clear();
SectionFunctions.clear();
- MCObjectWriter::reset();
NumFunctionImports = 0;
NumGlobalImports = 0;
+ MCObjectWriter::reset();
}
void writeHeader(const MCAssembler &Asm);
Index: llvm/trunk/lib/MC/MCContext.cpp
===================================================================
--- llvm/trunk/lib/MC/MCContext.cpp
+++ llvm/trunk/lib/MC/MCContext.cpp
@@ -105,6 +105,7 @@
MachOUniquingMap.clear();
ELFUniquingMap.clear();
COFFUniquingMap.clear();
+ WasmUniquingMap.clear();
NextID.clear();
AllowTemporaryLabels = true;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47398.149028.patch
Type: text/x-patch
Size: 1676 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180530/47443ae2/attachment.bin>
More information about the llvm-commits
mailing list