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

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 | tests_lit/reader_tests/Inputs/binop-newform.tbc » ('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 /// \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 // Note: Old bitcode files may have an additional 'flags' operand, which is
2202 if (!isValidRecordSize(3, "binop")) 2202 // ignored.
2203
2204 // BINOP: [opval, opval, opcode, [flags]]
2205
2206 if (!isValidRecordSizeInRange(3, 4, "binop"))
2203 return; 2207 return;
2204 Ice::Operand *Op1 = getRelativeOperand(Values[0], BaseIndex); 2208 Ice::Operand *Op1 = getRelativeOperand(Values[0], BaseIndex);
2205 Ice::Operand *Op2 = getRelativeOperand(Values[1], BaseIndex); 2209 Ice::Operand *Op2 = getRelativeOperand(Values[1], BaseIndex);
2206 Ice::Type Type1 = Op1->getType(); 2210 Ice::Type Type1 = Op1->getType();
2207 Ice::Type Type2 = Op2->getType(); 2211 Ice::Type Type2 = Op2->getType();
2208 if (Type1 != Type2) { 2212 if (Type1 != Type2) {
2209 std::string Buffer; 2213 std::string Buffer;
2210 raw_string_ostream StrBuf(Buffer); 2214 raw_string_ostream StrBuf(Buffer);
2211 StrBuf << "Binop argument types differ: " << Type1 << " and " << Type2; 2215 StrBuf << "Binop argument types differ: " << Type1 << " and " << Type2;
2212 Error(StrBuf.str()); 2216 Error(StrBuf.str());
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
3210 raw_string_ostream StrBuf(Buffer); 3214 raw_string_ostream StrBuf(Buffer);
3211 StrBuf << IRFilename << ": Does not contain a module!"; 3215 StrBuf << IRFilename << ": Does not contain a module!";
3212 llvm::report_fatal_error(StrBuf.str()); 3216 llvm::report_fatal_error(StrBuf.str());
3213 } 3217 }
3214 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { 3218 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) {
3215 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes"); 3219 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes");
3216 } 3220 }
3217 } 3221 }
3218 3222
3219 } // end of namespace Ice 3223 } // end of namespace Ice
OLDNEW
« no previous file with comments | « no previous file | tests_lit/reader_tests/Inputs/binop-newform.tbc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698