Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit a14b776

Browse files
committed
clean up no longer needed code, we can use constantexpr bitcasts for more things in SimplifyStructRegSignatures
1 parent 19de837 commit a14b776

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

lib/Target/JSBackend/NaCl/SimplifyStructRegSignatures.cpp

-15
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ class SimplifyStructRegSignatures : public ModulePass {
126126
DenseSet<Function *> FunctionsToDelete;
127127
SetVector<CallInst *> CallsToPatch;
128128
SetVector<InvokeInst *> InvokesToPatch;
129-
SetVector<BitCastInst *> BitCastsToPatch;
130129
DenseMap<Function *, Function *> FunctionMap;
131130

132131
struct FunctionAddressing {
@@ -437,10 +436,6 @@ void SimplifyStructRegSignatures::scheduleInstructionsForCleanup(
437436
CallsToPatch.insert(Call);
438437
} else if (InvokeInst *Invoke = dyn_cast<InvokeInst>(&IIter)) {
439438
InvokesToPatch.insert(Invoke);
440-
} else if (BitCastInst *BitCast = dyn_cast<BitCastInst>(&IIter)) {
441-
if (isa<Function>(BitCast->getOperand(0))) {
442-
BitCastsToPatch.insert(BitCast);
443-
}
444439
}
445440
}
446441
}
@@ -542,16 +537,6 @@ bool SimplifyStructRegSignatures::runOnModule(Module &M) {
542537
fixCallSite(Ctx, InvokeToFix, PreferredAlignment);
543538
}
544539

545-
// BitCasts of a function we are modifying must be corrected
546-
for (auto &BitCastToFix : BitCastsToPatch) {
547-
auto *Old = cast<Function>(BitCastToFix->getOperand(0));
548-
if (FunctionMap.find(Old) != FunctionMap.end()) {
549-
auto *New = FunctionMap[Old];
550-
IRBuilder<> Builder(BitCastToFix);
551-
BitCastToFix->setOperand(0, Builder.CreateBitCast(New, Old->getType(), "bitcastfixcast"));
552-
}
553-
}
554-
555540
// Update taking of a function's address from a parameter
556541
for (auto &Addressing : FunctionAddressings) {
557542
Value *Temp = Addressing.Temp;

0 commit comments

Comments
 (0)