[clang] [flang] [llvm] [Driver] Move CommonArgs to a location visible by the Frontend Drivers (PR #142800)
Eugene Epshteyn via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 6 14:11:02 PDT 2025
================
@@ -3167,3 +3167,25 @@ void tools::handleInterchangeLoopsArgs(const ArgList &Args,
options::OPT_fno_loop_interchange, EnableInterchange))
CmdArgs.push_back("-floop-interchange");
}
+
+// Parse -mprefer-vector-width=. Return the Value string if well-formed.
+// Otherwise, return an empty string and issue a diagnosic message if needed.
+StringRef tools::ParseMPreferVectorWidthOption(clang::DiagnosticsEngine &Diags,
+ const llvm::opt::ArgList &Args) {
+ Arg *A = Args.getLastArg(clang::driver::options::OPT_mprefer_vector_width_EQ);
+ if (!A)
+ return "";
+
+ StringRef Value = A->getValue();
+ unsigned Width LLVM_ATTRIBUTE_UNINITIALIZED;
----------------
eugeneepshteyn wrote:
This is fine, but FWIW, there's C++ `[[maybe_unused]]` that could possibly work here: https://en.cppreference.com/w/cpp/language/attributes/maybe_unused
https://github.com/llvm/llvm-project/pull/142800
More information about the llvm-commits
mailing list