From 3bbc75302fd43cf13d868b46c94ff8794b302e43 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 8 Apr 2009 18:03:55 +0000 Subject: More fixes to builtin preprocessor defines. - Add -static-define option driver can use when __STATIC__ should be defined (instead of __DYNAMIC__). - Don't set __OPTIMIZE_SIZE__ on Os, __OPTIMIZE_SIZE__ is tied to Oz. - Set __NO_INLINE__ following GCC 4.2. - Set __GNU_GNU_INLINE__ or __GNU_STDC_INLINE__ following GCC 4.2. - Set __EXCEPTIONS for Objective-C NonFragile ABI. - Set __STRICT_ANSI__ for standard conforming modes. - I added a clang style test case in utils for this, but its not particularly portable and I don't think it belongs in the test suite. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68621 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/Driver/Tools.cpp') diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 487e5c8cd0..ddf1148e42 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -79,6 +79,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-main-file-name"); CmdArgs.push_back(darwin::CC1::getBaseInputName(Args, Inputs)); + // Some flags which affect the language (via preprocessor + // defines). See darwin::CC1::AddCPPArgs. + if (Args.hasArg(options::OPT_static)) + CmdArgs.push_back("-static-define"); + if (isa(JA)) { // Add default argument set. // -- cgit v1.2.3-70-g09d2