This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Rename DarwinDirective to CPUDirective (NFC)
ClosedPublic

Authored by kbarton on Nov 15 2019, 6:15 PM.

Details

Summary

This patch renames the DarwinDirective (used to identify which CPU was defined)
to CPUDirective. It also adds the getCPUDirective() method and replaces all uses
of getDarwinDirective() with getCPUDirective().

Once this patch lands and downstream users of the getDarwinDirective() method
have switched to the getCPUDirective() method, the old getDarwinDirective()
method will be removed.

Event Timeline

kbarton created this revision.Nov 15 2019, 6:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2019, 6:15 PM
jsji added a reviewer: Restricted Project.Nov 15 2019, 7:00 PM
jsji accepted this revision as: jsji.Nov 15 2019, 7:23 PM

LGTM. Thanks for the clean up!
The only other instance containing DarwinDirective is ParseDarwinDirectiveMachine in PPCAsmParser.cpp , and it is for Mach-O parsing, so it is reasonable to do not rename it.

llvm/lib/Target/PowerPC/PPCSubtarget.h
172

Shall we explicitly add doxygen \deprecated in comments?

This revision is now accepted and ready to land.Nov 15 2019, 7:23 PM
jhibbits accepted this revision.Nov 16 2019, 9:55 AM
hfinkel accepted this revision as: hfinkel.Nov 17 2019, 8:53 AM

LGTM too.

(One day we might also rename 'Directive' to something like 'TargetCPU', but this is a good step regardless).

kbarton marked an inline comment as done.Nov 22 2019, 4:03 AM
kbarton added inline comments.
llvm/lib/Target/PowerPC/PPCSubtarget.h
172

I could, if you really want me to. Although I was hoping this wasn't going to be around long enough for that to make a difference.

jsji added inline comments.Nov 22 2019, 12:27 PM
llvm/lib/Target/PowerPC/PPCSubtarget.h
172

I am fine with leaving it as it is now. Thanks.

kbarton marked 2 inline comments as done.Nov 25 2019, 12:27 PM
This revision was automatically updated to reflect the committed changes.