[cfe-commits] r57140 - /cfe/trunk/lib/Basic/Targets.cpp

Chris Lattner sabre at nondot.org
Sun Oct 5 14:50:58 PDT 2008


Author: lattner
Date: Sun Oct  5 16:50:58 2008
New Revision: 57140

URL: http://llvm.org/viewvc/llvm-project?rev=57140&view=rev
Log:
miscellaneous cleanups

Modified:
    cfe/trunk/lib/Basic/Targets.cpp

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=57140&r1=57139&r2=57140&view=diff

==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Sun Oct  5 16:50:58 2008
@@ -33,11 +33,38 @@
   Buf.push_back('\n');
 }
 
+//===----------------------------------------------------------------------===//
+// Defines specific to certain operating systems.
+//===----------------------------------------------------------------------===//
+
 static void getSolarisDefines(std::vector<char> &Defs) {
   Define(Defs, "__SUN__");
   Define(Defs, "__SOLARIS__");
 }
 
+static void getDragonFlyDefines(std::vector<char> &Defs) {
+  // DragonFly defines; list based off of gcc output
+  Define(Defs, "__DragonFly__");
+  Define(Defs, "__DragonFly_cc_version", "100001");
+  Define(Defs, "__ELF__");
+  Define(Defs, "__KPRINTF_ATTRIBUTE__");
+  Define(Defs, "__tune_i386__");
+  Define(Defs, "unix");
+  Define(Defs, "__unix");
+  Define(Defs, "__unix__");
+}
+
+static void getLinuxDefines(std::vector<char> &Defs) {
+  // Linux defines; list based off of gcc output
+  Define(Defs, "__unix__");
+  Define(Defs, "__unix");
+  Define(Defs, "unix");
+  Define(Defs, "__linux__");
+  Define(Defs, "__linux");
+  Define(Defs, "linux");
+  Define(Defs, "__gnu_linux__");
+}
+
 static void getDarwinDefines(std::vector<char> &Defs, const char *Triple) {
   Define(Defs, "__APPLE__");
   Define(Defs, "__MACH__");
@@ -72,28 +99,9 @@
   }
 }
 
-static void getDragonFlyDefines(std::vector<char> &Defs) {
-  // DragonFly defines; list based off of gcc output
-  Define(Defs, "__DragonFly__");
-  Define(Defs, "__DragonFly_cc_version", "100001");
-  Define(Defs, "__ELF__");
-  Define(Defs, "__KPRINTF_ATTRIBUTE__");
-  Define(Defs, "__tune_i386__");
-  Define(Defs, "unix");
-  Define(Defs, "__unix");
-  Define(Defs, "__unix__");
-}
-
-static void getLinuxDefines(std::vector<char> &Defs) {
-  // Linux defines; list based off of gcc output
-  Define(Defs, "__unix__");
-  Define(Defs, "__unix");
-  Define(Defs, "unix");
-  Define(Defs, "__linux__");
-  Define(Defs, "__linux");
-  Define(Defs, "linux");
-  Define(Defs, "__gnu_linux__");
-}
+//===----------------------------------------------------------------------===//
+// Defines specific to certain architectures.
+//===----------------------------------------------------------------------===//
 
 /// getPowerPCDefines - Return a set of the PowerPC-specific #defines that are
 /// not tied to a specific subtarget.





More information about the cfe-commits mailing list