forked from OSchip/llvm-project
Fix -Wlarge-by-value-copy option handling in the driver.
CC1 supports only the joined format. llvm-svn: 156161
This commit is contained in:
parent
74a3868dbb
commit
73d801cd8a
|
@ -2018,11 +2018,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
|
||||
if (Arg *A = Args.getLastArg(options::OPT_Wlarge_by_value_copy_EQ,
|
||||
options::OPT_Wlarge_by_value_copy_def)) {
|
||||
CmdArgs.push_back("-Wlarge-by-value-copy");
|
||||
if (A->getNumValues())
|
||||
CmdArgs.push_back(A->getValue(Args));
|
||||
else
|
||||
CmdArgs.push_back("64"); // default value for -Wlarge-by-value-copy.
|
||||
if (A->getNumValues()) {
|
||||
StringRef bytes = A->getValue(Args);
|
||||
CmdArgs.push_back(Args.MakeArgString("-Wlarge-by-value-copy=" + bytes));
|
||||
} else
|
||||
CmdArgs.push_back("-Wlarge-by-value-copy=64"); // default value
|
||||
}
|
||||
|
||||
if (Args.hasArg(options::OPT__relocatable_pch))
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
// RUN: %clang -### -Wlarge-by-value-copy %s 2>&1 | FileCheck -check-prefix=LARGE_VALUE_COPY_DEFAULT %s
|
||||
// LARGE_VALUE_COPY_DEFAULT: -Wlarge-by-value-copy=64
|
||||
// RUN: %clang -### -Wlarge-by-value-copy=128 %s 2>&1 | FileCheck -check-prefix=LARGE_VALUE_COPY_JOINED %s
|
||||
// LARGE_VALUE_COPY_JOINED: -Wlarge-by-value-copy=128
|
Loading…
Reference in New Issue