This is an archive of the discontinued LLVM Phabricator instance.

Implement a safer bitcode upgrade for DISubprogram
ClosedPublic

Authored by aprantl on May 5 2016, 5:14 PM.

Details

Summary

The bitcode upgrade I added for DISubprogram in r266446 was based on the assumption that the CU node for the subprogram was already materialized by the time the DISubprogram is visited. This assumption may not hold true as future versions of LLVM may decide to write out bitcode in a different order. This patch corrects this by introducing a versioning bit next to the distinct flag to unambiguously differentiate the new from the old record layouts.

Note for people stabilizing LLVM out-of-tree: This patch introduces a bitcode incompatibility with llvm trunk revisions from r266446 — here. (But D19987 will ensure that it degrades gracefully).

Diff Detail

Event Timeline

aprantl updated this revision to Diff 56370.May 5 2016, 5:14 PM
aprantl retitled this revision from to Implement a safer bitcode upgrade for DISubprogram.
aprantl updated this object.
aprantl added reviewers: dexonsmith, mehdi_amini.
aprantl added a subscriber: llvm-commits.
aprantl updated this revision to Diff 56435.May 6 2016, 10:39 AM

Renamed IsVersion3 to HasUnit. This is easier to read regardless.

aprantl updated this revision to Diff 56450.May 6 2016, 1:16 PM

I get it. Independent flags don't really make sense in this context, and with the >2 check we can later add further bits *to the version number*.

dexonsmith edited edge metadata.May 6 2016, 1:23 PM
dexonsmith added a subscriber: dexonsmith.

Sorry for the delay answering your questions above, but it looks like we reached consensus anyway :).

LGTM with one fixup.

mehdi_amini edited edge metadata.Jul 12 2016, 4:15 PM

Was this committed? (If yes please indicate revision and close)

aprantl accepted this revision.Jul 12 2016, 4:40 PM
aprantl added a reviewer: aprantl.
This revision is now accepted and ready to land.Jul 12 2016, 4:40 PM
aprantl closed this revision.Jul 12 2016, 4:40 PM

This was r268816.