This is an archive of the discontinued LLVM Phabricator instance.

ValueMapper: fix assertion when null-mapping a constant for linking metadata
ClosedPublic

Authored by mehdi_amini on May 26 2016, 5:50 PM.

Details

Summary

When RF_NullMapMissingGlobalValues is set, mapValue can return null
for GlobalValue. When mapping the operands of a constant that is
referenced from metadata, we need to handle this case and actually
return null instead of mapping this constant.

Diff Detail

Event Timeline

mehdi_amini retitled this revision from to ValueMapper: fix assertion when null-mapping a constant for linking metadata.
mehdi_amini updated this object.
mehdi_amini added reviewers: dexonsmith, rafael.
mehdi_amini added a subscriber: llvm-commits.
rafael edited edge metadata.May 27 2016, 5:34 AM
rafael added a subscriber: rafael.

Maybe add a helper that call mapValue, does the assert and then
returns the result?

mehdi_amini edited edge metadata.

Refactor the assertion in a helper lambda

Fix the assert after extraction in the helper

This revision was automatically updated to reflect the committed changes.