This is an archive of the discontinued LLVM Phabricator instance.

PC-relative support for EmitValue
Needs ReviewPublic

Authored by kyulee1 on Dec 8 2015, 7:37 AM.

Details

Reviewers
enderby
AndyAyers
Summary

EmitValue assumes an absolute (non PC-relative) fix-up only. This allows to create PC-relative fix-up optionally.

This is an upstream change that was needed for ObjectWriter/CoreRT use.

Diff Detail

Event Timeline

kyulee1 updated this revision to Diff 42177.Dec 8 2015, 7:37 AM
kyulee1 retitled this revision from to PC-relative support for EmitValue.
kyulee1 updated this object.
kyulee1 added a reviewer: AndyAyers.
kyulee1 added a subscriber: llvm-commits.
AndyAyers edited edge metadata.Dec 8 2015, 1:43 PM

We should probably find an additional reviewer; can you check with code owners?

Also is there any way to test this?

lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
511

Not sure if this is called out in the coding conventions or not, but since SMLoc wasn't given a default value before, it seems like neither SMLoc or IsPCRelative should be defaulted here.

lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h
64

Ditto here

kyulee1 updated this revision to Diff 42315.Dec 9 2015, 10:21 AM
kyulee1 added a reviewer: enderby.

Updated the changes -- no default value under MCTargetDesc.
I'm not sure how to add a standalone test unless we want to extend an asm syntax like .pcrel and implement it using this.
Since this API does not alter the default behavior, but I don't think testing is really necessary as long as build is successful.

Added a reviewer, Kevin -- I just picked from the log who added SMLoc argument to EmitValue.
Can you please take a look?

This looks like it's unused by the in-tree targets. What other object formats do you know of that would benefit from this? Because if it's just CoreRT then it seems like it would make more sense to keep it there, where it can be tested properly.

include/llvm/MC/MCStreamer.h
524

I'd suggest:

/// \param IsPCRelative - Whether the value is PC relative or not.