aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorserge-sans-paille <sguelton@redhat.com>2020-01-16 11:56:41 +0100
committerserge-sans-paille <sguelton@redhat.com>2020-01-31 14:02:33 +0100
commitfd09f12f32f57564d619a28b8826d33ade47b12e (patch)
treedb57ca81252bf810e3b6dd0af6bf5789ac1c7a9a /clang/lib/Frontend/CompilerInvocation.cpp
parent24f0b6b6d8e798f76621af9ea6ccda0568d28703 (diff)
downloadllvm-fd09f12f32f57564d619a28b8826d33ade47b12e.zip
llvm-fd09f12f32f57564d619a28b8826d33ade47b12e.tar.gz
llvm-fd09f12f32f57564d619a28b8826d33ade47b12e.tar.bz2
Implement -fsemantic-interposition
First attempt at implementing -fsemantic-interposition. Rely on GlobalValue::isInterposable that already captures most of the expected behavior. Rely on a ModuleFlag to state whether we should respect SemanticInterposition or not. The default remains no. So this should be a no-op if -fsemantic-interposition isn't used, and if it is, isInterposable being already used in most optimisation, they should honor it properly. Note that it only impacts architecture compiled with -fPIC and no pie. Differential Revision: https://reviews.llvm.org/D72829
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index a8dfd8a..335f8cd 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -3036,6 +3036,10 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
Opts.setDefaultCallingConv(DefaultCC);
}
+ // -fsemantic-interposition
+ Opts.SemanticInterposition =
+ Args.hasArg(OPT_fsemantic_interposition) && Opts.PICLevel && !Opts.PIE;
+
// -mrtd option
if (Arg *A = Args.getLastArg(OPT_mrtd)) {
if (Opts.getDefaultCallingConv() != LangOptions::DCC_None)