[LLVMdev] diffs for vc7.1

Anshu Dasgupta anshuman at cs.rice.edu
Fri Sep 3 13:01:01 PDT 2004


Hi Paolo,

> <snip>
> for (BasicBlock::iterator I = Dest->begin(); PHINode *PN = 
> dyn_cast<PHINode>(I); ++I)
>     visitPHINode(*PN);
> <snip>
>
> build_vc71\lib\Transforms\Scalar\SCCP.cpp(202) : error C2275: 
> 'llvm::PHINode' : illegal use of this type as an expression
>
> but I think is a NO-NO, so suggestions?

Since it's fussy about a declaration in the for construct, perhaps 
something like this might work:

PHINode *PN;
for (BasicBlock::iterator I = Dest->begin(); (PN = 
dyn_cast<PHINode>(I)); ++I)
    ...

However, I haven't worked with Visual C++ and so am not familiar with 
its peculiarities.

-Anshu




More information about the llvm-dev mailing list