@@ -112,37 +112,6 @@ static int getTotalArraySize(ASTContext &AST, const clang::Type *Ty) {
112
112
return AST.getConstantArrayElementCount (cast<ConstantArrayType>(Ty));
113
113
}
114
114
115
- // Find constructor decl for a specific resource record type and binding
116
- // (implicit vs. explicit). The constructor has 5 parameters.
117
- // For explicit binding the signature is:
118
- // void(unsigned, unsigned, int, unsigned, const char *).
119
- // For implicit binding the signature is:
120
- // void(unsigned, int, unsigned, unsigned, const char *).
121
- static CXXConstructorDecl *findResourceConstructorDecl (ASTContext &AST,
122
- QualType ResTy,
123
- bool ExplicitBinding) {
124
- std::array<QualType, 5 > ExpParmTypes = {
125
- AST.UnsignedIntTy , AST.UnsignedIntTy , AST.UnsignedIntTy ,
126
- AST.UnsignedIntTy , AST.getPointerType (AST.CharTy .withConst ())};
127
- ExpParmTypes[ExplicitBinding ? 2 : 1 ] = AST.IntTy ;
128
-
129
- CXXRecordDecl *ResDecl = ResTy->getAsCXXRecordDecl ();
130
- for (auto *Ctor : ResDecl->ctors ()) {
131
- if (Ctor->getNumParams () != ExpParmTypes.size ())
132
- continue ;
133
- auto *ParmIt = Ctor->param_begin ();
134
- auto ExpTyIt = ExpParmTypes.begin ();
135
- for (; ParmIt != Ctor->param_end () && ExpTyIt != ExpParmTypes.end ();
136
- ++ParmIt, ++ExpTyIt) {
137
- if ((*ParmIt)->getType () != *ExpTyIt)
138
- break ;
139
- }
140
- if (ParmIt == Ctor->param_end ())
141
- return Ctor;
142
- }
143
- llvm_unreachable (" did not find constructor for resource class" );
144
- }
145
-
146
115
static Value *buildNameForResource (llvm::StringRef BaseName,
147
116
CodeGenModule &CGM) {
148
117
llvm::SmallString<64 > GlobalName = {BaseName, " .str" };
0 commit comments