Chromium Code Reviews| Index: src/IceCompileServer.cpp |
| diff --git a/src/IceCompileServer.cpp b/src/IceCompileServer.cpp |
| index 23874f0f5ac48b443c8945155e95ccda9e782c2f..00e0508fc0e5aa88515a095b4292b05ac674c1a0 100644 |
| --- a/src/IceCompileServer.cpp |
| +++ b/src/IceCompileServer.cpp |
| @@ -21,8 +21,6 @@ |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wunused-parameter" |
| -// Include code to handle converting textual bitcode records to binary (for |
| -// INPUT_IS_TEXTUAL_BITCODE). |
| #include "llvm/Bitcode/NaCl/NaClBitcodeMungeUtils.h" |
| #include "llvm/Support/FileSystem.h" |
| #include "llvm/Support/raw_os_ostream.h" |
| @@ -39,10 +37,6 @@ namespace Ice { |
| namespace { |
| -static_assert(!(BuildDefs::textualBitcode() && PNACL_BROWSER_TRANSLATOR), |
| - "Can not define INPUT_IS_TEXTUAL_BITCODE when building browswer " |
| - "translator"); |
| - |
| // Define a SmallVector backed buffer as a data stream, so that it |
| // can hold the generated binary version of the textual bitcode in the |
| // input file. |
| @@ -64,12 +58,12 @@ TextDataStreamer *TextDataStreamer::create(const IceString &Filename, |
| llvm::raw_string_ostream ErrStrm(*Err); |
| if (std::error_code EC = llvm::readNaClRecordTextAndBuildBitcode( |
| Filename, Streamer->BitcodeBuffer, &ErrStrm)) { |
| - ErrStrm << EC.message(); // << "\n"; |
| + ErrStrm << EC.message(); |
| ErrStrm.flush(); |
| delete Streamer; |
| return nullptr; |
| } |
| - // ErrStrm.flush(); |
| + ErrStrm.flush(); |
| return Streamer; |
| } |
| @@ -151,9 +145,13 @@ void CLCompileServer::run() { |
| } break; |
| } |
| + if (BuildDefs::minimal() && ExtraFlags.getBitcodeAsText()) |
| + llvm::report_fatal_error("Can't specify 'bitcode-as-text' flag in " |
|
jvoung (off chromium)
2015/07/22 21:20:45
Hopefully the optimizer is sufficiently smart to c
Karl
2015/07/22 21:58:16
I early had !BuildDefs::minimal() in the "?:", but
|
| + "minimal build"); |
| + |
| IceString StrError; |
| std::unique_ptr<llvm::DataStreamer> InputStream( |
| - BuildDefs::textualBitcode() |
| + ExtraFlags.getBitcodeAsText() |
| ? TextDataStreamer::create(ExtraFlags.getIRFilename(), &StrError) |
| : llvm::getDataFileStreamer(ExtraFlags.getIRFilename(), &StrError)); |
| if (!StrError.empty() || !InputStream) { |