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

Side by Side Diff: src/IceGlobalContext.cpp

Issue 678533005: Subzero: Add basic ELFObjectWriter (text section, symtab, strtab, headers) (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: minor cleanup Created 6 years 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/IceGlobalContext.h ('k') | src/IceMemoryRegion.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/IceGlobalContext.cpp - Global context defs -------------===// 1 //===- subzero/src/IceGlobalContext.cpp - Global context defs -------------===//
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 aspects of the compilation that persist across 10 // This file defines aspects of the compilation that persist across
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 TypePool<IceType_f64, double, ConstantDouble> Doubles; 96 TypePool<IceType_f64, double, ConstantDouble> Doubles;
97 TypePool<IceType_i1, int8_t, ConstantInteger32> Integers1; 97 TypePool<IceType_i1, int8_t, ConstantInteger32> Integers1;
98 TypePool<IceType_i8, int8_t, ConstantInteger32> Integers8; 98 TypePool<IceType_i8, int8_t, ConstantInteger32> Integers8;
99 TypePool<IceType_i16, int16_t, ConstantInteger32> Integers16; 99 TypePool<IceType_i16, int16_t, ConstantInteger32> Integers16;
100 TypePool<IceType_i32, int32_t, ConstantInteger32> Integers32; 100 TypePool<IceType_i32, int32_t, ConstantInteger32> Integers32;
101 TypePool<IceType_i64, int64_t, ConstantInteger64> Integers64; 101 TypePool<IceType_i64, int64_t, ConstantInteger64> Integers64;
102 TypePool<IceType_i32, RelocatableTuple, ConstantRelocatable> Relocatables; 102 TypePool<IceType_i32, RelocatableTuple, ConstantRelocatable> Relocatables;
103 UndefPool Undefs; 103 UndefPool Undefs;
104 }; 104 };
105 105
106 GlobalContext::GlobalContext(llvm::raw_ostream *OsDump, 106 GlobalContext::GlobalContext(Ostream *OsDump, Ostream *OsEmit,
107 llvm::raw_ostream *OsEmit, VerboseMask Mask, 107 ELFStreamer *ELFStr, VerboseMask Mask,
108 TargetArch Arch, OptLevel Opt, 108 TargetArch Arch, OptLevel Opt,
109 IceString TestPrefix, const ClFlags &Flags) 109 IceString TestPrefix, const ClFlags &Flags)
110 : StrDump(OsDump), StrEmit(OsEmit), VMask(Mask), 110 : StrDump(OsDump), StrEmit(OsEmit), VMask(Mask),
111 ConstPool(new ConstantPool()), Arch(Arch), Opt(Opt), 111 ConstPool(new ConstantPool()), Arch(Arch), Opt(Opt),
112 TestPrefix(TestPrefix), Flags(Flags), HasEmittedFirstMethod(false), 112 TestPrefix(TestPrefix), Flags(Flags), HasEmittedFirstMethod(false),
113 RNG("") { 113 RNG(""), ObjectWriter() {
114 // Pre-register built-in stack names. 114 // Pre-register built-in stack names.
115 newTimerStackID("Total across all functions"); 115 newTimerStackID("Total across all functions");
116 newTimerStackID("Per-function summary"); 116 newTimerStackID("Per-function summary");
117 if (Flags.UseELFWriter) {
118 ObjectWriter.reset(new ELFObjectWriter(*this, *ELFStr));
119 }
117 } 120 }
118 121
119 // Scan a string for S[0-9A-Z]*_ patterns and replace them with 122 // Scan a string for S[0-9A-Z]*_ patterns and replace them with
120 // S<num>_ where <num> is the next base-36 value. If a type name 123 // S<num>_ where <num> is the next base-36 value. If a type name
121 // legitimately contains that pattern, then the substitution will be 124 // legitimately contains that pattern, then the substitution will be
122 // made in error and most likely the link will fail. In this case, 125 // made in error and most likely the link will fail. In this case,
123 // the test classes can be rewritten not to use that pattern, which is 126 // the test classes can be rewritten not to use that pattern, which is
124 // much simpler and more reliable than implementing a full demangling 127 // much simpler and more reliable than implementing a full demangling
125 // parser. Another substitution-in-error may occur if a type 128 // parser. Another substitution-in-error may occur if a type
126 // identifier ends with the pattern S[0-9A-Z]*, because an immediately 129 // identifier ends with the pattern S[0-9A-Z]*, because an immediately
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 } 483 }
481 484
482 TimerMarker::TimerMarker(TimerIdT ID, const Cfg *Func) 485 TimerMarker::TimerMarker(TimerIdT ID, const Cfg *Func)
483 : ID(ID), Ctx(Func->getContext()), 486 : ID(ID), Ctx(Func->getContext()),
484 Active(Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled) { 487 Active(Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled) {
485 if (Active) 488 if (Active)
486 Ctx->pushTimer(ID); 489 Ctx->pushTimer(ID);
487 } 490 }
488 491
489 } // end of namespace Ice 492 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceGlobalContext.h ('k') | src/IceMemoryRegion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698