diff options
| author | Anders Carlsson <andersca@mac.com> | 2009-04-06 17:37:10 +0000 | 
|---|---|---|
| committer | Anders Carlsson <andersca@mac.com> | 2009-04-06 17:37:10 +0000 | 
| commit | 65cb90efc1f4e17cb95cbe24d0d9584211f5ccbd (patch) | |
| tree | 8d699e6a7c95f38634c67cd635018e5c3bbb2abc /clang/lib/Lex | |
| parent | 8887072bce5d2da4edadd9ad8a334ed3723fdad3 (diff) | |
| download | bcm5719-llvm-65cb90efc1f4e17cb95cbe24d0d9584211f5ccbd.tar.gz bcm5719-llvm-65cb90efc1f4e17cb95cbe24d0d9584211f5ccbd.zip  | |
Define __OPTIMIZE__ and __OPTIMIZE_SIZE__ if the -O[12] and -Os flags are passed to the compiler.
llvm-svn: 68450
Diffstat (limited to 'clang/lib/Lex')
| -rw-r--r-- | clang/lib/Lex/Preprocessor.cpp | 5 | 
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index a43bb6427e9..9eaf1403a2d 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -547,6 +547,11 @@ static void InitializePredefinedMacros(Preprocessor &PP,      DefineBuiltinMacro(Buf, "__int64=__INT64_TYPE__");    } +  if (PP.getLangOptions().Optimize) +    DefineBuiltinMacro(Buf, "__OPTIMIZE__=1"); +  if (PP.getLangOptions().OptimizeSize) +    DefineBuiltinMacro(Buf, "__OPTIMIZE_SIZE__=1"); +        // Initialize target-specific preprocessor defines.    const TargetInfo &TI = PP.getTargetInfo();  | 

