Make the debug type printer compatible with opaque pointers.

This makes the code compatible with both LLVM 14 and 15.
This commit is contained in:
Stefano Sanfilippo 2023-01-28 14:44:57 +01:00
parent ef048aa324
commit f7fc90d98d

View File

@ -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 {