This is an archive of the discontinued LLVM Phabricator instance.

[Object] Change ObjectFile::getSymbolValue() return type to Expected<uint64_t>
ClosedPublic

Authored by Higuoxing on Apr 29 2020, 2:36 AM.

Details

Summary

In D77860, we have changed getSymbolFlags() return type to Expected<uint32_t>.
This change helps bubble the error further up the stack.

Diff Detail

Event Timeline

Higuoxing created this revision.Apr 29 2020, 2:36 AM

Because llvm-objdump calls getSymbolAddress() first, then calls getSymbolFlags(). We have to enable error reporting in getSymbolAddress() as well.

jhenderson added inline comments.Apr 30 2020, 1:42 AM
llvm/lib/DebugInfo/GSYM/ObjectFileTransformer.cpp
91

Should this either a) be a cantFail or b) returned? If the latter, it should be commented with a TODO.

llvm/lib/XRay/InstrumentationMap.cpp
121–122

Whilst you're at it, could you fold these two lines together or at least rename resolved to Resolved?

Higuoxing updated this revision to Diff 261190.Apr 30 2020, 4:46 AM

Addressed comments.

This revision is now accepted and ready to land.May 1 2020, 2:07 AM
This revision was automatically updated to reflect the committed changes.