This is an archive of the discontinued LLVM Phabricator instance.

Bitcode: Clean up error handling for certain bitcode query functions.
ClosedPublic

Authored by pcc on Nov 10 2016, 5:20 PM.

Details

Summary

The functions getBitcodeTargetTriple(), isBitcodeContainingObjCCategory(),
getBitcodeProducerString() and hasGlobalValueSummary() now return errors
via their return value rather than via the diagnostic handler.

To make this work, re-implement these functions using non-member functions
so that they can be used without the LLVMContext required by BitcodeReader.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc updated this revision to Diff 77576.Nov 10 2016, 5:20 PM
pcc retitled this revision from to Bitcode: Clean up error handling for certain bitcode query functions..
pcc updated this object.
pcc added a reviewer: mehdi_amini.
pcc added subscribers: llvm-commits, lhames.
mehdi_amini accepted this revision.Nov 10 2016, 10:34 PM
mehdi_amini edited edge metadata.

LGTM.
Thanks, I'm always in favor of free function when it makes sense!

llvm/lib/Bitcode/Reader/BitcodeReader.cpp
615 ↗(On Diff #77576)

I feel this could be pulled out as a first step in another patch.

This revision is now accepted and ready to land.Nov 10 2016, 10:34 PM
This revision was automatically updated to reflect the committed changes.
pcc added inline comments.Nov 11 2016, 12:01 PM
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
615 ↗(On Diff #77576)

r286622