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

Side by Side Diff: src/IceELFObjectWriter.cpp

Issue 1147023007: Subzero: Basic Block Profiler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Named constants; fflush; clang-format. Created 5 years, 6 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/IceClFlags.cpp ('k') | src/IceGlobalContext.cpp » ('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 // This file defines the writer for ELF relocatable object files. 10 // This file defines the writer for ELF relocatable object files.
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 assert(ST == BSS || ST == ROData); 376 assert(ST == BSS || ST == ROData);
377 if (ST == ROData) 377 if (ST == ROData)
378 Section->appendZeros(Str, SymbolSize); 378 Section->appendZeros(Str, SymbolSize);
379 else 379 else
380 Section->setSize(Section->getCurrentSize() + SymbolSize); 380 Section->setSize(Section->getCurrentSize() + SymbolSize);
381 } else { 381 } else {
382 assert(ST != BSS); 382 assert(ST != BSS);
383 for (VariableDeclaration::Initializer *Init : Var->getInitializers()) { 383 for (VariableDeclaration::Initializer *Init : Var->getInitializers()) {
384 switch (Init->getKind()) { 384 switch (Init->getKind()) {
385 case VariableDeclaration::Initializer::DataInitializerKind: { 385 case VariableDeclaration::Initializer::DataInitializerKind: {
386 const auto Data = 386 const auto Data = llvm::cast<VariableDeclaration::DataInitializer>(
387 llvm::cast<VariableDeclaration::DataInitializer>(Init) 387 Init)->getContents();
388 ->getContents();
389 Section->appendData(Str, llvm::StringRef(Data.data(), Data.size())); 388 Section->appendData(Str, llvm::StringRef(Data.data(), Data.size()));
390 break; 389 break;
391 } 390 }
392 case VariableDeclaration::Initializer::ZeroInitializerKind: 391 case VariableDeclaration::Initializer::ZeroInitializerKind:
393 Section->appendZeros(Str, Init->getNumBytes()); 392 Section->appendZeros(Str, Init->getNumBytes());
394 break; 393 break;
395 case VariableDeclaration::Initializer::RelocInitializerKind: { 394 case VariableDeclaration::Initializer::RelocInitializerKind: {
396 const auto Reloc = 395 const auto Reloc =
397 llvm::cast<VariableDeclaration::RelocInitializer>(Init); 396 llvm::cast<VariableDeclaration::RelocInitializer>(Init);
398 AssemblerFixup NewFixup; 397 AssemblerFixup NewFixup;
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 if (ELF64) { 607 if (ELF64) {
609 writeELFHeaderInternal<true>(ShOffset, ShStrTab->getNumber(), 608 writeELFHeaderInternal<true>(ShOffset, ShStrTab->getNumber(),
610 AllSections.size()); 609 AllSections.size());
611 } else { 610 } else {
612 writeELFHeaderInternal<false>(ShOffset, ShStrTab->getNumber(), 611 writeELFHeaderInternal<false>(ShOffset, ShStrTab->getNumber(),
613 AllSections.size()); 612 AllSections.size());
614 } 613 }
615 } 614 }
616 615
617 } // end of namespace Ice 616 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceClFlags.cpp ('k') | src/IceGlobalContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698