Skip to content

Commit 85d8635

Browse files
committed
Update signature of createKernelDecl
1 parent fb2951c commit 85d8635

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

libclc/utils/libclc-remangler/LibclcRemangler.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,13 @@ class Remangler {
187187
std::string remangle() {
188188
clang::QualType RetTy;
189189
SmallVector<clang::QualType> TemplateArgTys;
190-
SmallVector<clang::QualType> ArgTys;
190+
SmallVector<clang::QualType> InputArgTys;
191191
bool IsVariadic = false;
192-
nodeToQualTypes(RetTy, TemplateArgTys, ArgTys, IsVariadic);
193-
auto *FD = createKernelDecl(RetTy, TemplateArgTys, ArgTys, IsVariadic);
192+
nodeToQualTypes(RetTy, TemplateArgTys, InputArgTys, IsVariadic);
193+
auto *FD = createKernelDecl(RetTy, TemplateArgTys, InputArgTys, IsVariadic);
194194
assert(MangleContext->shouldMangleDeclName(FD) &&
195195
"It should always be possible to mangle libclc func.");
196196

197-
198197
SmallString<256> Buffer;
199198
raw_svector_ostream Out(Buffer);
200199
MangleContext->mangleName(FD, Out);
@@ -229,10 +228,11 @@ class Remangler {
229228

230229
private:
231230
// Construct FunctionDecl from return, argument and template types.
232-
FunctionDecl *createKernelDecl(clang::QualType &RetTy,
233-
SmallVector<clang::QualType> &TemplateArgTys,
234-
SmallVector<clang::QualType> &ArgTys,
235-
bool IsVariadic) {
231+
FunctionDecl *createKernelDecl(
232+
clang::QualType RetTy, const SmallVector<clang::QualType> &TemplateArgTys,
233+
const SmallVector<clang::QualType> &InputArgTys, bool IsVariadic) {
234+
// Copy in InputArgTys as this function can mutate them.
235+
auto ArgTys{InputArgTys};
236236
// Create this with a void ret no args prototype, will be fixed up after
237237
// we've seen all the params.
238238
FunctionProtoType::ExtProtoInfo Info(CC_OpenCLKernel);

0 commit comments

Comments
 (0)