aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-06-23 15:07:32 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-06-23 15:07:32 +0000
commitc9d336e5498960c8cb281a599c041052312497b1 (patch)
tree387fccebec381a01b0fd0274909ed564f544a810 /clang/lib/Frontend/InitPreprocessor.cpp
parentfcc7f6fad2ecb813a6e894d19e17631902925be5 (diff)
downloadllvm-c9d336e5498960c8cb281a599c041052312497b1.zip
llvm-c9d336e5498960c8cb281a599c041052312497b1.tar.gz
llvm-c9d336e5498960c8cb281a599c041052312497b1.tar.bz2
Restructure the propagation of -fPIC/-fPIE.
The PIC and PIE levels are not independent. In fact, if PIE is defined it is always the same as PIC. This is clear in the driver where ParsePICArgs returns a PIC level and a IsPIE boolean. Unfortunately that is currently lost and we pass two redundant levels down the pipeline. This patch keeps a bool and a PIC level all the way down to codegen. llvm-svn: 273566
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 27ef59a..6b93c69 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -873,10 +873,10 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
if (unsigned PICLevel = LangOpts.PICLevel) {
Builder.defineMacro("__PIC__", Twine(PICLevel));
Builder.defineMacro("__pic__", Twine(PICLevel));
- }
- if (unsigned PIELevel = LangOpts.PIELevel) {
- Builder.defineMacro("__PIE__", Twine(PIELevel));
- Builder.defineMacro("__pie__", Twine(PIELevel));
+ if (LangOpts.PIE) {
+ Builder.defineMacro("__PIE__", Twine(PICLevel));
+ Builder.defineMacro("__pie__", Twine(PICLevel));
+ }
}
// Macros to control C99 numerics and <float.h>