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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 // created. Also generates a warning if created names may conflict with named | 470 // created. Also generates a warning if created names may conflict with named |
471 // declarations. | 471 // declarations. |
472 void installDeclarationName(Ice::GlobalDeclaration *Decl, | 472 void installDeclarationName(Ice::GlobalDeclaration *Decl, |
473 const std::string &Prefix, const char *DeclType, | 473 const std::string &Prefix, const char *DeclType, |
474 NaClBcIndexSize_t &NameIndex) { | 474 NaClBcIndexSize_t &NameIndex) { |
475 if (Decl->hasName()) { | 475 if (Decl->hasName()) { |
476 Translator.checkIfUnnamedNameSafe(Decl->getName().toString(), DeclType, | 476 Translator.checkIfUnnamedNameSafe(Decl->getName().toString(), DeclType, |
477 Prefix); | 477 Prefix); |
478 } else { | 478 } else { |
479 Ice::GlobalContext *Ctx = Translator.getContext(); | 479 Ice::GlobalContext *Ctx = Translator.getContext(); |
480 if (Ice::BuildDefs::dump() || !Decl->isInternal()) { | 480 // Synthesize a dummy name if any of the following is true: |
| 481 // - DUMP is enabled |
| 482 // - The symbol is external |
| 483 // - The -timing-funcs flag is enabled |
| 484 // - The -timing-focus flag is enabled |
| 485 if (Ice::BuildDefs::dump() || !Decl->isInternal() || |
| 486 Ice::getFlags().getTimeEachFunction() || |
| 487 !Ice::getFlags().getTimingFocusOn().empty()) { |
481 Decl->setName(Ctx, Translator.createUnnamedName(Prefix, NameIndex)); | 488 Decl->setName(Ctx, Translator.createUnnamedName(Prefix, NameIndex)); |
482 } else { | 489 } else { |
483 Decl->setName(Ctx); | 490 Decl->setName(Ctx); |
484 } | 491 } |
485 ++NameIndex; | 492 ++NameIndex; |
486 } | 493 } |
487 } | 494 } |
488 | 495 |
489 // Installs names for global variables without names. | 496 // Installs names for global variables without names. |
490 void installGlobalVarNames() { | 497 void installGlobalVarNames() { |
(...skipping 2804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3295 raw_string_ostream StrBuf(Buffer); | 3302 raw_string_ostream StrBuf(Buffer); |
3296 StrBuf << IRFilename << ": Does not contain a module!"; | 3303 StrBuf << IRFilename << ": Does not contain a module!"; |
3297 llvm::report_fatal_error(StrBuf.str()); | 3304 llvm::report_fatal_error(StrBuf.str()); |
3298 } | 3305 } |
3299 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { | 3306 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { |
3300 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes"); | 3307 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes"); |
3301 } | 3308 } |
3302 } | 3309 } |
3303 | 3310 |
3304 } // end of namespace Ice | 3311 } // end of namespace Ice |
OLD | NEW |