Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL][NFC] Rename KernelLambda to KernelObj #2031

Merged
merged 1 commit into from
Jul 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions clang/lib/Sema/SemaSYCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,7 @@ class SyclKernelBodyCreator
class SyclKernelIntHeaderCreator
: public SyclKernelFieldHandler<SyclKernelIntHeaderCreator> {
SYCLIntegrationHeader &Header;
const CXXRecordDecl *KernelLambda;
const CXXRecordDecl *KernelObj;
// Necessary to figure out the offset of the base class.
const CXXRecordDecl *CurStruct = nullptr;
int64_t CurOffset = 0;
Expand All @@ -1497,11 +1497,10 @@ class SyclKernelIntHeaderCreator

public:
SyclKernelIntHeaderCreator(Sema &S, SYCLIntegrationHeader &H,
const CXXRecordDecl *KernelLambda,
QualType NameType, StringRef Name,
StringRef StableName)
: SyclKernelFieldHandler(S), Header(H), KernelLambda(KernelLambda) {
Header.startKernel(Name, NameType, StableName, KernelLambda->getLocation());
const CXXRecordDecl *KernelObj, QualType NameType,
StringRef Name, StringRef StableName)
: SyclKernelFieldHandler(S), Header(H), KernelObj(KernelObj) {
Header.startKernel(Name, NameType, StableName, KernelObj->getLocation());
}

bool handleSyclAccessorType(const CXXBaseSpecifier &BC,
Expand Down Expand Up @@ -1643,8 +1642,8 @@ class SyclKernelIntHeaderCreator
void Sema::ConstructOpenCLKernel(FunctionDecl *KernelCallerFunc,
MangleContext &MC) {
// The first argument to the KernelCallerFunc is the lambda object.
CXXRecordDecl *KernelLambda = getKernelObjectType(KernelCallerFunc);
assert(KernelLambda && "invalid kernel caller");
CXXRecordDecl *KernelObj = getKernelObjectType(KernelCallerFunc);
assert(KernelObj && "invalid kernel caller");

// Calculate both names, since Integration headers need both.
std::string CalculatedName, StableName;
Expand All @@ -1654,17 +1653,17 @@ void Sema::ConstructOpenCLKernel(FunctionDecl *KernelCallerFunc,
: CalculatedName);
SyclKernelFieldChecker checker(*this);
SyclKernelDeclCreator kernel_decl(
*this, checker, KernelName, KernelLambda->getLocation(),
*this, checker, KernelName, KernelObj->getLocation(),
KernelCallerFunc->isInlined(), KernelCallerFunc->hasAttr<SYCLSimdAttr>());
SyclKernelBodyCreator kernel_body(*this, kernel_decl, KernelLambda,
SyclKernelBodyCreator kernel_body(*this, kernel_decl, KernelObj,
KernelCallerFunc);
SyclKernelIntHeaderCreator int_header(
*this, getSyclIntegrationHeader(), KernelLambda,
*this, getSyclIntegrationHeader(), KernelObj,
calculateKernelNameType(Context, KernelCallerFunc), KernelName,
StableName);

ConstructingOpenCLKernel = true;
VisitRecordFields(KernelLambda->fields(), checker, kernel_decl, kernel_body,
VisitRecordFields(KernelObj->fields(), checker, kernel_decl, kernel_body,
int_header);
ConstructingOpenCLKernel = false;
}
Expand Down