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

Side by Side Diff: src/IceGlobalContext.cpp

Issue 889613004: Track undefined sym in the symtab. Remove hack for missing relocs against undef. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: separate asserts Created 5 years, 10 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/IceGlobalContext.h ('k') | src/IceTargetLoweringX8632.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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 public: 98 public:
99 ConstantPool() {} 99 ConstantPool() {}
100 TypePool<IceType_f32, float, ConstantFloat> Floats; 100 TypePool<IceType_f32, float, ConstantFloat> Floats;
101 TypePool<IceType_f64, double, ConstantDouble> Doubles; 101 TypePool<IceType_f64, double, ConstantDouble> Doubles;
102 TypePool<IceType_i1, int8_t, ConstantInteger32> Integers1; 102 TypePool<IceType_i1, int8_t, ConstantInteger32> Integers1;
103 TypePool<IceType_i8, int8_t, ConstantInteger32> Integers8; 103 TypePool<IceType_i8, int8_t, ConstantInteger32> Integers8;
104 TypePool<IceType_i16, int16_t, ConstantInteger32> Integers16; 104 TypePool<IceType_i16, int16_t, ConstantInteger32> Integers16;
105 TypePool<IceType_i32, int32_t, ConstantInteger32> Integers32; 105 TypePool<IceType_i32, int32_t, ConstantInteger32> Integers32;
106 TypePool<IceType_i64, int64_t, ConstantInteger64> Integers64; 106 TypePool<IceType_i64, int64_t, ConstantInteger64> Integers64;
107 TypePool<IceType_i32, RelocatableTuple, ConstantRelocatable> Relocatables; 107 TypePool<IceType_i32, RelocatableTuple, ConstantRelocatable> Relocatables;
108 TypePool<IceType_i32, RelocatableTuple, ConstantRelocatable>
109 ExternRelocatables;
108 UndefPool Undefs; 110 UndefPool Undefs;
109 }; 111 };
110 112
111 void GlobalContext::CodeStats::dump(const IceString &Name, Ostream &Str) { 113 void GlobalContext::CodeStats::dump(const IceString &Name, Ostream &Str) {
112 if (!ALLOW_DUMP) 114 if (!ALLOW_DUMP)
113 return; 115 return;
114 #define X(str, tag) \ 116 #define X(str, tag) \
115 Str << "|" << Name << "|" str "|" << Stats[CS_##tag] << "\n"; 117 Str << "|" << Name << "|" str "|" << Stats[CS_##tag] << "\n";
116 CODESTATS_TABLE 118 CODESTATS_TABLE
117 #undef X 119 #undef X
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 return getConstPool()->Doubles.getOrAdd(this, ConstantDouble); 417 return getConstPool()->Doubles.getOrAdd(this, ConstantDouble);
416 } 418 }
417 419
418 Constant *GlobalContext::getConstantSym(RelocOffsetT Offset, 420 Constant *GlobalContext::getConstantSym(RelocOffsetT Offset,
419 const IceString &Name, 421 const IceString &Name,
420 bool SuppressMangling) { 422 bool SuppressMangling) {
421 return getConstPool()->Relocatables.getOrAdd( 423 return getConstPool()->Relocatables.getOrAdd(
422 this, RelocatableTuple(Offset, Name, SuppressMangling)); 424 this, RelocatableTuple(Offset, Name, SuppressMangling));
423 } 425 }
424 426
427 Constant *GlobalContext::getConstantExternSym(const IceString &Name) {
428 const RelocOffsetT Offset = 0;
429 const bool SuppressMangling = true;
430 return getConstPool()->ExternRelocatables.getOrAdd(
431 this, RelocatableTuple(Offset, Name, SuppressMangling));
432 }
433
425 Constant *GlobalContext::getConstantUndef(Type Ty) { 434 Constant *GlobalContext::getConstantUndef(Type Ty) {
426 return getConstPool()->Undefs.getOrAdd(this, Ty); 435 return getConstPool()->Undefs.getOrAdd(this, Ty);
427 } 436 }
428 437
429 // All locking is done by the getConstant*() target function. 438 // All locking is done by the getConstant*() target function.
430 Constant *GlobalContext::getConstantZero(Type Ty) { 439 Constant *GlobalContext::getConstantZero(Type Ty) {
431 switch (Ty) { 440 switch (Ty) {
432 case IceType_i1: 441 case IceType_i1:
433 return getConstantInt1(0); 442 return getConstantInt1(0);
434 case IceType_i8: 443 case IceType_i8:
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 BaseOS << "Unsupported constant type: " << Ty; 496 BaseOS << "Unsupported constant type: " << Ty;
488 llvm_unreachable(BaseOS.str().c_str()); 497 llvm_unreachable(BaseOS.str().c_str());
489 } break; 498 } break;
490 case IceType_void: 499 case IceType_void:
491 case IceType_NUM: 500 case IceType_NUM:
492 break; 501 break;
493 } 502 }
494 llvm_unreachable("Unknown type"); 503 llvm_unreachable("Unknown type");
495 } 504 }
496 505
506 ConstantList GlobalContext::getConstantExternSyms() {
507 return getConstPool()->ExternRelocatables.getConstantPool();
508 }
509
497 TimerStackIdT GlobalContext::newTimerStackID(const IceString &Name) { 510 TimerStackIdT GlobalContext::newTimerStackID(const IceString &Name) {
498 if (!ALLOW_DUMP) 511 if (!ALLOW_DUMP)
499 return 0; 512 return 0;
500 auto Timers = getTimers(); 513 auto Timers = getTimers();
501 TimerStackIdT NewID = Timers->size(); 514 TimerStackIdT NewID = Timers->size();
502 Timers->push_back(TimerStack(Name)); 515 Timers->push_back(TimerStack(Name));
503 return NewID; 516 return NewID;
504 } 517 }
505 518
506 TimerIdT GlobalContext::getTimerID(TimerStackIdT StackID, 519 TimerIdT GlobalContext::getTimerID(TimerStackIdT StackID,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 void TimerMarker::pushCfg(const Cfg *Func) { 586 void TimerMarker::pushCfg(const Cfg *Func) {
574 Ctx = Func->getContext(); 587 Ctx = Func->getContext();
575 Active = Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled; 588 Active = Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled;
576 if (Active) 589 if (Active)
577 Ctx->pushTimer(ID, StackID); 590 Ctx->pushTimer(ID, StackID);
578 } 591 }
579 592
580 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); 593 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS);
581 594
582 } // end of namespace Ice 595 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceGlobalContext.h ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698