Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: src/PNaClTranslator.cpp

Issue 476323004: Start adding an integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: make fixups part of address Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceUtils.h ('k') | src/assembler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/IceUtils.h ('k') | src/assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698