[LLVMdev] dynamic_cast error
Pratik Mehta
mehta.pr.y at gmail.com
Tue Feb 14 03:32:01 PST 2006
Hello,
Following statement from LLVM Programmer's Manual is not compiling.
CallInst* callInst = dyn_cast<CallInst>(&*basic_block_iterator_1);
The gcc version is :
gcc (GCC) 4.0.2 20051125 (Red Hat 4.0.2-8)
============
Error message
============
llvm/include/llvm/Support/Casting.h: In function 'bool
llvm::isa_impl(const From&) [with To = llvm::CallInst, From =
llvm::Instruction]':
llvm/include/llvm/Support/Casting.h:69: instantiated from 'static
bool llvm::isa_impl_wrap<To, const FromTy, const FromTy>::doit(const
FromTy&) [with To = llvm::CallInst, FromTy = llvm::Instruction]'
llvm/include/llvm/Support/Casting.h:81: instantiated from 'static
bool llvm::isa_impl_cl<FromCl>::isa(const FromCl&) [with ToCl =
llvm::CallInst, FromCl = llvm::Instruction]'
llvm/include/llvm/Support/Casting.h:99: instantiated from 'static
bool llvm::isa_impl_cl<FromCl*>::isa(FromCl*) [with ToCl =
llvm::CallInst, FromCl = llvm::Instruction]'
llvm/include/llvm/Support/Casting.h:114: instantiated from 'bool
llvm::isa(const Y&) [with X = llvm::CallInst, Y = llvm::Instruction*]'
llvm/include/llvm/Support/Casting.h:223: instantiated from 'typename
llvm::cast_retty<To, From>::ret_type llvm::dyn_cast(Y) [with X =
llvm::CallInst, Y = llvm::Instruction*]'
callsite.cc:22: instantiated from here
llvm/include/llvm/Support/Casting.h:52: error: incomplete type
'llvm::CallInst' used in nested name specifier
==========
Any hints about what the issue could be?
TIA
More information about the llvm-dev
mailing list