I want to use Function::Create method to create a function whose input parameter type is llvm::Instruction* but I didn't find any direct method in class Type to do that. Can anyone give me some hints?
Also For a concrete compare Instruction *pi, I tried pi->getType()->print(errs()) and it returned me i1 as type. But when I wrote a function int externalCall(Instruction *p) in another cpp file and compiled into IR. This IR says the type is class.llvm::Instruction. Why this two are different and how can I get the latter one from the API?
call void @foo('class.llvm::Instruction' p)- Min Gaollvm::Instruction, it's just a C++ type. So this question might be just as well about any other type. In particular, you would definitely not find any special treatment of that type. So I suggest searching for general ways to create a type in LLVM. - Oak