[PATCH] Support: split object format out of environment

Tim Northover t.p.northover at gmail.com
Wed Mar 5 00:15:51 PST 2014


  Hi,

  Mostly I think this looks fine, but there are a few missing bits. The biggest one is probably support in Triple::normalize.

  Cheers.

  Tim.


================
Comment at: include/llvm/ADT/Triple.h:153
@@ +152,3 @@
+  /// The object format type.
+  ObjectFormatType Format;
+
----------------
This field needs initializing in the constructor and could probably do with a getFormat/setFormat pair so it's like the others.

================
Comment at: include/llvm/ADT/Triple.h:355
@@ -346,3 +354,3 @@
   bool isOSBinFormatELF() const {
-    return !isOSBinFormatMachO() && !isOSBinFormatCOFF();
+    return Format == Triple::ELF;
   }
----------------
This should use the getFormat() method to fit in with other Triple queries.

================
Comment at: unittests/ADT/TripleTest.cpp:204
@@ -203,3 +203,3 @@
 
-        for (int Env = 1+Triple::UnknownEnvironment; Env <= Triple::MachO;
+        for (int Env = 1 + Triple::UnknownEnvironment; Env <= Triple::Android;
              ++Env) {
----------------
I think the unittests need more updating than this to check the format field properly.


http://llvm-reviews.chandlerc.com/D2946



More information about the llvm-commits mailing list