summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaTemplateDeduction.cpp
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-01-20 20:26:09 +0000
committerAlp Toker <alp@nuanti.com>2014-01-20 20:26:09 +0000
commitc50bf3d128af641f9249f7d1dc37e42b9fd31b81 (patch)
tree82cb9d4ca1cc715bbf62f39de4b4e27d8b705beb /lib/Sema/SemaTemplateDeduction.cpp
parent55c1c8ac7914747a84329aab72200822b8e8b5c2 (diff)
Rename FunctionProtoType accessors from 'arguments' to 'parameters'
Fix a perennial source of confusion in the clang type system: Declarations and function prototypes have parameters to which arguments are supplied, so calling these 'arguments' was a stretch even in C mode, let alone C++ where default arguments, templates and overloading make the distinction important to get right. Readability win across the board, especially in the casting, ADL and overloading implementations which make a lot more sense at a glance now. Will keep an eye on the builders and update dependent projects shortly. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199686 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateDeduction.cpp')
-rw-r--r--lib/Sema/SemaTemplateDeduction.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp
index 8e1122aa43..256bb7c395 100644
--- a/lib/Sema/SemaTemplateDeduction.cpp
+++ b/lib/Sema/SemaTemplateDeduction.cpp
@@ -1382,12 +1382,11 @@ DeduceTemplateArgumentsByTypeMatch(Sema &S,
Info, Deduced, 0))
return Result;
- return DeduceTemplateArguments(S, TemplateParams,
- FunctionProtoParam->arg_type_begin(),
- FunctionProtoParam->getNumArgs(),
- FunctionProtoArg->arg_type_begin(),
- FunctionProtoArg->getNumArgs(),
- Info, Deduced, SubTDF);
+ return DeduceTemplateArguments(
+ S, TemplateParams, FunctionProtoParam->param_type_begin(),
+ FunctionProtoParam->getNumParams(),
+ FunctionProtoArg->param_type_begin(),
+ FunctionProtoArg->getNumParams(), Info, Deduced, SubTDF);
}
case Type::InjectedClassName: {
@@ -3751,7 +3750,7 @@ SpecializeCorrespondingLambdaCallOperatorAndInvoker(
FunctionProtoType::ExtProtoInfo EPI = InvokerFPT->getExtProtoInfo();
EPI.TypeQuals = 0;
InvokerSpecialized->setType(S.Context.getFunctionType(
- InvokerFPT->getResultType(), InvokerFPT->getArgTypes(),EPI));
+ InvokerFPT->getResultType(), InvokerFPT->getParamTypes(), EPI));
return Sema::TDK_Success;
}
/// \brief Deduce template arguments for a templated conversion
@@ -4231,10 +4230,10 @@ static bool isAtLeastAsSpecializedAs(Sema &S,
++Skip1;
}
- Args1.insert(Args1.end(),
- Proto1->arg_type_begin() + Skip1, Proto1->arg_type_end());
- Args2.insert(Args2.end(),
- Proto2->arg_type_begin() + Skip2, Proto2->arg_type_end());
+ Args1.insert(Args1.end(), Proto1->param_type_begin() + Skip1,
+ Proto1->param_type_end());
+ Args2.insert(Args2.end(), Proto2->param_type_begin() + Skip2,
+ Proto2->param_type_end());
// C++ [temp.func.order]p5:
// The presence of unused ellipsis and default arguments has no effect on
@@ -4883,8 +4882,8 @@ MarkUsedTemplateParameters(ASTContext &Ctx, QualType T,
const FunctionProtoType *Proto = cast<FunctionProtoType>(T);
MarkUsedTemplateParameters(Ctx, Proto->getResultType(), OnlyDeduced,
Depth, Used);
- for (unsigned I = 0, N = Proto->getNumArgs(); I != N; ++I)
- MarkUsedTemplateParameters(Ctx, Proto->getArgType(I), OnlyDeduced,
+ for (unsigned I = 0, N = Proto->getNumParams(); I != N; ++I)
+ MarkUsedTemplateParameters(Ctx, Proto->getParamType(I), OnlyDeduced,
Depth, Used);
break;
}