Skip to content

Commit 845c25a

Browse files
committed
[CIR][CodeGen] Stub out an empty CIRGenDebugInfo type
1 parent 9a85975 commit 845c25a

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//===--- CIRGenDebugInfo.h - DebugInfo for CIRGen ---------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// This is the source-level debug info generator for CIR translation.
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
#ifndef LLVM_CLANG_LIB_CIR_CODEGEN_CIRGENDEBUGINFO_H
14+
#define LLVM_CLANG_LIB_CIR_CODEGEN_CIRGENDEBUGINFO_H
15+
16+
namespace cir {
17+
class CIRGenDebugInfo {};
18+
} // namespace cir
19+
20+
#endif // LLVM_CLANG_LIB_CIR_CODEGEN_CIRGENDEBUGINFO_H

clang/lib/CIR/CodeGen/CIRGenFunction.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include "CIRGenBuilder.h"
1717
#include "CIRGenCall.h"
18+
#include "CIRGenDebugInfo.h"
1819
#include "CIRGenModule.h"
1920
#include "CIRGenTBAA.h"
2021
#include "CIRGenTypeCache.h"
@@ -524,6 +525,8 @@ class CIRGenFunction : public CIRGenTypeCache {
524525
/// delcs.
525526
DeclMapTy LocalDeclMap;
526527

528+
CIRGenDebugInfo *debugInfo = nullptr;
529+
527530
/// Whether llvm.stacksave has been called. Used to avoid
528531
/// calling llvm.stacksave for multiple VLAs in the same scope.
529532
/// TODO: Translate to MLIR
@@ -585,10 +588,7 @@ class CIRGenFunction : public CIRGenTypeCache {
585588

586589
const clang::LangOptions &getLangOpts() const { return CGM.getLangOpts(); }
587590

588-
// TODO: This is currently just a dumb stub. But we want to be able to clearly
589-
// assert where we arne't doing things that we know we should and will crash
590-
// as soon as we add a DebugInfo type to this class.
591-
std::nullptr_t *getDebugInfo() { return nullptr; }
591+
CIRGenDebugInfo *getDebugInfo() { return debugInfo; }
592592

593593
void buildReturnOfRValue(mlir::Location loc, RValue RV, QualType Ty);
594594

0 commit comments

Comments
 (0)