diff options
author | Justin Hibbits <jrh29@alumni.cwru.edu> | 2014-11-18 06:17:20 +0000 |
---|---|---|
committer | Justin Hibbits <jrh29@alumni.cwru.edu> | 2014-11-18 06:17:20 +0000 |
commit | 90ca05e5e58f90bbdec0c2b403ce9f61a1cfabbd (patch) | |
tree | 6af6000e2eb851fb73cf5d8ec641da48d6f1c651 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | ae3e40dd6143223786b53f4ceca5210e7ac2874e (diff) | |
download | bcm5719-llvm-90ca05e5e58f90bbdec0c2b403ce9f61a1cfabbd.tar.gz bcm5719-llvm-90ca05e5e58f90bbdec0c2b403ce9f61a1cfabbd.zip |
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index fe565523fd9..a68f3694577 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -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) |