From 67ce904357a116004e4d8dcc01a821839dc103c7 Mon Sep 17 00:00:00 2001 From: Nathan Lanza Date: Wed, 18 Sep 2024 23:16:31 -0400 Subject: [PATCH] [CIR][CodeGen] Stub out an empty CIRGenDebugInfo type --- clang/lib/CIR/CodeGen/CIRGenDebugInfo.h | 20 ++++++++++++++++++++ clang/lib/CIR/CodeGen/CIRGenFunction.h | 5 ++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 clang/lib/CIR/CodeGen/CIRGenDebugInfo.h diff --git a/clang/lib/CIR/CodeGen/CIRGenDebugInfo.h b/clang/lib/CIR/CodeGen/CIRGenDebugInfo.h new file mode 100644 index 000000000000..9aa503bf07e5 --- /dev/null +++ b/clang/lib/CIR/CodeGen/CIRGenDebugInfo.h @@ -0,0 +1,20 @@ +//===--- CIRGenDebugInfo.h - DebugInfo for CIRGen ---------------*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// This is the source-level debug info generator for CIR translation. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_LIB_CIR_CODEGEN_CIRGENDEBUGINFO_H +#define LLVM_CLANG_LIB_CIR_CODEGEN_CIRGENDEBUGINFO_H + +namespace cir { +class CIRGenDebugInfo {}; +} // namespace cir + +#endif // LLVM_CLANG_LIB_CIR_CODEGEN_CIRGENDEBUGINFO_H diff --git a/clang/lib/CIR/CodeGen/CIRGenFunction.h b/clang/lib/CIR/CodeGen/CIRGenFunction.h index c581e4ba9e35..c7b96ff80274 100644 --- a/clang/lib/CIR/CodeGen/CIRGenFunction.h +++ b/clang/lib/CIR/CodeGen/CIRGenFunction.h @@ -15,6 +15,7 @@ #include "CIRGenBuilder.h" #include "CIRGenCall.h" +#include "CIRGenDebugInfo.h" #include "CIRGenModule.h" #include "CIRGenTBAA.h" #include "CIRGenTypeCache.h" @@ -524,6 +525,8 @@ class CIRGenFunction : public CIRGenTypeCache { /// delcs. DeclMapTy LocalDeclMap; + CIRGenDebugInfo *debugInfo; + /// Whether llvm.stacksave has been called. Used to avoid /// calling llvm.stacksave for multiple VLAs in the same scope. /// TODO: Translate to MLIR @@ -588,7 +591,7 @@ class CIRGenFunction : public CIRGenTypeCache { // TODO: This is currently just a dumb stub. But we want to be able to clearly // assert where we arne't doing things that we know we should and will crash // as soon as we add a DebugInfo type to this class. - std::nullptr_t *getDebugInfo() { return nullptr; } + CIRGenDebugInfo *getDebugInfo() { return debugInfo; } void buildReturnOfRValue(mlir::Location loc, RValue RV, QualType Ty);