Skip to content

Commit 5bcd485

Browse files
committed
Don't require attributes to be explicit
1 parent 462344e commit 5bcd485

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

clang/lib/AST/ASTContext.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12035,14 +12035,10 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) {
1203512035
// or `indirectly_callable' attribute must be emitted regardless of number
1203612036
// of actual uses
1203712037
if (LangOpts.SYCLIsDevice && isa<CXXMethodDecl>(D)) {
12038-
if (auto *A = D->getAttr<SYCLDeviceIndirectlyCallableAttr>())
12039-
return !A->isImplicit();
12040-
// Implicit 'sycl_device' attribute is treated as explicit one if method
12041-
// is also annotated with 'add_ir_attributes_function' attribute, because
12042-
// the latter can work as an alias for SYCL_EXTERNAL.
12043-
if (auto *A = D->getAttr<SYCLDeviceAttr>())
12044-
return !A->isImplicit() ||
12045-
D->hasAttr<SYCLAddIRAttributesFunctionAttr>();
12038+
if (D->hasAttr<SYCLDeviceIndirectlyCallableAttr>())
12039+
return true;
12040+
if (D->hasAttr<SYCLDeviceAttr>())
12041+
return true;
1204612042
}
1204712043

1204812044
GVALinkage Linkage = GetGVALinkageForFunction(FD);

0 commit comments

Comments
 (0)