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); | |
Mark Seaborn
2016/02/26 23:18:58
It looks like you're doing this for functions, but
| |
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 2716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3205 raw_string_ostream StrBuf(Buffer); | 3211 raw_string_ostream StrBuf(Buffer); |
3206 StrBuf << IRFilename << ": Does not contain a module!"; | 3212 StrBuf << IRFilename << ": Does not contain a module!"; |
3207 llvm::report_fatal_error(StrBuf.str()); | 3213 llvm::report_fatal_error(StrBuf.str()); |
3208 } | 3214 } |
3209 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { | 3215 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { |
3210 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes"); | 3216 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes"); |
3211 } | 3217 } |
3212 } | 3218 } |
3213 | 3219 |
3214 } // end of namespace Ice | 3220 } // end of namespace Ice |
OLD | NEW |