This is an archive of the discontinued LLVM Phabricator instance.

Also map the personality function in CloneFunctionInto
ClosedPublic

Authored by loladiro on Nov 6 2015, 6:26 PM.

Details

Summary

The Old personality function gets copied over, but the Materializer didn't have a chance to inspect it (e.g. to fix up references to the correct module for the target function). Also add a verifier check that makes sure the personality routine is in the same module as the function whose personality it is.

Diff Detail

Repository
rL LLVM

Event Timeline

loladiro updated this revision to Diff 39618.Nov 6 2015, 6:26 PM
loladiro retitled this revision from to Also map the personality function in CloneFunctionInto.
loladiro updated this object.
loladiro added a reviewer: majnemer.
loladiro set the repository for this revision to rL LLVM.
loladiro added a subscriber: llvm-commits.
loladiro updated this revision to Diff 39620.Nov 6 2015, 7:02 PM

Fix typo

majnemer accepted this revision.Nov 7 2015, 9:30 AM
majnemer edited edge metadata.

LGTM with nits.

lib/IR/Verifier.cpp
1762

auto *Per

lib/Transforms/Utils/CloneFunction.cpp
98

Please end this sentence in a period.

99

Shouldn't this be OldFunc->hasPersonalityFn()?

This revision is now accepted and ready to land.Nov 7 2015, 9:30 AM
loladiro added inline comments.Nov 15 2015, 7:55 PM
lib/Transforms/Utils/CloneFunction.cpp
99

It doesn't matter, because it gets copied over above, but sure, I'll change it to make it more clear what's going on here.

This revision was automatically updated to reflect the committed changes.