[PATCH] D103749: [clang][driver] Add -foperator-names
Markus Böck via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 10 08:02:08 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9833b57981c4: [clang][driver] Add -foperator-names (authored by zero9178).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103749/new/
https://reviews.llvm.org/D103749
Files:
clang/include/clang/Driver/Options.td
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/cxx-operator-names.cpp
Index: clang/test/Driver/cxx-operator-names.cpp
===================================================================
--- /dev/null
+++ clang/test/Driver/cxx-operator-names.cpp
@@ -0,0 +1,7 @@
+// RUN: %clang -### -S -foperator-names -fno-operator-names %s 2>&1 | \
+// RUN: FileCheck -check-prefix=CHECK-1 %s
+// CHECK-1: "-fno-operator-names"
+
+// RUN: %clang -### -S -fno-operator-names -foperator-names %s 2>&1 | \
+// RUN: FileCheck -check-prefix=CHECK-2 %s
+// CHECK-2-NOT: "-fno-operator-names"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5654,11 +5654,14 @@
Args.AddLastArg(CmdArgs, options::OPT_ftlsmodel_EQ);
+ if (Args.hasFlag(options::OPT_fno_operator_names,
+ options::OPT_foperator_names, false))
+ CmdArgs.push_back("-fno-operator-names");
+
// Forward -f (flag) options which we can pass directly.
Args.AddLastArg(CmdArgs, options::OPT_femit_all_decls);
Args.AddLastArg(CmdArgs, options::OPT_fheinous_gnu_extensions);
Args.AddLastArg(CmdArgs, options::OPT_fdigraphs, options::OPT_fno_digraphs);
- Args.AddLastArg(CmdArgs, options::OPT_fno_operator_names);
Args.AddLastArg(CmdArgs, options::OPT_femulated_tls,
options::OPT_fno_emulated_tls);
Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -2221,9 +2221,10 @@
def fno_objc_legacy_dispatch : Flag<["-"], "fno-objc-legacy-dispatch">, Group<f_Group>;
def fno_objc_weak : Flag<["-"], "fno-objc-weak">, Group<f_Group>, Flags<[CC1Option]>;
def fno_omit_frame_pointer : Flag<["-"], "fno-omit-frame-pointer">, Group<f_Group>;
-def fno_operator_names : Flag<["-"], "fno-operator-names">, Group<f_Group>,
- HelpText<"Do not treat C++ operator name keywords as synonyms for operators">,
- Flags<[CC1Option]>, MarshallingInfoNegativeFlag<LangOpts<"CXXOperatorNames">, cplusplus.KeyPath>;
+defm operator_names : BoolFOption<"operator-names",
+ LangOpts<"CXXOperatorNames">, Default<cplusplus.KeyPath>,
+ NegFlag<SetFalse, [CC1Option], "Do not treat C++ operator name keywords as synonyms for operators">,
+ PosFlag<SetTrue>>;
def fdiagnostics_absolute_paths : Flag<["-"], "fdiagnostics-absolute-paths">, Group<f_Group>,
Flags<[CC1Option, CoreOption]>, HelpText<"Print absolute paths in diagnostics">,
MarshallingInfoFlag<DiagnosticOpts<"AbsolutePath">>;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103749.351178.patch
Type: text/x-patch
Size: 2599 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210610/523ce92d/attachment-0001.bin>
More information about the cfe-commits
mailing list