Skip to content

Commit 0383adb

Browse files
committed
[SYCL] Fix for detection of free function calls.
Signed-off-by: rdeodhar <[email protected]>
1 parent 237675b commit 0383adb

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2705,23 +2705,18 @@ class SyclKernelIntHeaderCreator : public SyclKernelFieldHandler {
27052705

27062706
// Sets a flag if the kernel is a parallel_for that calls the
27072707
// free function API "this_item".
2708-
void setThisItemIsCalled(const CXXRecordDecl *KernelObj,
2709-
FunctionDecl *KernelFunc) {
2708+
void setThisItemIsCalled(FunctionDecl *KernelFunc) {
27102709
if (getKernelInvocationKind(KernelFunc) != InvokeParallelFor)
27112710
return;
27122711

2713-
const CXXMethodDecl *WGLambdaFn = getOperatorParens(KernelObj);
2714-
if (!WGLambdaFn)
2715-
return;
2716-
27172712
// The call graph for this translation unit.
27182713
CallGraph SYCLCG;
27192714
SYCLCG.addToCallGraph(SemaRef.getASTContext().getTranslationUnitDecl());
27202715
using ChildParentPair =
27212716
std::pair<const FunctionDecl *, const FunctionDecl *>;
27222717
llvm::SmallPtrSet<const FunctionDecl *, 16> Visited;
27232718
llvm::SmallVector<ChildParentPair, 16> WorkList;
2724-
WorkList.push_back({WGLambdaFn, nullptr});
2719+
WorkList.push_back({KernelFunc, nullptr});
27252720

27262721
while (!WorkList.empty()) {
27272722
const FunctionDecl *FD = WorkList.back().first;
@@ -2759,7 +2754,7 @@ class SyclKernelIntHeaderCreator : public SyclKernelFieldHandler {
27592754
bool IsSIMDKernel = isESIMDKernelType(KernelObj);
27602755
Header.startKernel(Name, NameType, StableName, KernelObj->getLocation(),
27612756
IsSIMDKernel);
2762-
setThisItemIsCalled(KernelObj, KernelFunc);
2757+
setThisItemIsCalled(KernelFunc);
27632758
}
27642759

27652760
bool handleSyclAccessorType(const CXXRecordDecl *RD,

0 commit comments

Comments
 (0)