From c9d336e5498960c8cb281a599c041052312497b1 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 23 Jun 2016 15:07:32 +0000 Subject: 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 --- clang/lib/CodeGen/CodeGenModule.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index a8abe72..5077727 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(PLevel)); - } - - if (uint32_t PLevel = Context.getLangOpts().PIELevel) { - assert(PLevel < 3 && "Invalid PIE Level"); - getModule().setPIELevel(static_cast(PLevel)); + if (Context.getLangOpts().PIE) + getModule().setPIELevel(static_cast(PLevel)); } SimplifyPersonality(); -- cgit v1.1