| 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 1759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1770 } | 1770 } |
| 1771 case naclbitc::CST_CODE_INTEGER: { | 1771 case naclbitc::CST_CODE_INTEGER: { |
| 1772 // INTEGER: [intval] | 1772 // INTEGER: [intval] |
| 1773 if (!isValidRecordSize(1, "constants block integer")) | 1773 if (!isValidRecordSize(1, "constants block integer")) |
| 1774 return; | 1774 return; |
| 1775 if (!isValidNextConstantType()) | 1775 if (!isValidNextConstantType()) |
| 1776 return; | 1776 return; |
| 1777 if (IntegerType *IType = dyn_cast<IntegerType>( | 1777 if (IntegerType *IType = dyn_cast<IntegerType>( |
| 1778 Context->convertToLLVMType(NextConstantType))) { | 1778 Context->convertToLLVMType(NextConstantType))) { |
| 1779 APInt Value(IType->getBitWidth(), NaClDecodeSignRotatedValue(Values[0])); | 1779 APInt Value(IType->getBitWidth(), NaClDecodeSignRotatedValue(Values[0])); |
| 1780 Ice::Constant *C = | 1780 Ice::Constant *C = (NextConstantType == Ice::IceType_i64) |
| 1781 getContext()->getConstantInt(NextConstantType, Value.getSExtValue()); | 1781 ? getContext()->getConstantInt64( |
| 1782 NextConstantType, Value.getSExtValue()) |
| 1783 : getContext()->getConstantInt32( |
| 1784 NextConstantType, Value.getSExtValue()); |
| 1782 FuncParser->setNextConstantID(C); | 1785 FuncParser->setNextConstantID(C); |
| 1783 return; | 1786 return; |
| 1784 } | 1787 } |
| 1785 std::string Buffer; | 1788 std::string Buffer; |
| 1786 raw_string_ostream StrBuf(Buffer); | 1789 raw_string_ostream StrBuf(Buffer); |
| 1787 StrBuf << "constant block integer record for non-integer type " | 1790 StrBuf << "constant block integer record for non-integer type " |
| 1788 << NextConstantType; | 1791 << NextConstantType; |
| 1789 Error(StrBuf.str()); | 1792 Error(StrBuf.str()); |
| 1790 return; | 1793 return; |
| 1791 } | 1794 } |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2103 if (TopLevelBlocks != 1) { | 2106 if (TopLevelBlocks != 1) { |
| 2104 errs() << IRFilename | 2107 errs() << IRFilename |
| 2105 << ": Contains more than one module. Found: " << TopLevelBlocks | 2108 << ": Contains more than one module. Found: " << TopLevelBlocks |
| 2106 << "\n"; | 2109 << "\n"; |
| 2107 ErrorStatus = true; | 2110 ErrorStatus = true; |
| 2108 } | 2111 } |
| 2109 return; | 2112 return; |
| 2110 } | 2113 } |
| 2111 | 2114 |
| 2112 } // end of namespace Ice | 2115 } // end of namespace Ice |
| OLD | NEW |