diff options
author | erichkeane <ekeane@nvidia.com> | 2025-03-07 08:04:02 -0800 |
---|---|---|
committer | erichkeane <ekeane@nvidia.com> | 2025-03-07 08:05:19 -0800 |
commit | 67960e5c08629bb78c147bd0a86764967448b33c (patch) | |
tree | 4dfaa8517c83c477226fd7bdb4ef0e5477fa9e6f /clang/lib/CodeGen/CodeGenModule.h | |
parent | 5685def507ed7c95bf93572e5cf8c30efbc7d99b (diff) | |
download | llvm-67960e5c08629bb78c147bd0a86764967448b33c.zip llvm-67960e5c08629bb78c147bd0a86764967448b33c.tar.gz llvm-67960e5c08629bb78c147bd0a86764967448b33c.tar.bz2 |
[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.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 6 |
1 files changed, 4 insertions, 2 deletions
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 |