[PATCH] Refactor ARM subarchitecture parsing.

Renato Golin renato.golin at linaro.org
Fri Jul 4 04:49:38 PDT 2014


================
Comment at: include/llvm/ADT/Triple.h:81
@@ -80,1 +80,3 @@
   };
+  enum SubArchType {
+    NoSubArch,
----------------
Tim Northover wrote:
> Renato Golin wrote:
> > I'd number them in sequential order, so you can do tricks like Arch > v5.
> I actually quite like the original: comparing architectures like that on ARM is extremely suspect since they form a partial order (Is v6m > v4t?).
> 
> Sorting in some kind of reverse (as here) reduces the temptation to do that since even the obvious comparisons will be "wrong".
Using reverse order allows you to compare, but in the wrong order, which is even worse... :)

I agree many comparisons will be "wrong", but some are still "ok", and having them in order would make it less weird.

But this is just a weak opinion, I'm fine either way.

================
Comment at: include/llvm/ADT/Triple.h:84
@@ +83,3 @@
+
+    v8,
+    v7,
----------------
Tim Northover wrote:
> Triple is generic code. At the very least we should prefix these with "ARMSubArch" or something to avoid polluting other targets.
Good point!

http://reviews.llvm.org/D4375






More information about the llvm-commits mailing list