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

Side by Side Diff: src/IceGlobalContext.cpp

Issue 1257283004: Iasm and obj lowering for advanced switch lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Rebase Created 5 years, 4 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/IceInst.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 /// \file 10 /// \file
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 if (!BuildDefs::dump()) { 378 if (!BuildDefs::dump()) {
379 getStrError() << "emitFileHeader for non-ELF"; 379 getStrError() << "emitFileHeader for non-ELF";
380 getErrorStatus()->assign(EC_Translation); 380 getErrorStatus()->assign(EC_Translation);
381 } 381 }
382 TargetHeaderLowering::createLowering(this)->lower(); 382 TargetHeaderLowering::createLowering(this)->lower();
383 } 383 }
384 } 384 }
385 385
386 void GlobalContext::lowerConstants() { DataLowering->lowerConstants(); } 386 void GlobalContext::lowerConstants() { DataLowering->lowerConstants(); }
387 387
388 void GlobalContext::lowerJumpTables() { DataLowering->lowerJumpTables(); }
389
388 void GlobalContext::lowerGlobals(const IceString &SectionSuffix) { 390 void GlobalContext::lowerGlobals(const IceString &SectionSuffix) {
389 TimerMarker T(TimerStack::TT_emitGlobalInitializers, this); 391 TimerMarker T(TimerStack::TT_emitGlobalInitializers, this);
390 const bool DumpGlobalVariables = BuildDefs::dump() && Flags.getVerbose() && 392 const bool DumpGlobalVariables = BuildDefs::dump() && Flags.getVerbose() &&
391 Flags.getVerboseFocusOn().empty(); 393 Flags.getVerboseFocusOn().empty();
392 if (DumpGlobalVariables) { 394 if (DumpGlobalVariables) {
393 OstreamLocker L(this); 395 OstreamLocker L(this);
394 Ostream &Stream = getStrDump(); 396 Ostream &Stream = getStrDump();
395 for (const Ice::VariableDeclaration *Global : Globals) { 397 for (const Ice::VariableDeclaration *Global : Globals) {
396 Global->dump(this, Stream); 398 Global->dump(this, Stream);
397 } 399 }
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 case IceType_NUM: 871 case IceType_NUM:
870 break; 872 break;
871 } 873 }
872 llvm_unreachable("Unknown type"); 874 llvm_unreachable("Unknown type");
873 } 875 }
874 876
875 ConstantList GlobalContext::getConstantExternSyms() { 877 ConstantList GlobalContext::getConstantExternSyms() {
876 return getConstPool()->ExternRelocatables.getConstantPool(); 878 return getConstPool()->ExternRelocatables.getConstantPool();
877 } 879 }
878 880
881 JumpTableData &GlobalContext::addJumpTable(IceString FuncName, SizeT Id,
882 SizeT NumTargets) {
883 auto JumpTables = getJumpTables();
884 JumpTables->emplace_back(FuncName, Id, NumTargets);
885 return JumpTables->back();
886 }
887
879 TimerStackIdT GlobalContext::newTimerStackID(const IceString &Name) { 888 TimerStackIdT GlobalContext::newTimerStackID(const IceString &Name) {
880 if (!BuildDefs::dump()) 889 if (!BuildDefs::dump())
881 return 0; 890 return 0;
882 auto Timers = getTimers(); 891 auto Timers = getTimers();
883 TimerStackIdT NewID = Timers->size(); 892 TimerStackIdT NewID = Timers->size();
884 Timers->push_back(TimerStack(Name)); 893 Timers->push_back(TimerStack(Name));
885 return NewID; 894 return NewID;
886 } 895 }
887 896
888 TimerIdT GlobalContext::getTimerID(TimerStackIdT StackID, 897 TimerIdT GlobalContext::getTimerID(TimerStackIdT StackID,
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 Ctx = Func->getContext(); 992 Ctx = Func->getContext();
984 Active = 993 Active =
985 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); 994 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled();
986 if (Active) 995 if (Active)
987 Ctx->pushTimer(ID, StackID); 996 Ctx->pushTimer(ID, StackID);
988 } 997 }
989 998
990 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); 999 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS);
991 1000
992 } // end of namespace Ice 1001 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceGlobalContext.h ('k') | src/IceInst.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698