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

Commit 19de837

Browse files
committed
handle uses of changed functions in globals in SimplifyStructRegSignatures
1 parent b077029 commit 19de837

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/Target/JSBackend/NaCl/SimplifyStructRegSignatures.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,14 @@ bool SimplifyStructRegSignatures::runOnModule(Module &M) {
561561
Temp->replaceAllUsesWith(New);
562562
}
563563

564+
// Remaining uses of functions we modified (like in a global vtable)
565+
// can be handled via a constantexpr bitcast
566+
for (auto &Old : FunctionsToDelete) {
567+
Function *New = FunctionMap[Old];
568+
assert(New);
569+
Old->replaceAllUsesWith(ConstantExpr::getBitCast(New, Old->getType()));
570+
}
571+
564572
// Delete leftover functions - the ones with old signatures.
565573
for (auto &ToDelete : FunctionsToDelete) {
566574
ToDelete->eraseFromParent();

0 commit comments

Comments
 (0)