From ff50b121e336503621da80676116f82d82e91196 Mon Sep 17 00:00:00 2001 From: Artur Gainullin Date: Thu, 11 Feb 2021 12:54:59 -0800 Subject: [SYCL] Ignore file-scope asm during device-side SYCL compilation. Reviewed By: bader, eandrews Differential Revision: https://reviews.llvm.org/D96538 --- clang/lib/CodeGen/CodeGenModule.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 6321f745593b..4688f13dae21 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -5672,6 +5672,9 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { // File-scope asm is ignored during device-side OpenMP compilation. if (LangOpts.OpenMPIsDevice) break; + // File-scope asm is ignored during device-side SYCL compilation. + if (LangOpts.SYCLIsDevice) + break; auto *AD = cast(D); getModule().appendModuleInlineAsm(AD->getAsmString()->getString()); break; -- cgit v1.2.3