Only AsmParser.cpp seems to care about isUsed and it only overrides SetUsed
for isUndefined and getVariableValue.
Also setUsed() is never called, so remove it.
Paths
| Differential D41971
MC: Remove redundant `SetUsed` arguments in MCSymbol methods. NFC ClosedPublic Authored by sbc100 on Jan 11 2018, 4:13 PM.
Details Summary Only AsmParser.cpp seems to care about isUsed and it only overrides SetUsed Also setUsed() is never called, so remove it.
Diff Detail
Event TimelineComment Actions Your changes to lib/ lgtm. IMO getting rid of the SetUsed parameters entirely would be preferable to having only some predicates accept SetUsed. Have you considered removing the update to IsUsed in getVariableValue(), and inserting calls to setUsed() as needed to fix any regressions? Comment Actions
I think you are probably right, but I didn't want to change AsmParser.cpp too much because I don't know that part of the codebase at all. This change made sense to me because I can easily see that it is a NFC. Are you suggesting that AsmParser.cpp rely on calling setUsed explicitly rather than implicitly? I think that would probably be more clear. sbc100 retitled this revision from MC: Remove redundant `SetUsed` arguments in MCSymbol methods to MC: Remove redundant `SetUsed` arguments in MCSymbol methods. NFC.Jan 11 2018, 4:57 PM Comment Actions
I also don't really know this part of the codebase, and only added the default parameters to fix a bug without causing excessive churn. I do think it would be clearer if setUsed is called explicitly as needed. If you think that's the right approach but don't have time to look into it, I'll volunteer to take a stab at it. Comment Actions LGTM. A change removing more uses of setUsed=true would be nice, but it can be a followup. This revision is now accepted and ready to land.Jan 12 2018, 7:59 AM Closed by commit rL322386: MC: Remove redundant `SetUsed` arguments in MCSymbol methods (authored by sbc). · Explain WhyJan 12 2018, 10:07 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 129652 llvm/trunk/include/llvm/MC/MCSymbol.h
llvm/trunk/lib/MC/MCCodeView.cpp
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.cpp
|