| 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()) { | |
| 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); | |
| 484 } | |
| 485 Translator.checkIfUnnamedNameSafe(Decl->getName(), DeclType, Prefix); | 479 Translator.checkIfUnnamedNameSafe(Decl->getName(), DeclType, Prefix); |
| 486 } else { | 480 } else { |
| 487 Decl->setName(Translator.createUnnamedName(Prefix, NameIndex)); | 481 Decl->setName(Translator.createUnnamedName(Prefix, NameIndex)); |
| 488 ++NameIndex; | 482 ++NameIndex; |
| 489 } | 483 } |
| 490 } | 484 } |
| 491 | 485 |
| 492 // Installs names for global variables without names. | 486 // Installs names for global variables without names. |
| 493 void installGlobalVarNames() { | 487 void installGlobalVarNames() { |
| 494 assert(VariableDeclarations); | 488 assert(VariableDeclarations); |
| (...skipping 2716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3211 raw_string_ostream StrBuf(Buffer); | 3205 raw_string_ostream StrBuf(Buffer); |
| 3212 StrBuf << IRFilename << ": Does not contain a module!"; | 3206 StrBuf << IRFilename << ": Does not contain a module!"; |
| 3213 llvm::report_fatal_error(StrBuf.str()); | 3207 llvm::report_fatal_error(StrBuf.str()); |
| 3214 } | 3208 } |
| 3215 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { | 3209 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { |
| 3216 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"); |
| 3217 } | 3211 } |
| 3218 } | 3212 } |
| 3219 | 3213 |
| 3220 } // end of namespace Ice | 3214 } // end of namespace Ice |
| OLD | NEW |