[llvm-dev] error: incomplete type 'llvm::CallInst' named in nested name specifier

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 14 11:26:46 PST 2020


On Tue, 14 Jan 2020 at 19:22, Abid Malik via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> However, when I compile it, I am getting the following error.
>
> /home/amalik/LLVM/llvm_install/include/llvm/Support/Casting.h:59:12: error: incomplete type 'llvm::CallInst' named in nested name
>    [...]                          ^
> /home/amalik/LLVM/llvm_install/include/llvm/IR/BasicBlock.h:35:7: note: forward declaration of 'llvm::CallInst'
> class CallInst;

Looks like you forgot to include the header that defined CallInst. You
need that to be able to do most things with it, including (as you've
discovered) an RTTI-based cast. In this case the header is
"llvm/IR/Instructions.h".

Cheers.

Tim.


More information about the llvm-dev mailing list