aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Module.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2020-12-31 13:59:45 -0800
committerFangrui Song <i@maskray.me>2020-12-31 13:59:45 -0800
commitd1fd72343c6ff58a3b66bc0df56fed9ac21e4056 (patch)
tree1c6f42eeb37d5aac8f00f8cf15b1c6c348a7b4bd /llvm/lib/IR/Module.cpp
parent219d00e0d90941d3e54fc711ea1e7b5e4b5b4335 (diff)
downloadllvm-d1fd72343c6ff58a3b66bc0df56fed9ac21e4056.zip
llvm-d1fd72343c6ff58a3b66bc0df56fed9ac21e4056.tar.gz
llvm-d1fd72343c6ff58a3b66bc0df56fed9ac21e4056.tar.bz2
Refactor how -fno-semantic-interposition sets dso_local on default visibility external linkage definitions
The idea is that the CC1 default for ELF should set dso_local on default visibility external linkage definitions in the default -mrelocation-model pic mode (-fpic/-fPIC) to match COFF/Mach-O and make output IR similar. The refactoring is made available by 2820a2ca3a0e69c3f301845420e0067ffff2251b. Currently only x86 supports local aliases. We move the decision to the driver. There are three CC1 states: * -fsemantic-interposition: make some linkages interposable and make default visibility external linkage definitions dso_preemptable. * (default): selected if the target supports .Lfoo$local: make default visibility external linkage definitions dso_local * -fhalf-no-semantic-interposition: if neither option is set or the target does not support .Lfoo$local: like -fno-semantic-interposition but local aliases are not used. So references can be interposed if not optimized out. Add -fhalf-no-semantic-interposition to a few tests using the half-based semantic interposition behavior.
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
-rw-r--r--llvm/lib/IR/Module.cpp7
1 files changed, 0 insertions, 7 deletions
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp
index b6fde57..b4f10e2 100644
--- a/llvm/lib/IR/Module.cpp
+++ b/llvm/lib/IR/Module.cpp
@@ -601,13 +601,6 @@ 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);
}