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 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1751 } | 1751 } |
1752 case naclbitc::CST_CODE_INTEGER: { | 1752 case naclbitc::CST_CODE_INTEGER: { |
1753 // INTEGER: [intval] | 1753 // INTEGER: [intval] |
1754 if (!isValidRecordSize(1, "constants block integer")) | 1754 if (!isValidRecordSize(1, "constants block integer")) |
1755 return; | 1755 return; |
1756 if (!isValidNextConstantType()) | 1756 if (!isValidNextConstantType()) |
1757 return; | 1757 return; |
1758 if (IntegerType *IType = dyn_cast<IntegerType>( | 1758 if (IntegerType *IType = dyn_cast<IntegerType>( |
1759 Context->convertToLLVMType(NextConstantType))) { | 1759 Context->convertToLLVMType(NextConstantType))) { |
1760 APInt Value(IType->getBitWidth(), NaClDecodeSignRotatedValue(Values[0])); | 1760 APInt Value(IType->getBitWidth(), NaClDecodeSignRotatedValue(Values[0])); |
1761 Ice::Constant *C = | 1761 Ice::Constant *C = (NextConstantType == Ice::IceType_i64) |
1762 getContext()->getConstantInt(NextConstantType, Value.getSExtValue()); | 1762 ? getContext()->getConstantInt64( |
| 1763 NextConstantType, Value.getSExtValue()) |
| 1764 : getContext()->getConstantInt32( |
| 1765 NextConstantType, Value.getSExtValue()); |
1763 FuncParser->setNextConstantID(C); | 1766 FuncParser->setNextConstantID(C); |
1764 return; | 1767 return; |
1765 } | 1768 } |
1766 std::string Buffer; | 1769 std::string Buffer; |
1767 raw_string_ostream StrBuf(Buffer); | 1770 raw_string_ostream StrBuf(Buffer); |
1768 StrBuf << "constant block integer record for non-integer type " | 1771 StrBuf << "constant block integer record for non-integer type " |
1769 << NextConstantType; | 1772 << NextConstantType; |
1770 Error(StrBuf.str()); | 1773 Error(StrBuf.str()); |
1771 return; | 1774 return; |
1772 } | 1775 } |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2084 if (TopLevelBlocks != 1) { | 2087 if (TopLevelBlocks != 1) { |
2085 errs() << IRFilename | 2088 errs() << IRFilename |
2086 << ": Contains more than one module. Found: " << TopLevelBlocks | 2089 << ": Contains more than one module. Found: " << TopLevelBlocks |
2087 << "\n"; | 2090 << "\n"; |
2088 ErrorStatus = true; | 2091 ErrorStatus = true; |
2089 } | 2092 } |
2090 return; | 2093 return; |
2091 } | 2094 } |
2092 | 2095 |
2093 } // end of namespace Ice | 2096 } // end of namespace Ice |
OLD | NEW |