-
Notifications
You must be signed in to change notification settings - Fork 15k
[Driver] Move CommonArgs to a location visible by the Frontend Drivers #142800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
918b853
28c4762
aef6882
db4482d
a6535b1
ef34cdf
121c41a
8b69907
2691029
d33a5f9
ca89f42
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ | |
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "CommonArgs.h" | ||
| #include "clang/Driver/CommonArgs.h" | ||
| #include "Arch/AArch64.h" | ||
| #include "Arch/ARM.h" | ||
| #include "Arch/CSKY.h" | ||
|
|
@@ -3167,3 +3167,30 @@ void tools::handleInterchangeLoopsArgs(const ArgList &Args, | |
| options::OPT_fno_loop_interchange, EnableInterchange)) | ||
| CmdArgs.push_back("-floop-interchange"); | ||
| } | ||
|
|
||
| void tools::ParseMPreferVectorWidthOption(clang::DiagnosticsEngine &Diags, | ||
| const llvm::opt::ArgList &Args, | ||
| ArgStringList &CmdArgs, | ||
| bool isCompilerDriver) { | ||
| // If this was invoked by the Compiler Driver, we pass through the option | ||
| // as-is. Otherwise, if this is the Frontend Driver, we want just the value. | ||
| StringRef Out = (isCompilerDriver) ? "-mprefer-vector-width=" : ""; | ||
mcinally marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Arg *A = Args.getLastArg(clang::driver::options::OPT_mprefer_vector_width_EQ); | ||
| if (!A) | ||
| return; | ||
|
|
||
| StringRef Value = A->getValue(); | ||
| unsigned Width; | ||
|
||
|
|
||
| // Only "none" and Integer values are accepted by | ||
| // -mprefer-vector-width=<value>. | ||
| if (Value != "none" && Value.getAsInteger(10, Width)) { | ||
| Diags.Report(clang::diag::err_drv_invalid_value) | ||
| << A->getOption().getName() << Value; | ||
| return; | ||
| } | ||
|
|
||
| CmdArgs.push_back(Args.MakeArgString(Out + Value)); | ||
|
||
| return; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the handling of the mprefer-vector-width option intended to be part of this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was, for illustrative purposes. I have no problem removing it though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Let's leave it in for now. Since this is reorganizing the code in clang, we should wait for the clang developers to weigh in on this.