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

Side by Side Diff: src/PNaClTranslator.cpp

Issue 1831043002: Fix Subzero binary instruction to allow optional flags argument. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 4 years, 9 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 | « no previous file | unittest/IceParseInstsTest.cpp » ('j') | unittest/IceParseInstsTest.cpp » ('J')
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 /// \file 10 /// \file
(...skipping 2180 matching lines...) Expand 10 before | Expand all | Expand 10 after
2191 } 2191 }
2192 2192
2193 DeclaredNumberBbs = NumBbs; 2193 DeclaredNumberBbs = NumBbs;
2194 // Install the basic blocks, skipping bb0 which was created in the 2194 // Install the basic blocks, skipping bb0 which was created in the
2195 // constructor. 2195 // constructor.
2196 for (size_t i = 1; i < NumBbs; ++i) 2196 for (size_t i = 1; i < NumBbs; ++i)
2197 installNextBasicBlock(); 2197 installNextBasicBlock();
2198 return; 2198 return;
2199 } 2199 }
2200 case naclbitc::FUNC_CODE_INST_BINOP: { 2200 case naclbitc::FUNC_CODE_INST_BINOP: {
2201 // BINOP: [opval, opval, opcode] 2201 // BINOP: [opval, opval, opcode, [flags]]
2202 if (!isValidRecordSize(3, "binop")) 2202 // Note: Old bitcode files may have an additional 'flags" operand, and
Jim Stichnoth 2016/03/24 17:46:32 s/and/which/ and maybe reflow the comment
Karl 2016/03/24 19:28:36 Done.
2203 // is ignored.
2204 if (!isValidRecordSizeInRange(3, 4, "binop"))
2203 return; 2205 return;
2204 Ice::Operand *Op1 = getRelativeOperand(Values[0], BaseIndex); 2206 Ice::Operand *Op1 = getRelativeOperand(Values[0], BaseIndex);
2205 Ice::Operand *Op2 = getRelativeOperand(Values[1], BaseIndex); 2207 Ice::Operand *Op2 = getRelativeOperand(Values[1], BaseIndex);
2206 Ice::Type Type1 = Op1->getType(); 2208 Ice::Type Type1 = Op1->getType();
2207 Ice::Type Type2 = Op2->getType(); 2209 Ice::Type Type2 = Op2->getType();
2208 if (Type1 != Type2) { 2210 if (Type1 != Type2) {
2209 std::string Buffer; 2211 std::string Buffer;
2210 raw_string_ostream StrBuf(Buffer); 2212 raw_string_ostream StrBuf(Buffer);
2211 StrBuf << "Binop argument types differ: " << Type1 << " and " << Type2; 2213 StrBuf << "Binop argument types differ: " << Type1 << " and " << Type2;
2212 Error(StrBuf.str()); 2214 Error(StrBuf.str());
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
3210 raw_string_ostream StrBuf(Buffer); 3212 raw_string_ostream StrBuf(Buffer);
3211 StrBuf << IRFilename << ": Does not contain a module!"; 3213 StrBuf << IRFilename << ": Does not contain a module!";
3212 llvm::report_fatal_error(StrBuf.str()); 3214 llvm::report_fatal_error(StrBuf.str());
3213 } 3215 }
3214 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { 3216 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) {
3215 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes"); 3217 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes");
3216 } 3218 }
3217 } 3219 }
3218 3220
3219 } // end of namespace Ice 3221 } // end of namespace Ice
OLDNEW
« no previous file with comments | « no previous file | unittest/IceParseInstsTest.cpp » ('j') | unittest/IceParseInstsTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698