summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.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/CodeGen/CodeGenModule.cpp
parentfcc7f6fad2ecb813a6e894d19e17631902925be5 (diff)
downloadbcm5719-llvm-c9d336e5498960c8cb281a599c041052312497b1.tar.gz
bcm5719-llvm-c9d336e5498960c8cb281a599c041052312497b1.zip
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/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index a8abe72702e..507772707ce 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -480,11 +480,8 @@ void CodeGenModule::Release() {
if (uint32_t PLevel = Context.getLangOpts().PICLevel) {
assert(PLevel < 3 && "Invalid PIC Level");
getModule().setPICLevel(static_cast<llvm::PICLevel::Level>(PLevel));
- }
-
- if (uint32_t PLevel = Context.getLangOpts().PIELevel) {
- assert(PLevel < 3 && "Invalid PIE Level");
- getModule().setPIELevel(static_cast<llvm::PIELevel::Level>(PLevel));
+ if (Context.getLangOpts().PIE)
+ getModule().setPIELevel(static_cast<llvm::PIELevel::Level>(PLevel));
}
SimplifyPersonality();
OpenPOWER on IntegriCloud