| OLD | NEW |
| 1 //===- subzero/src/IceCompileServer.cpp - Compile server ------------------===// | 1 //===- subzero/src/IceCompileServer.cpp - Compile server ------------------===// |
| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 return transferErrorCode(getReturnValue(Ice::EC_Bitcode)); | 236 return transferErrorCode(getReturnValue(Ice::EC_Bitcode)); |
| 237 } | 237 } |
| 238 | 238 |
| 239 if (Flags.getGenerateBuildAtts()) { | 239 if (Flags.getGenerateBuildAtts()) { |
| 240 dumpBuildAttributes(*Os.get()); | 240 dumpBuildAttributes(*Os.get()); |
| 241 return transferErrorCode(getReturnValue(Ice::EC_None)); | 241 return transferErrorCode(getReturnValue(Ice::EC_None)); |
| 242 } | 242 } |
| 243 | 243 |
| 244 Ctx.reset(new GlobalContext(Ls.get(), Os.get(), Ls.get(), ELFStr.get())); | 244 Ctx.reset(new GlobalContext(Ls.get(), Os.get(), Ls.get(), ELFStr.get())); |
| 245 | 245 |
| 246 // TODO(tlively): Make this instantiate an instrumentation subclass | |
| 247 if (!BuildDefs::minimal() && getFlags().getSanitizeAddresses()) { | 246 if (!BuildDefs::minimal() && getFlags().getSanitizeAddresses()) { |
| 248 std::unique_ptr<Instrumentation> Instr(new ASanInstrumentation(Ctx.get())); | 247 std::unique_ptr<Instrumentation> Instr(new ASanInstrumentation(Ctx.get())); |
| 249 Ctx->setInstrumentation(std::move(Instr)); | 248 Ctx->setInstrumentation(std::move(Instr)); |
| 250 } | 249 } |
| 251 | 250 |
| 252 if (getFlags().getNumTranslationThreads() != 0) { | 251 if (getFlags().getNumTranslationThreads() != 0) { |
| 253 std::thread CompileThread([this, &Flags, &InputStream]() { | 252 std::thread CompileThread([this, &Flags, &InputStream]() { |
| 254 Ctx->initParserThread(); | 253 Ctx->initParserThread(); |
| 255 getCompiler().run(Flags, *Ctx.get(), std::move(InputStream)); | 254 getCompiler().run(Flags, *Ctx.get(), std::move(InputStream)); |
| 256 }); | 255 }); |
| 257 CompileThread.join(); | 256 CompileThread.join(); |
| 258 } else { | 257 } else { |
| 259 getCompiler().run(Flags, *Ctx.get(), std::move(InputStream)); | 258 getCompiler().run(Flags, *Ctx.get(), std::move(InputStream)); |
| 260 } | 259 } |
| 261 transferErrorCode( | 260 transferErrorCode( |
| 262 getReturnValue(static_cast<ErrorCodes>(Ctx->getErrorStatus()->value()))); | 261 getReturnValue(static_cast<ErrorCodes>(Ctx->getErrorStatus()->value()))); |
| 263 Ctx->dumpConstantLookupCounts(); | 262 Ctx->dumpConstantLookupCounts(); |
| 264 Ctx->dumpStrings(); | 263 Ctx->dumpStrings(); |
| 265 } | 264 } |
| 266 | 265 |
| 267 } // end of namespace Ice | 266 } // end of namespace Ice |
| OLD | NEW |