| 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 "IceASanInstrumentation.h" |
| 18 #include "IceClFlags.h" | 18 #include "IceClFlags.h" |
| 19 #include "IceELFStreamer.h" | 19 #include "IceELFStreamer.h" |
| 20 #include "IceGlobalContext.h" | 20 #include "IceGlobalContext.h" |
| 21 #include "IceRevision.h" |
| 21 #include "LinuxMallocProfiling.h" | 22 #include "LinuxMallocProfiling.h" |
| 22 | 23 |
| 23 #ifdef __clang__ | 24 #ifdef __clang__ |
| 24 #pragma clang diagnostic push | 25 #pragma clang diagnostic push |
| 25 #pragma clang diagnostic ignored "-Wunused-parameter" | 26 #pragma clang diagnostic ignored "-Wunused-parameter" |
| 26 #endif // __clang__ | 27 #endif // __clang__ |
| 27 | 28 |
| 28 #ifdef PNACL_LLVM | 29 #ifdef PNACL_LLVM |
| 29 #include "llvm/Bitcode/NaCl/NaClBitcodeMungeUtils.h" | 30 #include "llvm/Bitcode/NaCl/NaClBitcodeMungeUtils.h" |
| 30 #endif // PNACL_LLVM | 31 #endif // PNACL_LLVM |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 void dumpBuildAttributes(Ostream &Str) { | 157 void dumpBuildAttributes(Ostream &Str) { |
| 157 // List the supported targets. | 158 // List the supported targets. |
| 158 #define SUBZERO_TARGET(TARGET) Str << "target_" #TARGET << "\n"; | 159 #define SUBZERO_TARGET(TARGET) Str << "target_" #TARGET << "\n"; |
| 159 #include "SZTargets.def" | 160 #include "SZTargets.def" |
| 160 const char *Prefix[2] = {"no", "allow"}; | 161 const char *Prefix[2] = {"no", "allow"}; |
| 161 for (size_t i = 0; i < llvm::array_lengthof(ConditionalBuildAttributes); | 162 for (size_t i = 0; i < llvm::array_lengthof(ConditionalBuildAttributes); |
| 162 ++i) { | 163 ++i) { |
| 163 const auto &A = ConditionalBuildAttributes[i]; | 164 const auto &A = ConditionalBuildAttributes[i]; |
| 164 Str << Prefix[A.FlagValue] << "_" << A.FlagName << "\n"; | 165 Str << Prefix[A.FlagValue] << "_" << A.FlagName << "\n"; |
| 165 } | 166 } |
| 167 Str << "revision_" << getSubzeroRevision() << "\n"; |
| 166 } | 168 } |
| 167 | 169 |
| 168 } // end of anonymous namespace | 170 } // end of anonymous namespace |
| 169 | 171 |
| 170 void CLCompileServer::run() { | 172 void CLCompileServer::run() { |
| 171 if (BuildDefs::dump()) { | 173 if (BuildDefs::dump()) { |
| 172 llvm::sys::PrintStackTraceOnErrorSignal(); | 174 llvm::sys::PrintStackTraceOnErrorSignal(); |
| 173 } | 175 } |
| 174 ClFlags::parseFlags(argc, argv); | 176 ClFlags::parseFlags(argc, argv); |
| 175 ClFlags &Flags = ClFlags::Flags; | 177 ClFlags &Flags = ClFlags::Flags; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 } else { | 259 } else { |
| 258 getCompiler().run(Flags, *Ctx.get(), std::move(InputStream)); | 260 getCompiler().run(Flags, *Ctx.get(), std::move(InputStream)); |
| 259 } | 261 } |
| 260 transferErrorCode( | 262 transferErrorCode( |
| 261 getReturnValue(static_cast<ErrorCodes>(Ctx->getErrorStatus()->value()))); | 263 getReturnValue(static_cast<ErrorCodes>(Ctx->getErrorStatus()->value()))); |
| 262 Ctx->dumpConstantLookupCounts(); | 264 Ctx->dumpConstantLookupCounts(); |
| 263 Ctx->dumpStrings(); | 265 Ctx->dumpStrings(); |
| 264 } | 266 } |
| 265 | 267 |
| 266 } // end of namespace Ice | 268 } // end of namespace Ice |
| OLD | NEW |