@@ -866,8 +866,7 @@ TEST_F(TestTypeSystemClang, TestFunctionTemplateConstruction) {
866
866
clang::TranslationUnitDecl *TU = m_ast->GetTranslationUnitDecl ();
867
867
868
868
// Prepare the declarations/types we need for the template.
869
- CompilerType clang_type =
870
- m_ast->CreateFunctionType (int_type, nullptr , 0U , false , 0U );
869
+ CompilerType clang_type = m_ast->CreateFunctionType (int_type, {}, false , 0U );
871
870
FunctionDecl *func = m_ast->CreateFunctionDeclaration (
872
871
TU, OptionalClangModuleID (), " foo" , clang_type, StorageClass::SC_None,
873
872
false );
@@ -895,8 +894,7 @@ TEST_F(TestTypeSystemClang, TestFunctionTemplateInRecordConstruction) {
895
894
clang::TagDecl *record = ClangUtil::GetAsTagDecl (record_type);
896
895
897
896
// Prepare the declarations/types we need for the template.
898
- CompilerType clang_type =
899
- m_ast->CreateFunctionType (int_type, nullptr , 0U , false , 0U );
897
+ CompilerType clang_type = m_ast->CreateFunctionType (int_type, {}, false , 0U );
900
898
// We create the FunctionDecl for the template in the TU DeclContext because:
901
899
// 1. FunctionDecls can't be in a Record (only CXXMethodDecls can).
902
900
// 2. It is mirroring the behavior of DWARFASTParserClang::ParseSubroutine.
@@ -930,10 +928,9 @@ TEST_F(TestTypeSystemClang, TestDeletingImplicitCopyCstrDueToMoveCStr) {
930
928
931
929
// Create a move constructor that will delete the implicit copy constructor.
932
930
CompilerType return_type = m_ast->GetBasicType (lldb::eBasicTypeVoid);
933
- CompilerType param_type = t.GetRValueReferenceType ();
934
- CompilerType function_type =
935
- m_ast->CreateFunctionType (return_type, ¶m_type, /* num_params*/ 1 ,
936
- /* variadic=*/ false , /* quals*/ 0U );
931
+ std::array<CompilerType, 1 > args{t.GetRValueReferenceType ()};
932
+ CompilerType function_type = m_ast->CreateFunctionType (
933
+ return_type, args, /* variadic=*/ false , /* quals*/ 0U );
937
934
bool is_virtual = false ;
938
935
bool is_static = false ;
939
936
bool is_inline = false ;
@@ -974,20 +971,20 @@ TEST_F(TestTypeSystemClang, TestNotDeletingUserCopyCstrDueToMoveCStr) {
974
971
bool is_artificial = false ;
975
972
// Create a move constructor.
976
973
{
977
- CompilerType param_type = t.GetRValueReferenceType ();
978
- CompilerType function_type =
979
- m_ast->CreateFunctionType (return_type, ¶m_type, /* num_params*/ 1 ,
980
- /* variadic=*/ false , /* quals*/ 0U );
974
+ std::array<CompilerType, 1 > args{t.GetRValueReferenceType ()};
975
+ CompilerType function_type = m_ast->CreateFunctionType (
976
+ return_type, args, /* variadic=*/ false , /* quals*/ 0U );
981
977
m_ast->AddMethodToCXXRecordType (
982
978
t.GetOpaqueQualType (), class_name, nullptr , function_type,
983
979
lldb::AccessType::eAccessPublic, is_virtual, is_static, is_inline,
984
980
is_explicit, is_attr_used, is_artificial);
985
981
}
986
982
// Create a copy constructor.
987
983
{
988
- CompilerType param_type = t.GetLValueReferenceType ().AddConstModifier ();
984
+ std::array<CompilerType, 1 > args{
985
+ t.GetLValueReferenceType ().AddConstModifier ()};
989
986
CompilerType function_type =
990
- m_ast->CreateFunctionType (return_type, ¶m_type, /* num_params */ 1 ,
987
+ m_ast->CreateFunctionType (return_type, args ,
991
988
/* variadic=*/ false , /* quals*/ 0U );
992
989
m_ast->AddMethodToCXXRecordType (
993
990
t.GetOpaqueQualType (), class_name, nullptr , function_type,
@@ -1012,10 +1009,9 @@ TEST_F(TestTypeSystemClang, AddMethodToObjCObjectType) {
1012
1009
1013
1010
// Add a method to the interface.
1014
1011
std::vector<CompilerType> args;
1015
- CompilerType func_type =
1016
- m_ast->CreateFunctionType (m_ast->GetBasicType (lldb::eBasicTypeInt),
1017
- args.data (), args.size (), /* variadic*/ false ,
1018
- /* quals*/ 0 , clang::CallingConv::CC_C);
1012
+ CompilerType func_type = m_ast->CreateFunctionType (
1013
+ m_ast->GetBasicType (lldb::eBasicTypeInt), args, /* variadic*/ false ,
1014
+ /* quals*/ 0 , clang::CallingConv::CC_C);
1019
1015
bool variadic = false ;
1020
1016
bool artificial = false ;
1021
1017
bool objc_direct = false ;
@@ -1098,9 +1094,9 @@ TEST_F(TestTypeSystemClang, AddMethodToCXXRecordType_ParmVarDecls) {
1098
1094
llvm::SmallVector<CompilerType> param_types{
1099
1095
m_ast->GetBasicType (lldb::eBasicTypeInt),
1100
1096
m_ast->GetBasicType (lldb::eBasicTypeShort)};
1101
- CompilerType function_type = m_ast-> CreateFunctionType (
1102
- return_type, param_types. data (), /* num_params */ param_types. size () ,
1103
- /* variadic=*/ false , /* quals*/ 0U );
1097
+ CompilerType function_type =
1098
+ m_ast-> CreateFunctionType ( return_type, param_types,
1099
+ /* variadic=*/ false , /* quals*/ 0U );
1104
1100
m_ast->AddMethodToCXXRecordType (
1105
1101
t.GetOpaqueQualType (), " myFunc" , nullptr , function_type,
1106
1102
lldb::AccessType::eAccessPublic, is_virtual, is_static, is_inline,
0 commit comments