This is an archive of the discontinued LLVM Phabricator instance.

Move logic from llvm::Triple::getARMCPUForArch to driver::tools::arm::getARMCPUForMArch
AbandonedPublic

Authored by dschuff on Mar 25 2015, 4:54 PM.

Details

Reviewers
rengolin
echristo
Summary

This is its only consumer, and this kind of logic belongs in the driver anyway.

Diff Detail

Event Timeline

dschuff updated this revision to Diff 22688.Mar 25 2015, 4:54 PM
dschuff retitled this revision from to Move logic from llvm::Triple::getARMCPUForArch to driver::tools::arm::getARMCPUForMArch.
dschuff updated this object.
dschuff edited the test plan for this revision. (Show Details)
dschuff added reviewers: echristo, rengolin.
dschuff added subscribers: Unknown Object (MLST), Unknown Object (MLST).

I tried to also bring the couple of relevant unittests in llvm/unittests/ADT/unittests but there seems to be no sane way to create an Arg (for the ArgList) for testing (without going through the same steps ParseArgs does). I'm open to suggestions on that?

rengolin edited edge metadata.Mar 26 2015, 3:36 AM

Did you remove the out-of-line function?

lib/Driver/Tools.cpp
5544

Move this switch inside the identical one below, after the StringSwitch.

The out of line function is on the LLVM side, so that will be a separate commit (D8637)

lib/Driver/Tools.cpp
5544

I don't think that will work. This logic is supposed to override the StringSwitch; e.g. if the OS is FreeBSD and MArch is "armv6" then the CPU is supposed to be "arm1176jzf-s" but if this switch is moved, then the StringSwitch logic will return "arm1136jf-s"

rengolin requested changes to this revision.Mar 26 2015, 9:58 AM
rengolin edited edge metadata.

If the out-of-line is in LLVM, then there's no way of knowing this is the only user. Any other front-end of separate project can be using it, unfortunately.

Being so, don't add this into Clang and lets refactor this in LLVM.

A move to clean up that mess should be done once we have a common target description and warning for at least one release.

lib/Driver/Tools.cpp
5544

The string switch will only return arm1136 if the string is "armv6", I thought you said your string was "arm".

the whole point of the switch below is to catch all the rest, and that's what it seems your case is.

This revision now requires changes to proceed.Mar 26 2015, 9:58 AM

OK, so we can abandon this and go back to D8589

dschuff abandoned this revision.Mar 26 2015, 3:02 PM