badcoder
badcoder

Reputation: 13

Displaying LLVMTypeRef object using LLVM C API functions

I am trying to debug my code which is a C language parser in Bison, to generate LLVM IR. I am using LLVM C API functions. I am looking for something to display my LLVMTypeRef object since the LLVMDumpValue(LLVMValueRef) only works with LLVMValueRef objects. Can anyone help me with this?

Upvotes: 1

Views: 268

Answers (1)

Geoff Reedy
Geoff Reedy

Reputation: 36061

The C API is definitely limited relative to the C++ API. I haven't tried it myself, but if dumping a value includes its type then creating an undef value for the type and dumping the value should be good enough for debugging purposes. That would just be

LLVMDumpValue(LLVMGetUndef(theTypeRef));

Upvotes: 1

Related Questions