Index: src/IceGlobalContext.cpp |
diff --git a/src/IceGlobalContext.cpp b/src/IceGlobalContext.cpp |
index 8b345d47ed0a807d5d0dcd7dcbea10594d3e2b6c..095f288ae88b8fb30982d477a733f9957b536c46 100644 |
--- a/src/IceGlobalContext.cpp |
+++ b/src/IceGlobalContext.cpp |
@@ -103,17 +103,20 @@ public: |
UndefPool Undefs; |
}; |
-GlobalContext::GlobalContext(llvm::raw_ostream *OsDump, |
- llvm::raw_ostream *OsEmit, VerboseMask Mask, |
+GlobalContext::GlobalContext(Ostream *OsDump, Ostream *OsEmit, |
+ ELFStreamer *ELFStr, VerboseMask Mask, |
TargetArch Arch, OptLevel Opt, |
IceString TestPrefix, const ClFlags &Flags) |
: StrDump(OsDump), StrEmit(OsEmit), VMask(Mask), |
ConstPool(new ConstantPool()), Arch(Arch), Opt(Opt), |
TestPrefix(TestPrefix), Flags(Flags), HasEmittedFirstMethod(false), |
- RNG("") { |
+ RNG(""), ObjectWriter() { |
// Pre-register built-in stack names. |
newTimerStackID("Total across all functions"); |
newTimerStackID("Per-function summary"); |
+ if (Flags.UseELFWriter) { |
+ ObjectWriter.reset(new ELFObjectWriter(*this, *ELFStr)); |
+ } |
} |
// Scan a string for S[0-9A-Z]*_ patterns and replace them with |