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

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: Fixes pre-review issues. 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
Index: src/IceCfg.cpp
diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp
index 1965fe2d5a82fffac65a1ac22d46cb640a10c774..524216cbadd637060c48ca483a53739fb898ffa9 100644
--- a/src/IceCfg.cpp
+++ b/src/IceCfg.cpp
@@ -1006,11 +1006,6 @@ void Cfg::emitTextHeader(GlobalString Name, GlobalContext *Ctx,
Str << Name << ":\n";
}
-void Cfg::deleteJumpTableInsts() {
- for (InstJumpTable *JumpTable : JumpTables)
- JumpTable->setDeleted();
-}
-
void Cfg::emitJumpTables() {
switch (Ctx->getFlags().getOutFileType()) {
case FT_Elf:
@@ -1018,14 +1013,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: {
@@ -1052,7 +1040,6 @@ void Cfg::emit() {
const bool NeedSandboxing = Ctx->getFlags().getUseSandboxing();
emitTextHeader(FunctionName, Ctx, Asm);
- deleteJumpTableInsts();
if (Ctx->getFlags().getDecorateAsm()) {
for (Variable *Var : getVariables()) {
if (Var->getStackOffset() && !Var->isRematerializable()) {
@@ -1076,7 +1063,6 @@ 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 = Ctx->getFlags().getUseSandboxing();
for (CfgNode *Node : Nodes) {
if (NeedSandboxing && Node->needsAlignment())
« no previous file with comments | « src/IceCfg.h ('k') | src/IceELFObjectWriter.cpp » ('j') | src/IceGlobalContext.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698