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.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp
index 9ac1edb..1416cdc 100644
--- a/llvm/lib/IR/Module.cpp
+++ b/llvm/lib/IR/Module.cpp
@@ -600,6 +600,13 @@ void Module::setSemanticInterposition(bool SI) {
addModuleFlag(ModFlagBehavior::Error, "SemanticInterposition", SI);
}
+bool Module::noSemanticInterposition() const {
+ // Conservatively require an explicit zero value for now.
+ Metadata *MF = getModuleFlag("SemanticInterposition");
+ auto *Val = cast_or_null<ConstantAsMetadata>(MF);
+ return Val && cast<ConstantInt>(Val->getValue())->getZExtValue() == 0;
+}
+
void Module::setOwnedMemoryBuffer(std::unique_ptr<MemoryBuffer> MB) {
OwnedMemoryBuffer = std::move(MB);
}