From 80e7eed6a610ab3c7289e6f9b7ec006bc7d7ae31 Mon Sep 17 00:00:00 2001 From: Anubhab Ghosh Date: Mon, 6 Mar 2023 16:50:02 +0530 Subject: [clang-repl][CUDA] Initial interactive CUDA support for clang-repl CUDA support can be enabled in clang-repl with --cuda flag. Device code linking is not yet supported. inline must be used with all __device__ functions. Differential Revision: https://reviews.llvm.org/D146389 --- clang/lib/CodeGen/CodeGenAction.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenAction.cpp') diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp index 29adf88..784ff77 100644 --- a/clang/lib/CodeGen/CodeGenAction.cpp +++ b/clang/lib/CodeGen/CodeGenAction.cpp @@ -264,6 +264,7 @@ namespace clang { // Links each entry in LinkModules into our module. Returns true on error. bool LinkInModules() { for (auto &LM : LinkModules) { + assert(LM.Module && "LinkModule does not actually have a module"); if (LM.PropagateAttrs) for (Function &F : *LM.Module) { // Skip intrinsics. Keep consistent with how intrinsics are created @@ -293,6 +294,7 @@ namespace clang { if (Err) return true; } + LinkModules.clear(); return false; // success } -- cgit v1.1