[PATCH] Simplify getARMCPUForMArch() and make it more consistent

scott douglass sdouglass at arm.com
Tue Apr 22 01:42:00 PDT 2014



================
Comment at: lib/Driver/Tools.cpp:4887
@@ +4886,3 @@
+  if (MArch.startswith("arm") || MArch.startswith("thumb"))
+    result = llvm::StringSwitch<const char *>(MArch)
+      .EndsWith("v2", "arm2")
----------------
Jon Roelofs wrote:
> On second thought, this would allow things like "armblahblahblahv4" to be matched as "strongarm".
> 
> Maybe it is better to substr MArch to take off the arm/thumb part, then check for eb, chomp that off as well, and finally check that whats left is one of those suffixes.
Yes, perhaps it would be good to be stricter in the matching.  But 'strongarm' is arguably a better choice for 'armblahblahblahv4' than the default 'arm7tdmi' (which is 'v4t').

Perhaps a warning is appropriate when the default is taken for a non-empty MArch?


http://reviews.llvm.org/D3409






More information about the cfe-commits mailing list