OLD | NEW |
1 //===- subzero/src/IceCompiler.cpp - Driver for bitcode translation -------===// | 1 //===- subzero/src/IceCompiler.cpp - Driver for bitcode translation -------===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 /// | 9 /// |
10 /// \file | 10 /// \file |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 std::regex_match(Filename, std::regex(".*\\.ll")); | 54 std::regex_match(Filename, std::regex(".*\\.ll")); |
55 } | 55 } |
56 | 56 |
57 } // end of anonymous namespace | 57 } // end of anonymous namespace |
58 | 58 |
59 void Compiler::run(const Ice::ClFlags &Flags, GlobalContext &Ctx, | 59 void Compiler::run(const Ice::ClFlags &Flags, GlobalContext &Ctx, |
60 std::unique_ptr<llvm::DataStreamer> &&InputStream) { | 60 std::unique_ptr<llvm::DataStreamer> &&InputStream) { |
61 // The Minimal build (specifically, when dump()/emit() are not implemented) | 61 // The Minimal build (specifically, when dump()/emit() are not implemented) |
62 // allows only --filetype=obj. Check here to avoid cryptic error messages | 62 // allows only --filetype=obj. Check here to avoid cryptic error messages |
63 // downstream. | 63 // downstream. |
64 if (!BuildDefs::dump() && Ctx.getFlags().getOutFileType() != FT_Elf) { | 64 if (!BuildDefs::dump() && getFlags().getOutFileType() != FT_Elf) { |
65 Ctx.getStrError() | 65 Ctx.getStrError() |
66 << "Error: only --filetype=obj is supported in this build.\n"; | 66 << "Error: only --filetype=obj is supported in this build.\n"; |
67 Ctx.getErrorStatus()->assign(EC_Args); | 67 Ctx.getErrorStatus()->assign(EC_Args); |
68 return; | 68 return; |
69 } | 69 } |
70 | 70 |
71 TimerMarker T(Ice::TimerStack::TT_szmain, &Ctx); | 71 TimerMarker T(Ice::TimerStack::TT_szmain, &Ctx); |
72 | 72 |
73 Ctx.emitFileHeader(); | 73 Ctx.emitFileHeader(); |
74 Ctx.startWorkerThreads(); | 74 Ctx.startWorkerThreads(); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 Ctx.waitForWorkerThreads(); | 124 Ctx.waitForWorkerThreads(); |
125 if (Translator->getErrorStatus()) { | 125 if (Translator->getErrorStatus()) { |
126 Ctx.getErrorStatus()->assign(Translator->getErrorStatus().value()); | 126 Ctx.getErrorStatus()->assign(Translator->getErrorStatus().value()); |
127 } else { | 127 } else { |
128 Ctx.lowerGlobals("last"); | 128 Ctx.lowerGlobals("last"); |
129 Ctx.lowerProfileData(); | 129 Ctx.lowerProfileData(); |
130 Ctx.lowerConstants(); | 130 Ctx.lowerConstants(); |
131 Ctx.lowerJumpTables(); | 131 Ctx.lowerJumpTables(); |
132 | 132 |
133 if (Ctx.getFlags().getOutFileType() == FT_Elf) { | 133 if (getFlags().getOutFileType() == FT_Elf) { |
134 TimerMarker T1(Ice::TimerStack::TT_emitAsm, &Ctx); | 134 TimerMarker T1(Ice::TimerStack::TT_emitAsm, &Ctx); |
135 Ctx.getObjectWriter()->setUndefinedSyms(Ctx.getConstantExternSyms()); | 135 Ctx.getObjectWriter()->setUndefinedSyms(Ctx.getConstantExternSyms()); |
136 Ctx.getObjectWriter()->writeNonUserSections(); | 136 Ctx.getObjectWriter()->writeNonUserSections(); |
137 } | 137 } |
138 } | 138 } |
139 | 139 |
140 if (Ctx.getFlags().getSubzeroTimingEnabled()) | 140 if (getFlags().getSubzeroTimingEnabled()) |
141 Ctx.dumpTimers(); | 141 Ctx.dumpTimers(); |
142 | 142 |
143 if (Ctx.getFlags().getTimeEachFunction()) { | 143 if (getFlags().getTimeEachFunction()) { |
144 constexpr bool NoDumpCumulative = false; | 144 constexpr bool NoDumpCumulative = false; |
145 Ctx.dumpTimers(GlobalContext::TSK_Funcs, NoDumpCumulative); | 145 Ctx.dumpTimers(GlobalContext::TSK_Funcs, NoDumpCumulative); |
146 } | 146 } |
147 Ctx.dumpStats(); | 147 Ctx.dumpStats(); |
148 } | 148 } |
149 | 149 |
150 } // end of namespace Ice | 150 } // end of namespace Ice |
OLD | NEW |