forked from OSchip/llvm-project
TypePrinter:printTo remove redundant parameter (IsPack/SkipBrackets)
This commit is contained in:
parent
c0b70def21
commit
32b280809f
|
@ -1998,10 +1998,9 @@ static bool isSubstitutedDefaultArgument(ASTContext &Ctx, TemplateArgument Arg,
|
|||
}
|
||||
|
||||
template <typename TA>
|
||||
static void printTo(raw_ostream &OS, ArrayRef<TA> Args,
|
||||
const PrintingPolicy &Policy, bool SkipBrackets,
|
||||
const TemplateParameterList *TPL, bool IsPack,
|
||||
unsigned ParmIndex) {
|
||||
static void
|
||||
printTo(raw_ostream &OS, ArrayRef<TA> Args, const PrintingPolicy &Policy,
|
||||
const TemplateParameterList *TPL, bool IsPack, unsigned ParmIndex) {
|
||||
// Drop trailing template arguments that match default arguments.
|
||||
if (TPL && Policy.SuppressDefaultTemplateArgs &&
|
||||
!Policy.PrintCanonicalTypes && !Args.empty() && !IsPack &&
|
||||
|
@ -2018,7 +2017,7 @@ static void printTo(raw_ostream &OS, ArrayRef<TA> Args,
|
|||
}
|
||||
|
||||
const char *Comma = Policy.MSVCFormatting ? "," : ", ";
|
||||
if (!SkipBrackets)
|
||||
if (!IsPack)
|
||||
OS << '<';
|
||||
|
||||
bool NeedSpace = false;
|
||||
|
@ -2031,7 +2030,7 @@ static void printTo(raw_ostream &OS, ArrayRef<TA> Args,
|
|||
if (Argument.getKind() == TemplateArgument::Pack) {
|
||||
if (Argument.pack_size() && !FirstArg)
|
||||
OS << Comma;
|
||||
printTo(ArgOS, Argument.getPackAsArray(), Policy, true, TPL,
|
||||
printTo(ArgOS, Argument.getPackAsArray(), Policy, TPL,
|
||||
/*IsPack*/ true, ParmIndex);
|
||||
} else {
|
||||
if (!FirstArg)
|
||||
|
@ -2065,7 +2064,7 @@ static void printTo(raw_ostream &OS, ArrayRef<TA> Args,
|
|||
if (NeedSpace)
|
||||
OS << ' ';
|
||||
|
||||
if (!SkipBrackets)
|
||||
if (!IsPack)
|
||||
OS << '>';
|
||||
}
|
||||
|
||||
|
@ -2080,14 +2079,14 @@ void clang::printTemplateArgumentList(raw_ostream &OS,
|
|||
ArrayRef<TemplateArgument> Args,
|
||||
const PrintingPolicy &Policy,
|
||||
const TemplateParameterList *TPL) {
|
||||
printTo(OS, Args, Policy, false, TPL, /*isPack*/ false, /*parmIndex*/ 0);
|
||||
printTo(OS, Args, Policy, TPL, /*isPack*/ false, /*parmIndex*/ 0);
|
||||
}
|
||||
|
||||
void clang::printTemplateArgumentList(raw_ostream &OS,
|
||||
ArrayRef<TemplateArgumentLoc> Args,
|
||||
const PrintingPolicy &Policy,
|
||||
const TemplateParameterList *TPL) {
|
||||
printTo(OS, Args, Policy, false, TPL, /*isPack*/ false, /*parmIndex*/ 0);
|
||||
printTo(OS, Args, Policy, TPL, /*isPack*/ false, /*parmIndex*/ 0);
|
||||
}
|
||||
|
||||
std::string Qualifiers::getAsString() const {
|
||||
|
|
Loading…
Reference in New Issue