forked from OSchip/llvm-project
Differential Revision: http://reviews.llvm.org/D19687
Set module flag PIELevel. Simplify code that sets PICLevel flag. llvm-svn: 267948
This commit is contained in:
parent
1f4231f8cf
commit
70e70e6eb9
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue