[llvm] [DI] Have createClassType create a class type. (PR #102624)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 9 07:33:06 PDT 2024


https://github.com/deadalnix created https://github.com/llvm/llvm-project/pull/102624

I was wondering why my use of createClassType was generating structure reccords, and it turns out the code is wrong (or for some reason i don't understand the intended use of the API).

clang itself does not use that part of the API, so this flew under the radar.

>From dd596d29cb60863e7df21545421713e408a17cc2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Amaury=20S=C3=A9chet?= <deadalnix at gmail.com>
Date: Fri, 9 Aug 2024 13:56:06 +0000
Subject: [PATCH] [DI] Have createClassType create a class type.

---
 llvm/lib/IR/DIBuilder.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index 30b79b6d6f60fd..0db82cdd6373c8 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -509,7 +509,7 @@ DICompositeType *DIBuilder::createClassType(
          "createClassType should be called with a valid Context");
 
   auto *R = DICompositeType::get(
-      VMContext, dwarf::DW_TAG_structure_type, Name, File, LineNumber,
+      VMContext, dwarf::DW_TAG_class_type, Name, File, LineNumber,
       getNonCompileUnitScope(Context), DerivedFrom, SizeInBits, AlignInBits,
       OffsetInBits, Flags, Elements, RunTimeLang, VTableHolder,
       cast_or_null<MDTuple>(TemplateParams), UniqueIdentifier);



More information about the llvm-commits mailing list