[PATCH] MachO-embedded: refactor Clang to use "*-*-unknown-macho" triple

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Wed Dec 18 18:45:08 PST 2013



================
Comment at: lib/Basic/Targets.cpp:87
@@ -86,3 +86,3 @@
 
 static void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts,
                              const llvm::Triple &Triple,
----------------
Should this be MachODefines now?

================
Comment at: lib/Basic/Targets.cpp:170
@@ -169,2 +169,3 @@
       Str[4] = '\0';
+      Builder.defineMacro("__MACH__");
       Builder.defineMacro("__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__", Str);
----------------
I know it is just one line, but I would still avoid the duplication by moving it under a i if (Triple.isOSDarwin())

================
Comment at: lib/Driver/Driver.cpp:382
@@ -383,1 +381,3 @@
+  // MachO targets this uses the driver-driver and universal actions.
+  if (TC.getTriple().isOSBinFormatMachO())
     BuildUniversalActions(C->getDefaultToolChain(), C->getArgs(),
----------------
Really? Why do you need a driver driver for? Are you building a fat binary for an embedded system? 


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



More information about the cfe-commits mailing list