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()) |