0

I try to compile a cpp file into a ir file by clang. And there is a definition of struct pointer in cpp file, like "struct structType *p", and the value or element of p is never visited.

AS a result, the IR file compiled by LLVM15 don't contain any information of the structType. But the IR file compiled by LLVM12 contain the information "%struct.structType = type opaque".

Since the IR file is used for LLVM JIT as library IR, so the result of LLVM15 will report error in JIT compilation of "cannot resolve name...". So how could I generate IR result with structType information in LLVM15. The command used previously to generate IR is "clang -c -emit-llvm -O0".

  • Aren't you saying that you have a completely unused type, and using that type breaks? If so, look for why it's used and and unused at the same time, the problem has to be connected to that. – arnt Jul 12 '23 at 16:53

0 Answers0