diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2014-12-25 18:22:22 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2014-12-25 18:22:22 +0000 |
commit | 404df5bbd56fc05c3ba477243b27e87642c1d5e7 (patch) | |
tree | d99c35034a4055aa5391828a57312dcf1d90ee00 /contrib/llvm/lib/IR/Module.cpp | |
parent | 42ac84b368aff9b219e058ef9c5c798740e8bcd7 (diff) |
Notes
Diffstat (limited to 'contrib/llvm/lib/IR/Module.cpp')
-rw-r--r-- | contrib/llvm/lib/IR/Module.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/contrib/llvm/lib/IR/Module.cpp b/contrib/llvm/lib/IR/Module.cpp index f1b1f9a2acc8..58584bd19a1f 100644 --- a/contrib/llvm/lib/IR/Module.cpp +++ b/contrib/llvm/lib/IR/Module.cpp @@ -461,3 +461,16 @@ Comdat *Module::getOrInsertComdat(StringRef Name) { Entry.second.Name = &Entry; return &Entry.second; } + +PICLevel::Level Module::getPICLevel() const { + Value *Val = getModuleFlag("PIC Level"); + + if (Val == NULL) + return PICLevel::Default; + + return static_cast<PICLevel::Level>(cast<ConstantInt>(Val)->getZExtValue()); +} + +void Module::setPICLevel(PICLevel::Level PL) { + addModuleFlag(ModFlagBehavior::Error, "PIC Level", PL); +} |