[cfe-commits] r38985 - /cfe/cfe/trunk/Driver/clang.cpp
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:26:31 PDT 2007
Author: sabre
Date: Wed Jul 11 11:26:31 2007
New Revision: 38985
URL: http://llvm.org/viewvc/llvm-project?rev=38985&view=rev
Log:
Get target-specific #defines from TargetInfo.
Modified:
cfe/cfe/trunk/Driver/clang.cpp
Modified: cfe/cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/clang.cpp?rev=38985&r1=38984&r2=38985&view=diff
==============================================================================
--- cfe/cfe/trunk/Driver/clang.cpp (original)
+++ cfe/cfe/trunk/Driver/clang.cpp Wed Jul 11 11:26:31 2007
@@ -29,6 +29,7 @@
#include "clang/Basic/FileManager.h"
#include "clang/Basic/SourceBuffer.h"
#include "clang/Basic/SourceManager.h"
+#include "clang/Basic/TargetInfo.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/System/MappedFile.h"
#include "llvm/System/Signals.h"
@@ -298,12 +299,16 @@
DefineBuiltinMacro(Buf, "__STDC_HOSTED__=1");
//DefineBuiltinMacro(Buf, "__OBJC__=1");
+ // Get the target #defines.
+ PP.getTargetInfo().getTargetDefines(Buf);
+
// FIXME: This is obviously silly. It should be more like gcc/c-cppbuiltin.c.
// Macros predefined by GCC 4.0.1.
+ DefineBuiltinMacro(Buf, "__APPLE_CC__=5250");
+
DefineBuiltinMacro(Buf, "_ARCH_PPC=1");
DefineBuiltinMacro(Buf, "_BIG_ENDIAN=1");
- DefineBuiltinMacro(Buf, "__APPLE_CC__=5250");
- DefineBuiltinMacro(Buf, "__APPLE__=1");
+ //XXX DONE DefineBuiltinMacro(Buf, "__APPLE__=1");
DefineBuiltinMacro(Buf, "__BIG_ENDIAN__=1");
DefineBuiltinMacro(Buf, "__CHAR_BIT__=8");
DefineBuiltinMacro(Buf, "__CONSTANT_CFSTRINGS__=1");
More information about the cfe-commits
mailing list