From 67960e5c08629bb78c147bd0a86764967448b33c Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 7 Mar 2025 08:04:02 -0800 Subject: [OpenACC] Ensure decl OpenACC constructs don't crash I initially implemented codegen to be a 'no-op' for these declarations, which I thought was properly implemented. However, when they are a top-level decl, we have a separate switch. This patch makes sure they are properly emitted at top-level as a no-op, and adds a test for both top-level and not top-level. --- clang/lib/CodeGen/CodeGenModule.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.h') diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 83bb5bc..e7c9238 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -1574,9 +1574,11 @@ public: CodeGenFunction *CGF = nullptr); // Emit code for the OpenACC Declare declaration. - void EmitOpenACCDeclare(const OpenACCDeclareDecl *D, CodeGenFunction *CGF); + void EmitOpenACCDeclare(const OpenACCDeclareDecl *D, + CodeGenFunction *CGF = nullptr); // Emit code for the OpenACC Routine declaration. - void EmitOpenACCRoutine(const OpenACCRoutineDecl *D, CodeGenFunction *CGF); + void EmitOpenACCRoutine(const OpenACCRoutineDecl *D, + CodeGenFunction *CGF = nullptr); /// Emit a code for requires directive. /// \param D Requires declaration -- cgit v1.1