aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorSriraman Tallam <tmsriram@google.com>2016-04-28 22:34:00 +0000
committerSriraman Tallam <tmsriram@google.com>2016-04-28 22:34:00 +0000
commit70e70e6eb93cf8e99d4284326c520463f2b880d1 (patch)
tree577d1b06908634a8df0eb6bfed79fb74e29c94a3 /clang/lib/CodeGen/CodeGenModule.cpp
parent1f4231f8cf138c810a55a398c07a422908add70f (diff)
downloadllvm-70e70e6eb93cf8e99d4284326c520463f2b880d1.zip
llvm-70e70e6eb93cf8e99d4284326c520463f2b880d1.tar.gz
llvm-70e70e6eb93cf8e99d4284326c520463f2b880d1.tar.bz2
Differential Revision: http://reviews.llvm.org/D19687
Set module flag PIELevel. Simplify code that sets PICLevel flag. llvm-svn: 267948
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 8ff99a6..79da25c 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -477,15 +477,13 @@ void CodeGenModule::Release() {
}
if (uint32_t PLevel = Context.getLangOpts().PICLevel) {
- llvm::PICLevel::Level PL = llvm::PICLevel::Default;
- switch (PLevel) {
- case 0: break;
- case 1: PL = llvm::PICLevel::Small; break;
- case 2: PL = llvm::PICLevel::Large; break;
- default: llvm_unreachable("Invalid PIC Level");
- }
+ assert(PLevel < 3 && "Invalid PIC Level");
+ getModule().setPICLevel(static_cast<llvm::PICLevel::Level>(PLevel));
+ }
- getModule().setPICLevel(PL);
+ if (uint32_t PLevel = Context.getLangOpts().PIELevel) {
+ assert(PLevel < 3 && "Invalid PIE Level");
+ getModule().setPIELevel(static_cast<llvm::PIELevel::Level>(PLevel));
}
SimplifyPersonality();