This is an archive of the discontinued LLVM Phabricator instance.

Reduce duplication in pcrel reloc creation
AcceptedPublic

Authored by espindola on Jul 4 2017, 10:36 AM.

Details

Reviewers
rnk
ruiu
Gerolf
Summary

This uses the same code for producing pcrel relocations in ELF, COFF and WebAsm.

Diff Detail

Event Timeline

rafael created this revision.Jul 4 2017, 10:36 AM

Trying to get phab to send email.

sbc100 added inline comments.Jul 5 2017, 10:24 AM
lib/MC/MCAssembler.cpp
202

Maybe move this check down so getSymB is only called once?

Rebase.
Address review comment.

rnk added inline comments.Jul 6 2017, 9:24 AM
lib/MC/MCAssembler.cpp
214

Should we check this first before we do work on SymB? It'll predict well.

test/MC/AArch64/error-location.s
7

Can we improve this diagnostic to mention SymbolB and maybe SymbolA? This test case makes it seem like our assembler diagnostics will get harder to understand. I was thinking:

error: No relocation available to represent the subtraction of 'undef' in this expression
rafael updated this revision to Diff 105537.Jul 6 2017, 2:43 PM

Improve error messages.

rnk accepted this revision.Jul 7 2017, 2:28 PM

lgtm, nice

This revision is now accepted and ready to land.Jul 7 2017, 2:28 PM
rafael added a reviewer: Gerolf.

Rebased.

Rebased. Still blocked on the dependency.

espindola commandeered this revision.Mar 6 2018, 5:22 PM
espindola added a reviewer: rafael.