This is an archive of the discontinued LLVM Phabricator instance.

[llvm] llvm-ifs: Support for handling empty IFS and merging weak+strong symbols.
ClosedPublic

Authored by plotfi on Nov 28 2019, 1:48 PM.

Details

Summary

The following changes enable llvm-ifs to handle the following merge conflicts:

* Weak + Strong symbol merging for the same symbol
* empty vs non-empty triple field
* empty vs non-empty object file format

Diff Detail

Event Timeline

plotfi created this revision.Nov 28 2019, 1:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 28 2019, 1:48 PM
compnerd added inline comments.Nov 29 2019, 10:35 AM
llvm/tools/llvm-ifs/llvm-ifs.cpp
426

I would probably just write this as a ternary.

441

Why the inverse check style here?

450

Similar

501

Indentation seems off? Does this ensure that the rest of the symbol is identical? What happens if one of the size is different?

plotfi marked 7 inline comments as done.Nov 29 2019, 4:36 PM
plotfi added inline comments.
llvm/tools/llvm-ifs/llvm-ifs.cpp
426

So Stub.ObjectFileFormat = !Stub.ObjectFileFormat.empty() ? Stub.ObjectFileFormat : TargetStub->ObjectFileFormat; ? That doesn't seem that much cleaner to read to me than the if

441

A little less error prone? Should I change it to the other way around?

501

Yeah I realized this and changed it locally.

plotfi updated this revision to Diff 231577.Nov 29 2019, 4:57 PM
plotfi marked 3 inline comments as done.

Updated based on @compnerd's suggestions.

plotfi updated this revision to Diff 231578.Nov 29 2019, 4:58 PM

fixing indentation

plotfi updated this revision to Diff 231580.Nov 29 2019, 5:02 PM
plotfi updated this revision to Diff 232244.Dec 4 2019, 5:51 PM
plotfi edited the summary of this revision. (Show Details)

Update based on @compnerd's feedback

plotfi marked an inline comment as done.Dec 4 2019, 9:07 PM
plotfi added inline comments.
llvm/tools/llvm-ifs/llvm-ifs.cpp
501

The Type and Size checks are above before the Weak/Strong check. So yes they will be identical. I should add a test case though that exercises this.

compnerd accepted this revision.Dec 4 2019, 9:08 PM

LGTM with the additional test for the size/type mismatch validation.

This revision is now accepted and ready to land.Dec 4 2019, 9:08 PM
plotfi marked an inline comment as done.Dec 4 2019, 9:09 PM
plotfi added inline comments.
llvm/tools/llvm-ifs/llvm-ifs.cpp
501

I won't land until I add a lit test exercising strong/weak mismatch plus size mismatch.

plotfi updated this revision to Diff 232266.Dec 4 2019, 11:14 PM

adding tests for weak/strong mismatch that is also a size/type mismatch for a given symbol.

This revision was automatically updated to reflect the committed changes.