aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Module.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
-rw-r--r--llvm/lib/IR/Module.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp
index 5cd74d5..b51ea45 100644
--- a/llvm/lib/IR/Module.cpp
+++ b/llvm/lib/IR/Module.cpp
@@ -714,6 +714,18 @@ void Module::setStackProtectorGuardReg(StringRef Reg) {
addModuleFlag(ModFlagBehavior::Error, "stack-protector-guard-reg", ID);
}
+StringRef Module::getStackProtectorGuardSymbol() const {
+ Metadata *MD = getModuleFlag("stack-protector-guard-symbol");
+ if (auto *MDS = dyn_cast_or_null<MDString>(MD))
+ return MDS->getString();
+ return {};
+}
+
+void Module::setStackProtectorGuardSymbol(StringRef Symbol) {
+ MDString *ID = MDString::get(getContext(), Symbol);
+ addModuleFlag(ModFlagBehavior::Error, "stack-protector-guard-symbol", ID);
+}
+
int Module::getStackProtectorGuardOffset() const {
Metadata *MD = getModuleFlag("stack-protector-guard-offset");
if (auto *CI = mdconst::dyn_extract_or_null<ConstantInt>(MD))