Add PIC-level support to Clang.
Summary: This distinguishes between -fpic and -fPIC now, with the additions in LLVM for PIC level support. Test Plan: No regressions Reviewers: echristo, rafael Reviewed By: rafael Subscribers: rnk, emaste, llvm-commits Differential Revision: http://reviews.llvm.org/D5400 llvm-svn: 222227
This commit is contained in:
@@ -391,6 +391,18 @@ void CodeGenModule::Release() {
|
||||
getModule().addModuleFlag(llvm::Module::Error, "min_enum_size", EnumWidth);
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
getModule().setPICLevel(PL);
|
||||
}
|
||||
|
||||
SimplifyPersonality();
|
||||
|
||||
if (getCodeGenOpts().EmitDeclMetadata)
|
||||
|
||||
Reference in New Issue
Block a user