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 /// \file | 10 /// \file |
(...skipping 2608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2619 Ice::Type PtrTy = Ice::getPointerType(); | 2619 Ice::Type PtrTy = Ice::getPointerType(); |
2620 if (ByteCount->getType() != Ice::IceType_i32) { | 2620 if (ByteCount->getType() != Ice::IceType_i32) { |
2621 std::string Buffer; | 2621 std::string Buffer; |
2622 raw_string_ostream StrBuf(Buffer); | 2622 raw_string_ostream StrBuf(Buffer); |
2623 StrBuf << "Alloca on non-i32 value. Found: " << *ByteCount; | 2623 StrBuf << "Alloca on non-i32 value. Found: " << *ByteCount; |
2624 Error(StrBuf.str()); | 2624 Error(StrBuf.str()); |
2625 appendErrorInstruction(PtrTy); | 2625 appendErrorInstruction(PtrTy); |
2626 return; | 2626 return; |
2627 } | 2627 } |
2628 CurrentNode->appendInst(Ice::InstAlloca::create( | 2628 CurrentNode->appendInst(Ice::InstAlloca::create( |
2629 Func.get(), ByteCount, Alignment, getNextInstVar(PtrTy))); | 2629 Func.get(), getNextInstVar(PtrTy), ByteCount, Alignment)); |
2630 return; | 2630 return; |
2631 } | 2631 } |
2632 case naclbitc::FUNC_CODE_INST_LOAD: { | 2632 case naclbitc::FUNC_CODE_INST_LOAD: { |
2633 // LOAD: [address, align, ty] | 2633 // LOAD: [address, align, ty] |
2634 if (!isValidRecordSize(3, "load")) | 2634 if (!isValidRecordSize(3, "load")) |
2635 return; | 2635 return; |
2636 Ice::Operand *Address = getRelativeOperand(Values[0], BaseIndex); | 2636 Ice::Operand *Address = getRelativeOperand(Values[0], BaseIndex); |
2637 Ice::Type Ty = Context->getSimpleTypeByID(Values[2]); | 2637 Ice::Type Ty = Context->getSimpleTypeByID(Values[2]); |
2638 uint32_t Alignment = Context->extractAlignment(this, "Load", Values[1]); | 2638 uint32_t Alignment = Context->extractAlignment(this, "Load", Values[1]); |
2639 if (isIRGenerationDisabled()) { | 2639 if (isIRGenerationDisabled()) { |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3297 raw_string_ostream StrBuf(Buffer); | 3297 raw_string_ostream StrBuf(Buffer); |
3298 StrBuf << IRFilename << ": Does not contain a module!"; | 3298 StrBuf << IRFilename << ": Does not contain a module!"; |
3299 llvm::report_fatal_error(StrBuf.str()); | 3299 llvm::report_fatal_error(StrBuf.str()); |
3300 } | 3300 } |
3301 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { | 3301 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { |
3302 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes"); | 3302 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes"); |
3303 } | 3303 } |
3304 } | 3304 } |
3305 | 3305 |
3306 } // end of namespace Ice | 3306 } // end of namespace Ice |
OLD | NEW |