[LLVMdev] Cast error

Hripsime Matevosyan hripsime.m at gmail.com
Thu Jan 12 03:40:46 PST 2012


Hi all,

I have a trouble with LLVM rev - 147926 cast instructions. Here is my code:

............
for(std::vector<Value*>::iterator it = getElementPtrs.begin(); it !=
getElementPtrs.end(); ++it) {
                 Value* current = *it;
                 errs() << *current << "\n";
                 GetElementPtrInst* gep = cast<GetElementPtrInst>(current);
                 assert(gep != NULL && "GetElementPtrInst must be valid!");
............

Program crashes with the above mentioned assertion. Here getElementPtrs is
a vector of Values, that are GetElementPtrInst- s. errs() works fine. I've
also tried to dyn_cast the value, but it doesn't work too.
Any ideas?

Sincerely,
Hripsime.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120112/091bc578/attachment.html>


More information about the llvm-dev mailing list