r325171 - Clean up -fdiscard-value-name handling

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 14 12:56:52 PST 2018


Author: ericwf
Date: Wed Feb 14 12:56:52 2018
New Revision: 325171

URL: http://llvm.org/viewvc/llvm-project?rev=325171&view=rev
Log:
Clean up -fdiscard-value-name handling

Modified:
    cfe/trunk/lib/Driver/ToolChains/Clang.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=325171&r1=325170&r2=325171&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Wed Feb 14 12:56:52 2018
@@ -3281,11 +3281,8 @@ void Clang::ConstructJob(Compilation &C,
     CmdArgs.push_back("-disable-llvm-verifier");
 
   // Discard value names in assert builds unless otherwise specified.
-  if (const Arg *A = Args.getLastArg(options::OPT_fdiscard_value_names,
-                                     options::OPT_fno_discard_value_names)) {
-    if (A->getOption().matches(options::OPT_fdiscard_value_names))
-      CmdArgs.push_back("-discard-value-names");
-  } else if (!IsAssertBuild)
+  if (Args.hasFlag(options::OPT_fdiscard_value_names,
+                   options::OPT_fno_discard_value_names, !IsAssertBuild))
     CmdArgs.push_back("-discard-value-names");
 
   // Set the main file name, so that debug info works even with




More information about the cfe-commits mailing list