| 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 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 return NULL; | 872 return NULL; |
| 873 Ice::Variable *Var = Func->makeVariable(Ty, CurrentNode); | 873 Ice::Variable *Var = Func->makeVariable(Ty, CurrentNode); |
| 874 LocalOperands.push_back(Var); | 874 LocalOperands.push_back(Var); |
| 875 return Var; | 875 return Var; |
| 876 } | 876 } |
| 877 | 877 |
| 878 // Converts a relative index (to the next instruction to be read) to | 878 // Converts a relative index (to the next instruction to be read) to |
| 879 // an absolute value index. | 879 // an absolute value index. |
| 880 uint32_t convertRelativeToAbsIndex(int32_t Id) { | 880 uint32_t convertRelativeToAbsIndex(int32_t Id) { |
| 881 int32_t AbsNextId = CachedNumGlobalValueIDs + LocalOperands.size(); | 881 int32_t AbsNextId = CachedNumGlobalValueIDs + LocalOperands.size(); |
| 882 if (Id > 0 && AbsNextId < static_cast<uint32_t>(Id)) { | 882 if (Id > 0 && AbsNextId < Id) { |
| 883 std::string Buffer; | 883 std::string Buffer; |
| 884 raw_string_ostream StrBuf(Buffer); | 884 raw_string_ostream StrBuf(Buffer); |
| 885 StrBuf << "Invalid relative value id: " << Id | 885 StrBuf << "Invalid relative value id: " << Id |
| 886 << " (must be <= " << AbsNextId << ")"; | 886 << " (must be <= " << AbsNextId << ")"; |
| 887 Error(StrBuf.str()); | 887 Error(StrBuf.str()); |
| 888 // TODO(kschimpf) Remove error recovery once implementation complete. | 888 // TODO(kschimpf) Remove error recovery once implementation complete. |
| 889 return 0; | 889 return 0; |
| 890 } | 890 } |
| 891 return AbsNextId - Id; | 891 return AbsNextId - Id; |
| 892 } | 892 } |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1301 if (TopLevelBlocks != 1) { | 1301 if (TopLevelBlocks != 1) { |
| 1302 errs() << IRFilename | 1302 errs() << IRFilename |
| 1303 << ": Contains more than one module. Found: " << TopLevelBlocks | 1303 << ": Contains more than one module. Found: " << TopLevelBlocks |
| 1304 << "\n"; | 1304 << "\n"; |
| 1305 ErrorStatus = true; | 1305 ErrorStatus = true; |
| 1306 } | 1306 } |
| 1307 return; | 1307 return; |
| 1308 } | 1308 } |
| 1309 | 1309 |
| 1310 } // end of namespace Ice | 1310 } // end of namespace Ice |
| OLD | NEW |