Skip to content

Commit

Permalink
[CIR][CodeGen] Stub out an empty CIRGenDebugInfo type
Browse files Browse the repository at this point in the history
  • Loading branch information
lanza committed Sep 19, 2024
1 parent 9a85975 commit 67ce904
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
20 changes: 20 additions & 0 deletions clang/lib/CIR/CodeGen/CIRGenDebugInfo.h
Original file line number Diff line number Diff line change
@@ -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
5 changes: 4 additions & 1 deletion clang/lib/CIR/CodeGen/CIRGenFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include "CIRGenBuilder.h"
#include "CIRGenCall.h"
#include "CIRGenDebugInfo.h"
#include "CIRGenModule.h"
#include "CIRGenTBAA.h"
#include "CIRGenTypeCache.h"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 67ce904

Please sign in to comment.