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 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
540 reportLinkageError("Function", *Func); | 540 reportLinkageError("Function", *Func); |
541 Ice::Constant *C = getConstantSym( | 541 Ice::Constant *C = getConstantSym( |
542 Func->getName(), Func->getSuppressMangling(), Func->isProto()); | 542 Func->getName(), Func->getSuppressMangling(), Func->isProto()); |
543 ValueIDConstants.push_back(C); | 543 ValueIDConstants.push_back(C); |
544 } | 544 } |
545 } | 545 } |
546 | 546 |
547 // Converts global variable declarations into constant value IDs. | 547 // Converts global variable declarations into constant value IDs. |
548 void createValueIDsForGlobalVars() { | 548 void createValueIDsForGlobalVars() { |
549 Ice::GlobalContext *Ctx = getTranslator().getContext(); | 549 Ice::GlobalContext *Ctx = getTranslator().getContext(); |
550 for (const Ice::VariableDeclaration *Decl : *VariableDeclarations) { | 550 for (Ice::VariableDeclaration *Decl : *VariableDeclarations) { |
John
2016/02/26 18:40:53
I would much rather you forcePNaClABILinkage() whe
Sean Klein
2016/02/26 19:45:04
Done.
| |
551 if (!Decl->verifyLinkageCorrect(Ctx)) | 551 if (!Decl->verifyLinkageCorrect(Ctx) && !Decl->forcePNaClABILinkage()) |
552 reportLinkageError("Global", *Decl); | 552 reportLinkageError("Global", *Decl); |
553 Ice::Constant *C = | 553 Ice::Constant *C = |
554 getConstantSym(Decl->getName(), Decl->getSuppressMangling(), | 554 getConstantSym(Decl->getName(), Decl->getSuppressMangling(), |
555 !Decl->hasInitializer()); | 555 !Decl->hasInitializer()); |
556 ValueIDConstants.push_back(C); | 556 ValueIDConstants.push_back(C); |
557 } | 557 } |
558 } | 558 } |
559 | 559 |
560 // Reports that type ID is undefined, or not of the WantedType. | 560 // Reports that type ID is undefined, or not of the WantedType. |
561 void reportBadTypeIDAs(NaClBcIndexSize_t ID, const ExtendedType *Ty, | 561 void reportBadTypeIDAs(NaClBcIndexSize_t ID, const ExtendedType *Ty, |
(...skipping 2643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3205 raw_string_ostream StrBuf(Buffer); | 3205 raw_string_ostream StrBuf(Buffer); |
3206 StrBuf << IRFilename << ": Does not contain a module!"; | 3206 StrBuf << IRFilename << ": Does not contain a module!"; |
3207 llvm::report_fatal_error(StrBuf.str()); | 3207 llvm::report_fatal_error(StrBuf.str()); |
3208 } | 3208 } |
3209 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { | 3209 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { |
3210 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes"); | 3210 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes"); |
3211 } | 3211 } |
3212 } | 3212 } |
3213 | 3213 |
3214 } // end of namespace Ice | 3214 } // end of namespace Ice |
OLD | NEW |