aboutsummaryrefslogtreecommitdiff
path: root/clang/lib
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2022-04-13 16:58:00 -0700
committerFangrui Song <i@maskray.me>2022-04-13 16:58:00 -0700
commitab8abeaf48abb3addcbdb6136b1975b4afa3b37c (patch)
tree36e96688cf8446c7d63a885890a3e981d23375e5 /clang/lib
parentd3531fc7f0053a7fe68317521ee6491da6e36733 (diff)
downloadllvm-ab8abeaf48abb3addcbdb6136b1975b4afa3b37c.zip
llvm-ab8abeaf48abb3addcbdb6136b1975b4afa3b37c.tar.gz
llvm-ab8abeaf48abb3addcbdb6136b1975b4afa3b37c.tar.bz2
[Driver] Change CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL to affect driver default instead of cc1 default
The current cc1 CLANG_ENABLE_OPAQUE_POINTERS=on default difference is not ideal in that people contribute %clang_cc1 tests may assume the default ON behavior, which will cause failures on systems set to OFF. cc1 option default dependent on CMake options should be used prudently (generally avoided). We prefer to limit target differences to Driver. Change the CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL mechanism introduced in D123122 to use a driver default instead. This is similar to the mechanism used for the -flegacy-pass-manager transition to new PM transition. Reviewed By: #opaque-pointers, rsmith, aeubanks Differential Revision: https://reviews.llvm.org/D123744
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Driver/ToolChains/Clang.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 97b2ded..5cba45d 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -29,6 +29,7 @@
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/ObjCRuntime.h"
#include "clang/Basic/Version.h"
+#include "clang/Config/config.h"
#include "clang/Driver/Action.h"
#include "clang/Driver/Distro.h"
#include "clang/Driver/DriverDiagnostic.h"
@@ -6506,6 +6507,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
false))
CmdArgs.push_back("-fmodules-debuginfo");
+ if (!CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL)
+ CmdArgs.push_back("-no-opaque-pointers");
+
ObjCRuntime Runtime = AddObjCRuntimeArgs(Args, Inputs, CmdArgs, rewriteKind);
RenderObjCOptions(TC, D, RawTriple, Args, Runtime, rewriteKind != RK_None,
Input, CmdArgs);