[PATCH] Add default parameter to MCSymbol accessors to control IsUsed

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 15:14:32 PDT 2015


Hi,

Currently, some accessors in MCSymbol set IsUsed when they shouldn't be. This can lead to surprising bugs.

The first patch I've attached adds a default parameter, "SetUsed = true", to some MCSymbol accessors. This preserves the current behavior (NFC) without impacting existing code. It also buys us more flexibility when we don't want to set IsUsed.

The second patch touches MC/AsmParser to fix an issue where we get "invalid reassignment of non-absolute variable" when the error doesn't apply.

The second patch deserves closer scrutiny, because, try as I might, I couldn't craft a test case which gets this error to trigger. I need some help coming up for a test case for it. It could be the case that the error should never trigger -- if so, we can get rid of it.

ninja check-all reports no issues.

I don't have commit rights. I'd appreciate someone reviewing all of this and (hopefully) guiding it into trunk.

thanks!
vedant

-------------- next part --------------
A non-text attachment was scrubbed...
Name: MCSymbol-predicates-SetUsed.patch
Type: application/octet-stream
Size: 2855 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150806/fee6fbb2/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MCParser-invalid-reassignmet.patch
Type: application/octet-stream
Size: 2780 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150806/fee6fbb2/attachment-0001.obj>
-------------- next part --------------




More information about the llvm-commits mailing list