This is an archive of the discontinued LLVM Phabricator instance.

[MCJIT] Fix a crash in getPointerToFunction
AcceptedPublic

Authored by loladiro on Jun 19 2015, 6:58 PM.

Details

Reviewers
lhames
Summary

If the first function passed to getPointerToFunction has private linkage,
MCJIT crashes, because the TargetMachine's TargetLoweringObjectFile has
not been inititalized yet. Fix this by moving the name resolution past
code generation (which initializes the TargetLoweringObjectFile) in the
common case, and returning null early for declarations with private
linkage.

Diff Detail

Event Timeline

loladiro updated this revision to Diff 28074.Jun 19 2015, 6:58 PM
loladiro retitled this revision from to [MCJIT] Fix a crash in getPointerToFunction.
loladiro updated this object.
loladiro edited the test plan for this revision. (Show Details)
loladiro added a reviewer: lhames.
loladiro added a subscriber: Unknown Object (MLST).
lhames accepted this revision.Jun 23 2015, 2:19 PM
lhames edited edge metadata.

LGTM. Thanks Keno!

This revision is now accepted and ready to land.Jun 23 2015, 2:19 PM

This fix was not committed.