| 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 |
| 11 /// \brief Defines the basic commandline-based compile server. | 11 /// \brief Defines the basic commandline-based compile server. |
| 12 /// | 12 /// |
| 13 //===----------------------------------------------------------------------===// | 13 //===----------------------------------------------------------------------===// |
| 14 | 14 |
| 15 #include "IceCompileServer.h" | 15 #include "IceCompileServer.h" |
| 16 | 16 |
| 17 #include "IceASanInstrumentation.h" |
| 17 #include "IceClFlags.h" | 18 #include "IceClFlags.h" |
| 18 #include "IceELFStreamer.h" | 19 #include "IceELFStreamer.h" |
| 19 #include "IceGlobalContext.h" | 20 #include "IceGlobalContext.h" |
| 20 #include "LinuxMallocProfiling.h" | 21 #include "LinuxMallocProfiling.h" |
| 21 | 22 |
| 22 #ifdef __clang__ | 23 #ifdef __clang__ |
| 23 #pragma clang diagnostic push | 24 #pragma clang diagnostic push |
| 24 #pragma clang diagnostic ignored "-Wunused-parameter" | 25 #pragma clang diagnostic ignored "-Wunused-parameter" |
| 25 #endif // __clang__ | 26 #endif // __clang__ |
| 26 | 27 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 | 238 |
| 238 if (Flags.getGenerateBuildAtts()) { | 239 if (Flags.getGenerateBuildAtts()) { |
| 239 dumpBuildAttributes(*Os.get()); | 240 dumpBuildAttributes(*Os.get()); |
| 240 return transferErrorCode(getReturnValue(Ice::EC_None)); | 241 return transferErrorCode(getReturnValue(Ice::EC_None)); |
| 241 } | 242 } |
| 242 | 243 |
| 243 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())); |
| 244 | 245 |
| 245 // TODO(tlively): Make this instantiate an instrumentation subclass | 246 // TODO(tlively): Make this instantiate an instrumentation subclass |
| 246 if (!BuildDefs::minimal() && getFlags().getSanitizeAddresses()) { | 247 if (!BuildDefs::minimal() && getFlags().getSanitizeAddresses()) { |
| 247 std::unique_ptr<Instrumentation> Instr(new Instrumentation(Ctx.get())); | 248 std::unique_ptr<Instrumentation> Instr(new ASanInstrumentation(Ctx.get())); |
| 248 Ctx->setInstrumentation(std::move(Instr)); | 249 Ctx->setInstrumentation(std::move(Instr)); |
| 249 } | 250 } |
| 250 | 251 |
| 251 if (getFlags().getNumTranslationThreads() != 0) { | 252 if (getFlags().getNumTranslationThreads() != 0) { |
| 252 std::thread CompileThread([this, &Flags, &InputStream]() { | 253 std::thread CompileThread([this, &Flags, &InputStream]() { |
| 253 Ctx->initParserThread(); | 254 Ctx->initParserThread(); |
| 254 getCompiler().run(Flags, *Ctx.get(), std::move(InputStream)); | 255 getCompiler().run(Flags, *Ctx.get(), std::move(InputStream)); |
| 255 }); | 256 }); |
| 256 CompileThread.join(); | 257 CompileThread.join(); |
| 257 } else { | 258 } else { |
| 258 getCompiler().run(Flags, *Ctx.get(), std::move(InputStream)); | 259 getCompiler().run(Flags, *Ctx.get(), std::move(InputStream)); |
| 259 } | 260 } |
| 260 transferErrorCode( | 261 transferErrorCode( |
| 261 getReturnValue(static_cast<ErrorCodes>(Ctx->getErrorStatus()->value()))); | 262 getReturnValue(static_cast<ErrorCodes>(Ctx->getErrorStatus()->value()))); |
| 262 Ctx->dumpConstantLookupCounts(); | 263 Ctx->dumpConstantLookupCounts(); |
| 263 Ctx->dumpStrings(); | 264 Ctx->dumpStrings(); |
| 264 } | 265 } |
| 265 | 266 |
| 266 } // end of namespace Ice | 267 } // end of namespace Ice |
| OLD | NEW |