File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -122,15 +122,25 @@ const clang::Type *ClangTypeConverter::getFunctionType(
122
122
if (resultClangTy.isNull ())
123
123
return nullptr ;
124
124
125
- SmallVector<clang::QualType, 8 > paramsClangTy;
125
+ SmallVector<clang::FunctionProtoType::ExtParameterInfo, 4 > extParamInfos;
126
+ SmallVector<clang::QualType, 4 > paramsClangTy;
127
+ bool someParamIsConsumed = false ;
126
128
for (auto p : params) {
127
129
auto pc = convert (p.getPlainType ());
128
130
if (pc.isNull ())
129
131
return nullptr ;
132
+ clang::FunctionProtoType::ExtParameterInfo extParamInfo;
133
+ if (p.getParameterFlags ().isOwned ()) {
134
+ someParamIsConsumed = true ;
135
+ extParamInfo = extParamInfo.withIsConsumed (true );
136
+ }
137
+ extParamInfos.push_back (extParamInfo);
130
138
paramsClangTy.push_back (pc);
131
139
}
132
140
133
141
clang::FunctionProtoType::ExtProtoInfo info (clang::CallingConv::CC_C);
142
+ if (someParamIsConsumed)
143
+ info.ExtParameterInfos = extParamInfos.begin ();
134
144
auto fn = ClangASTContext.getFunctionType (resultClangTy, paramsClangTy, info);
135
145
if (fn.isNull ())
136
146
return nullptr ;
You can’t perform that action at this time.
0 commit comments