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 a1f8cd0..73354a8 100644
--- a/llvm/lib/IR/Module.cpp
+++ b/llvm/lib/IR/Module.cpp
@@ -672,6 +672,18 @@ void Module::setRtLibUseGOT() {
addModuleFlag(ModFlagBehavior::Max, "RtLibUseGOT", 1);
}
+bool Module::getDirectAccessExternalData() const {
+ auto *Val = cast_or_null<ConstantAsMetadata>(
+ getModuleFlag("direct-access-external-data"));
+ if (Val)
+ return cast<ConstantInt>(Val->getValue())->getZExtValue() > 0;
+ return getPICLevel() == PICLevel::NotPIC;
+}
+
+void Module::setDirectAccessExternalData(bool Value) {
+ addModuleFlag(ModFlagBehavior::Max, "direct-access-external-data", Value);
+}
+
UWTableKind Module::getUwtable() const {
if (auto *Val = cast_or_null<ConstantAsMetadata>(getModuleFlag("uwtable")))
return UWTableKind(cast<ConstantInt>(Val->getValue())->getZExtValue());