aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index dd66bf5..9020363 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -942,6 +942,13 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
}
}
+ // PIC defaults to -fno-direct-access-external-data while non-PIC defaults to
+ // -fdirect-access-external-data.
+ Opts.DirectAccessExternalData =
+ Args.hasArg(OPT_fdirect_access_external_data) ||
+ (!Args.hasArg(OPT_fno_direct_access_external_data) &&
+ getLastArgIntValue(Args, OPT_pic_level, 0, Diags) == 0);
+
// If -fuse-ctor-homing is set and limited debug info is already on, then use
// constructor homing.
if (Args.getLastArg(OPT_fuse_ctor_homing))