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:
Justin Hibbits
2014-11-18 06:17:20 +00:00
parent ae3e40dd61
commit 90ca05e5e5
2 changed files with 19 additions and 0 deletions

View File

@@ -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)