This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Make SymbolTable::addDefined return Defined.
ClosedPublic

Authored by grimar on Nov 16 2018, 3:57 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Nov 16 2018, 3:57 AM

This looks fine to me. It makes sense for addDefined to actually return a Defined.

grimar edited the summary of this revision. (Show Details)Nov 16 2018, 5:53 AM
peter.smith accepted this revision.Nov 22 2018, 1:40 AM

LGTM. I think that this one is low risk anyway.

This revision is now accepted and ready to land.Nov 22 2018, 1:40 AM

LGTM. I think that this one is low risk anyway.

Thanks!

This revision was automatically updated to reflect the committed changes.
ruiu added inline comments.Nov 26 2018, 10:58 AM
lld/trunk/ELF/SymbolTable.cpp
477

If Cmp == 0, doesn't this cast fail with an assertion failure because S is not guaranteed to be a Defined symbol?

grimar marked an inline comment as done.Nov 27 2018, 3:01 AM
grimar added inline comments.
lld/trunk/ELF/SymbolTable.cpp
477

Note that if Cmp == 0 we call the reportDuplicate which do the cast<Defined> inside:
https://github.com/llvm-mirror/lld/blob/master/ELF/SymbolTable.cpp#L427

I think in all cases S here is a Defined.