Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //===- subzero/src/PNaClTranslator.cpp - ICE from bitcode -----------------===// | 1 //===- subzero/src/PNaClTranslator.cpp - ICE from bitcode -----------------===// |
| 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 // This file implements the PNaCl bitcode file to Ice, to machine code | 10 // This file implements the PNaCl bitcode file to Ice, to machine code |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 : NaClBitcodeParser(Cursor), Translator(Translator), | 59 : NaClBitcodeParser(Cursor), Translator(Translator), |
| 60 Mod(new Module(InputName, getGlobalContext())), DL(PNaClDataLayout), | 60 Mod(new Module(InputName, getGlobalContext())), DL(PNaClDataLayout), |
| 61 Header(Header), TypeConverter(getLLVMContext()), | 61 Header(Header), TypeConverter(getLLVMContext()), |
| 62 ErrorStatus(ErrorStatus), NumErrors(0), NumFunctionIds(0), | 62 ErrorStatus(ErrorStatus), NumErrors(0), NumFunctionIds(0), |
| 63 NumFunctionBlocks(0), | 63 NumFunctionBlocks(0), |
| 64 GlobalVarPlaceHolderType(convertToLLVMType(Ice::IceType_i8)) { | 64 GlobalVarPlaceHolderType(convertToLLVMType(Ice::IceType_i8)) { |
| 65 Mod->setDataLayout(PNaClDataLayout); | 65 Mod->setDataLayout(PNaClDataLayout); |
| 66 setErrStream(Translator.getContext()->getStrDump()); | 66 setErrStream(Translator.getContext()->getStrDump()); |
| 67 } | 67 } |
| 68 | 68 |
| 69 virtual ~TopLevelParser() {} | 69 virtual ~TopLevelParser() LLVM_OVERRIDE {} |
| 70 LLVM_OVERRIDE; | |
|
JF
2014/09/25 20:57:07
This should be:
~TopLevelParser() override {}
N
Jim Stichnoth
2014/09/26 00:11:17
Done.
| |
| 71 | 70 |
| 72 Ice::Translator &getTranslator() { return Translator; } | 71 Ice::Translator &getTranslator() { return Translator; } |
| 73 | 72 |
| 74 // Generates error with given Message. Always returns true. | 73 // Generates error with given Message. Always returns true. |
| 75 virtual bool Error(const std::string &Message) LLVM_OVERRIDE { | 74 virtual bool Error(const std::string &Message) LLVM_OVERRIDE { |
| 76 ErrorStatus = true; | 75 ErrorStatus = true; |
| 77 ++NumErrors; | 76 ++NumErrors; |
| 78 NaClBitcodeParser::Error(Message); | 77 NaClBitcodeParser::Error(Message); |
| 79 if (!AllowErrorRecovery) | 78 if (!AllowErrorRecovery) |
| 80 report_fatal_error("Unable to continue"); | 79 report_fatal_error("Unable to continue"); |
| (...skipping 2199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2280 } | 2279 } |
| 2281 | 2280 |
| 2282 void ModuleValuesymtabParser::setBbName(uint64_t Index, StringType &Name) { | 2281 void ModuleValuesymtabParser::setBbName(uint64_t Index, StringType &Name) { |
| 2283 std::string Buffer; | 2282 std::string Buffer; |
| 2284 raw_string_ostream StrBuf(Buffer); | 2283 raw_string_ostream StrBuf(Buffer); |
| 2285 StrBuf << "Can't define basic block name at global level: '" << Name | 2284 StrBuf << "Can't define basic block name at global level: '" << Name |
| 2286 << "' -> " << Index; | 2285 << "' -> " << Index; |
| 2287 Error(StrBuf.str()); | 2286 Error(StrBuf.str()); |
| 2288 } | 2287 } |
| 2289 | 2288 |
| 2290 bool ModuleParser::ParseBlock(unsigned BlockID) LLVM_OVERRIDE { | 2289 bool ModuleParser::ParseBlock(unsigned BlockID) { |
|
JF
2014/09/25 20:57:07
This should be override. Or does it not override (
Jim Stichnoth
2014/09/26 00:11:17
The override is already provided in the class defi
| |
| 2291 switch (BlockID) { | 2290 switch (BlockID) { |
| 2292 case naclbitc::BLOCKINFO_BLOCK_ID: | 2291 case naclbitc::BLOCKINFO_BLOCK_ID: |
| 2293 return NaClBitcodeParser::ParseBlock(BlockID); | 2292 return NaClBitcodeParser::ParseBlock(BlockID); |
| 2294 case naclbitc::TYPE_BLOCK_ID_NEW: { | 2293 case naclbitc::TYPE_BLOCK_ID_NEW: { |
| 2295 TypesParser Parser(BlockID, this); | 2294 TypesParser Parser(BlockID, this); |
| 2296 return Parser.ParseThisBlock(); | 2295 return Parser.ParseThisBlock(); |
| 2297 } | 2296 } |
| 2298 case naclbitc::GLOBALVAR_BLOCK_ID: { | 2297 case naclbitc::GLOBALVAR_BLOCK_ID: { |
| 2299 GlobalsParser Parser(BlockID, this); | 2298 GlobalsParser Parser(BlockID, this); |
| 2300 return Parser.ParseThisBlock(); | 2299 return Parser.ParseThisBlock(); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2431 | 2430 |
| 2432 if (TopLevelBlocks != 1) { | 2431 if (TopLevelBlocks != 1) { |
| 2433 errs() << IRFilename | 2432 errs() << IRFilename |
| 2434 << ": Contains more than one module. Found: " << TopLevelBlocks | 2433 << ": Contains more than one module. Found: " << TopLevelBlocks |
| 2435 << "\n"; | 2434 << "\n"; |
| 2436 ErrorStatus = true; | 2435 ErrorStatus = true; |
| 2437 } | 2436 } |
| 2438 } | 2437 } |
| 2439 | 2438 |
| 2440 } // end of namespace Ice | 2439 } // end of namespace Ice |
| OLD | NEW |