From f7fc90d98d249071b123b7a78cf8b35dd95e6f51 Mon Sep 17 00:00:00 2001 From: Stefano Sanfilippo Date: Sat, 28 Jan 2023 14:44:57 +0100 Subject: [PATCH] Make the debug type printer compatible with opaque pointers. This makes the code compatible with both LLVM 14 and 15. --- src/codegen.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/codegen.cpp b/src/codegen.cpp index 5a39e90..b1b96a2 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -445,13 +445,8 @@ const char* IRGenerator::getSourceBaseType(llvm::Type* type) { } std::string IRGenerator::getSourceType(llvm::Type* type) { - std::string name; - while (type->isPointerTy()) { - name += "conte "; - type = type->getPointerElementType(); - } - name += getSourceBaseType(type); - return name; + // TODO: Show the pointer type, if possible. + return type->isPointerTy() ? "conte" : getSourceBaseType(type); } namespace {