diff options
author | Chris Lattner <sabre@nondot.org> | 2008-10-05 21:50:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-10-05 21:50:58 +0000 |
commit | d29b6300a70576f5996f4137536e3ca1efa8eb83 (patch) | |
tree | b8a09c56a90d1cca3efd306730da946676d71981 /lib/Basic/Targets.cpp | |
parent | 12f09260294175dc097b843d3d06d048b9cd64a3 (diff) |
miscellaneous cleanups
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57140 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Targets.cpp')
-rw-r--r-- | lib/Basic/Targets.cpp | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 424be5f268..016f88e498 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -33,11 +33,38 @@ static void Define(std::vector<char> &Buf, const char *Macro, 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 getDarwinDefines(std::vector<char> &Defs, const char *Triple) { } } -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. |