Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: src/IceELFObjectWriter.cpp

Issue 1803403002: Subzero. Flags refactoring. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceCompiler.cpp ('k') | src/IceGlobalContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceELFObjectWriter.cpp - ELF object file writer --------===// 1 //===- subzero/src/IceELFObjectWriter.cpp - ELF object file writer --------===//
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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 SecStrBuf.str(), SHT_PROGBITS, ShFlags, Align, WriteAmt); 525 SecStrBuf.str(), SHT_PROGBITS, ShFlags, Align, WriteAmt);
526 RODataSections.push_back(Section); 526 RODataSections.push_back(Section);
527 SizeT OffsetInSection = 0; 527 SizeT OffsetInSection = 0;
528 // The symbol table entry doesn't need to know the defined symbol's size 528 // The symbol table entry doesn't need to know the defined symbol's size
529 // since this is in a section with a fixed Entry Size. 529 // since this is in a section with a fixed Entry Size.
530 constexpr SizeT SymbolSize = 0; 530 constexpr SizeT SymbolSize = 0;
531 Section->setFileOffset(alignFileOffset(Align)); 531 Section->setFileOffset(alignFileOffset(Align));
532 532
533 // If the -reorder-pooled-constant option is set to true, we should shuffle 533 // If the -reorder-pooled-constant option is set to true, we should shuffle
534 // the constants before we emit them. 534 // the constants before we emit them.
535 if (Ctx.getFlags().shouldReorderPooledConstants() && !Pool.empty()) { 535 if (Ctx.getFlags().getReorderPooledConstants() && !Pool.empty()) {
536 // Use the constant's kind value as the salt for creating random number 536 // Use the constant's kind value as the salt for creating random number
537 // generator. 537 // generator.
538 Operand::OperandKind K = (*Pool.begin())->getKind(); 538 Operand::OperandKind K = (*Pool.begin())->getKind();
539 RandomNumberGenerator RNG(Ctx.getFlags().getRandomSeed(), 539 RandomNumberGenerator RNG(Ctx.getFlags().getRandomSeed(),
540 RPE_PooledConstantReordering, K); 540 RPE_PooledConstantReordering, K);
541 RandomShuffle(Pool.begin(), Pool.end(), 541 RandomShuffle(Pool.begin(), Pool.end(),
542 [&RNG](uint64_t N) { return (uint32_t)RNG.next(N); }); 542 [&RNG](uint64_t N) { return (uint32_t)RNG.next(N); });
543 } 543 }
544 // Write the data. 544 // Write the data.
545 for (Constant *C : Pool) { 545 for (Constant *C : Pool) {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 if (ELF64) { 692 if (ELF64) {
693 writeELFHeaderInternal<true>(ShOffset, ShStrTab->getNumber(), 693 writeELFHeaderInternal<true>(ShOffset, ShStrTab->getNumber(),
694 AllSections.size()); 694 AllSections.size());
695 } else { 695 } else {
696 writeELFHeaderInternal<false>(ShOffset, ShStrTab->getNumber(), 696 writeELFHeaderInternal<false>(ShOffset, ShStrTab->getNumber(),
697 AllSections.size()); 697 AllSections.size());
698 } 698 }
699 } 699 }
700 700
701 } // end of namespace Ice 701 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceCompiler.cpp ('k') | src/IceGlobalContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698