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

Unified Diff: src/IceCfg.cpp

Issue 1860473002: Subzero. Refactors Switch Lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: git pull Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceCfg.h ('k') | src/IceELFObjectWriter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfg.cpp
diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp
index e2bee72da7c930e092c1fa5509c6e7abb1344a9d..4eb5d71daaea6e7c97f41b04f92c3955d4da39e9 100644
--- a/src/IceCfg.cpp
+++ b/src/IceCfg.cpp
@@ -1025,11 +1025,6 @@ void Cfg::emitTextHeader(GlobalString Name, GlobalContext *Ctx,
Str << Name << ":\n";
}
-void Cfg::deleteJumpTableInsts() {
- for (InstJumpTable *JumpTable : JumpTables)
- JumpTable->setDeleted();
-}
-
void Cfg::emitJumpTables() {
switch (getFlags().getOutFileType()) {
case FT_Elf:
@@ -1037,14 +1032,7 @@ void Cfg::emitJumpTables() {
// The emission needs to be delayed until the after the text section so
// save the offsets in the global context.
for (const InstJumpTable *JumpTable : JumpTables) {
- SizeT NumTargets = JumpTable->getNumTargets();
- JumpTableData::TargetList TargetList;
- for (SizeT I = 0; I < NumTargets; ++I) {
- SizeT Index = JumpTable->getTarget(I)->getIndex();
- TargetList.emplace_back(
- getAssembler()->getCfgNodeLabel(Index)->getPosition());
- }
- Ctx->addJumpTable(FunctionName, JumpTable->getId(), TargetList);
+ Ctx->addJumpTableData(JumpTable->toJumpTableData(getAssembler()));
}
} break;
case FT_Asm: {
@@ -1071,8 +1059,7 @@ void Cfg::emit() {
const bool NeedSandboxing = getFlags().getUseSandboxing();
emitTextHeader(FunctionName, Ctx, Asm);
- deleteJumpTableInsts();
- if (getFlags().getDecorateAsm()) {
+ if (Ctx->getFlags().getDecorateAsm()) {
for (Variable *Var : getVariables()) {
if (Var->getStackOffset() && !Var->isRematerializable()) {
Str << "\t" << Var->getSymbolicStackOffset(this) << " = "
@@ -1095,8 +1082,7 @@ void Cfg::emitIAS() {
TimerMarker T(TimerStack::TT_emitAsm, this);
// The emitIAS() routines emit into the internal assembler buffer, so there's
// no need to lock the streams.
- deleteJumpTableInsts();
- const bool NeedSandboxing = getFlags().getUseSandboxing();
+ const bool NeedSandboxing = Ctx->getFlags().getUseSandboxing();
for (CfgNode *Node : Nodes) {
if (NeedSandboxing && Node->needsAlignment())
getAssembler()->alignCfgNode();
« no previous file with comments | « src/IceCfg.h ('k') | src/IceELFObjectWriter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698