This is its only consumer, and this kind of logic belongs in the driver anyway.
Diff Detail
Event Timeline
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?
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" |
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. |
Move this switch inside the identical one below, after the StringSwitch.