Chromium Code Reviews| 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 469 // Gives Decl a name if it doesn't already have one. Prefix and NameIndex are | 469 // Gives Decl a name if it doesn't already have one. Prefix and NameIndex are |
| 470 // used to generate the name. NameIndex is automatically incremented if a new | 470 // used to generate the name. NameIndex is automatically incremented if a new |
| 471 // name is created. DeclType is literal text describing the type of name | 471 // name is created. DeclType is literal text describing the type of name |
| 472 // being created. Also generates warning if created names may conflict with | 472 // being created. Also generates warning if created names may conflict with |
| 473 // named declarations. | 473 // named declarations. |
| 474 void installDeclarationName(Ice::GlobalDeclaration *Decl, | 474 void installDeclarationName(Ice::GlobalDeclaration *Decl, |
| 475 const Ice::IceString &Prefix, | 475 const Ice::IceString &Prefix, |
| 476 const char *DeclType, | 476 const char *DeclType, |
| 477 NaClBcIndexSize_t &NameIndex) { | 477 NaClBcIndexSize_t &NameIndex) { |
| 478 if (Decl->hasName()) { | 478 if (Decl->hasName()) { |
| 479 if (Decl->isPNaClABIExternalName()) { | |
|
Mark Seaborn
2016/03/09 03:37:15
As I commented on https://codereview.chromium.org/
Sean Klein
2016/03/10 23:45:23
Changed so that setLinkage is only considered for
| |
| 480 // Force linkage to be external for the PNaCl ABI. PNaCl bitcode has a | |
| 481 // linkage field for Functions, but not for GlobalVariables (because the | |
| 482 // latter is not needed for pexes, so it has been removed). | |
| 483 Decl->setLinkage(llvm::GlobalValue::ExternalLinkage); | |
|
Karl
2016/03/09 17:06:50
This code is somewhat fragile. The name was earli
Sean Klein
2016/03/10 23:45:23
Code moved to "ModuleValueSymtabParser::setValueNa
| |
| 484 } | |
| 479 Translator.checkIfUnnamedNameSafe(Decl->getName(), DeclType, Prefix); | 485 Translator.checkIfUnnamedNameSafe(Decl->getName(), DeclType, Prefix); |
| 480 } else { | 486 } else { |
| 481 Decl->setName(Translator.createUnnamedName(Prefix, NameIndex)); | 487 Decl->setName(Translator.createUnnamedName(Prefix, NameIndex)); |
| 482 ++NameIndex; | 488 ++NameIndex; |
| 483 } | 489 } |
| 484 } | 490 } |
| 485 | 491 |
| 486 // Installs names for global variables without names. | 492 // Installs names for global variables without names. |
| 487 void installGlobalVarNames() { | 493 void installGlobalVarNames() { |
| 488 assert(VariableDeclarations); | 494 assert(VariableDeclarations); |
| (...skipping 2713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3202 raw_string_ostream StrBuf(Buffer); | 3208 raw_string_ostream StrBuf(Buffer); |
| 3203 StrBuf << IRFilename << ": Does not contain a module!"; | 3209 StrBuf << IRFilename << ": Does not contain a module!"; |
| 3204 llvm::report_fatal_error(StrBuf.str()); | 3210 llvm::report_fatal_error(StrBuf.str()); |
| 3205 } | 3211 } |
| 3206 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { | 3212 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { |
| 3207 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes"); | 3213 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes"); |
| 3208 } | 3214 } |
| 3209 } | 3215 } |
| 3210 | 3216 |
| 3211 } // end of namespace Ice | 3217 } // end of namespace Ice |
| OLD | NEW |