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 /// \file | 10 /// \file |
(...skipping 2952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2963 if (Index >= getFunctionParser()->getFunc()->getNumNodes()) { | 2963 if (Index >= getFunctionParser()->getFunc()->getNumNodes()) { |
2964 reportUnableToAssign("Basic block", Index, Name); | 2964 reportUnableToAssign("Basic block", Index, Name); |
2965 return; | 2965 return; |
2966 } | 2966 } |
2967 std::string Nm(Name.data(), Name.size()); | 2967 std::string Nm(Name.data(), Name.size()); |
2968 if (Ice::BuildDefs::dump()) | 2968 if (Ice::BuildDefs::dump()) |
2969 getFunctionParser()->getFunc()->getNodes()[Index]->setName(Nm); | 2969 getFunctionParser()->getFunc()->getNodes()[Index]->setName(Nm); |
2970 } | 2970 } |
2971 | 2971 |
2972 bool FunctionParser::ParseBlock(unsigned BlockID) { | 2972 bool FunctionParser::ParseBlock(unsigned BlockID) { |
| 2973 #ifndef PNACL_LLVM |
| 2974 constexpr bool PNaClAllowLocalSymbolTables = true; |
| 2975 #endif // !PNACL_LLVM |
2973 switch (BlockID) { | 2976 switch (BlockID) { |
2974 case naclbitc::CONSTANTS_BLOCK_ID: { | 2977 case naclbitc::CONSTANTS_BLOCK_ID: { |
2975 ConstantsParser Parser(BlockID, this); | 2978 ConstantsParser Parser(BlockID, this); |
2976 return Parser.ParseThisBlock(); | 2979 return Parser.ParseThisBlock(); |
2977 } | 2980 } |
2978 case naclbitc::VALUE_SYMTAB_BLOCK_ID: { | 2981 case naclbitc::VALUE_SYMTAB_BLOCK_ID: { |
2979 if (PNaClAllowLocalSymbolTables) { | 2982 if (PNaClAllowLocalSymbolTables) { |
2980 FunctionValuesymtabParser Parser(BlockID, this); | 2983 FunctionValuesymtabParser Parser(BlockID, this); |
2981 return Parser.ParseThisBlock(); | 2984 return Parser.ParseThisBlock(); |
2982 } | 2985 } |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3302 raw_string_ostream StrBuf(Buffer); | 3305 raw_string_ostream StrBuf(Buffer); |
3303 StrBuf << IRFilename << ": Does not contain a module!"; | 3306 StrBuf << IRFilename << ": Does not contain a module!"; |
3304 llvm::report_fatal_error(StrBuf.str()); | 3307 llvm::report_fatal_error(StrBuf.str()); |
3305 } | 3308 } |
3306 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { | 3309 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { |
3307 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes"); | 3310 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes"); |
3308 } | 3311 } |
3309 } | 3312 } |
3310 | 3313 |
3311 } // end of namespace Ice | 3314 } // end of namespace Ice |
OLD | NEW |