have LLVM print type strings for us
Example: void ({ i64, %tydesc*, i8*, i8*, i8 }*, i64*, %"struct.std::fmt::Formatter[#1]"*)* Before, we would print 20 levels deep due to recursion in the type definition.
This commit is contained in:
parent
80878ff369
commit
7bad416765
3 changed files with 17 additions and 60 deletions
|
@ -803,3 +803,10 @@ extern "C" void LLVMDICompositeTypeSetTypeArray(
|
|||
{
|
||||
unwrapDI<DICompositeType>(CompositeType).setTypeArray(unwrapDI<DIArray>(TypeArray));
|
||||
}
|
||||
|
||||
extern "C" char *LLVMTypeToString(LLVMTypeRef Type) {
|
||||
std::string s;
|
||||
llvm::raw_string_ostream os(s);
|
||||
unwrap<llvm::Type>(Type)->print(os);
|
||||
return strdup(os.str().data());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue