| Index: src/PNaClTranslator.cpp
|
| diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
|
| index ac4c6976477ec5e1dbb8a1d6a380924a06db2227..82d35db89b343bdd3f81740ecc6358101b2979f0 100644
|
| --- a/src/PNaClTranslator.cpp
|
| +++ b/src/PNaClTranslator.cpp
|
| @@ -37,12 +37,6 @@
|
| namespace {
|
| using namespace llvm;
|
|
|
| -// TODO(kschimpf) Remove error recovery once implementation complete.
|
| -static cl::opt<bool> AllowErrorRecovery(
|
| - "allow-pnacl-reader-error-recovery",
|
| - cl::desc("Allow error recovery when reading PNaCl bitcode."),
|
| - cl::init(false));
|
| -
|
| // Models elements in the list of types defined in the types block.
|
| // These elements can be undefined, a (simple) type, or a function type
|
| // signature. Note that an extended type is undefined on construction.
|
| @@ -440,7 +434,7 @@ bool TopLevelParser::Error(const std::string &Message) {
|
| ErrorStatus = true;
|
| ++NumErrors;
|
| NaClBitcodeParser::Error(Message);
|
| - if (!AllowErrorRecovery)
|
| + if (!Translator.getFlags().AllowErrorRecovery)
|
| report_fatal_error("Unable to continue");
|
| return true;
|
| }
|
| @@ -2967,6 +2961,11 @@ void PNaClTranslator::translate(const std::string &IRFilename) {
|
| }
|
|
|
| std::unique_ptr<MemoryBuffer> MemBuf(ErrOrFile.get().release());
|
| + translateBuffer(IRFilename, MemBuf.get());
|
| +}
|
| +
|
| +void PNaClTranslator::translateBuffer(const std::string &IRFilename,
|
| + MemoryBuffer *MemBuf) {
|
| if (MemBuf->getBufferSize() % 4 != 0) {
|
| errs() << IRFilename
|
| << ": Bitcode stream should be a multiple of 4 bytes in length.\n";
|
|
|