[LLVMdev] diffs for vc7.1

Paolo Invernizzi arathorn at fastwebnet.it
Fri Sep 3 08:53:48 PDT 2004


Hi all,

Here the first bunch of patch for compiling part of LLVM under win32 
with MSVC 7.1:

* Trivial addings (I hope!):
- #include <string> at top of:
     llvm\include\llvm\ExecutionEngine\ExecutionEngine.h(78) : error 
C2039: 'string' : is not a member of '_STL'
- #include <algorithm> at top of:
     llvm\lib\CodeGen\LiveIntervalAnalysis.cpp(639) : error C2039: 
'sort' : is not a member of '_STL'
     llvm\lib\CodeGen\RegAllocLinearScan.cpp(473) : error C3861: 'find': 
identifier not found, even with argument-dependent lookup
     llvm\lib\CodeGen\RegAllocLinearScan.cpp(486) : error C3861: 'find': 
identifier not found, even with argument-dependent lookup
     llvm\lib\Transforms\Scalar\LoopUnswitch.cpp(261) : error C2039: 
'sort' : is not a member of '_STL'
     llvm\lib\Transforms\Scalar\LowerSwitch.cpp(211) : error C2039: 
'sort' : is not a member of '_STL'
     llvm\lib\Analysis\BasicAliasAnalysis.cpp(700) : error C2039: 'sort' 
: is not a member of '_STL'
     llvm\lib\Analysis\IntervalPartition.cpp(29) : error C3861: 
'for_each': identifier not found, even with argument-dependent lookup
     llvm\lib\Analysis\LoadValueNumbering.cpp(184) : error C2039: 'sort' 
: is not a member of '_STL'
     llvm\lib\Analysis\ScalarEvolution.cpp(362) : error C2039: 'sort' : 
is not a member of '_STL'
     llvm\lib\Transforms\Utils\PromoteMemoryToRegister.cpp(314) : error 
C2039: 'sort' : is not a member of '_STL'
     llvm\lib\Bytecode\Reader\Reader.cpp(349) : error C3861: 'find': 
identifier not found, even with argument-dependent lookup

-  added std::
     llvm\lib\Analysis\IntervalPartition.cpp(29) : error C3861: 
'for_each': identifier not found, even with argument-dependent lookup
     llvm\include\llvm\Analysis\IntervalIterator.h(180) : error C3861: 
'make_pair': identifier not found, even with argument-dependent lookup
     llvm\lib\Analysis\LoopInfo.cpp(36) : error C3861: 'find': 
identifier not found, even with argument-dependent lookup
     llvm\lib\Transforms\Utils\SimplifyCFG.cpp(52) : error C3861: 
'find': identifier not found, even with argument-dependent lookup
     build_vc71\lib\Bytecode\Reader\Reader.cpp(356) : error C3861: 
'find': identifier not found, even with argument-dependent lookup
     build_vc71\lib\Bytecode\Reader\Reader.cpp(383) : error C3861: 
'find': identifier not found, even with argument-dependent lookup

* C99 Arrays... forgive me if I don't provide a patch to standard 
vectors...
     llvm\lib\Bytecode\Reader\Reader.cpp(1483) : error C2057: expected 
constant expression
     llvm/lib/CodeGen/LiveVariables.cpp,  # MachineInstr 
*PhysRegInfoA[RegInfo->getNumRegs()]; C99 array
     llvm/lib/Target/TargetSchedInfo.cpp, # int 
classPairGaps[numSchedClasses][numSchedClasses]; C99 array

The next bigger problem is that the compiler complains about this kind 
of construct...

<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

in short, is the assignment in the PHINode *PN = dyn_cast<PHINode>(I) 
,as if I break it in:

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

it compiles, and I've found the problem only when used in the 'for' 
statement (for now...)

So I'm turning my code to

for (BasicBlock::iterator I = Dest->begin(); isa<PHINode>(I); ++I) {
     PHINode *PN = cast<PHINode>(I);
     visitPHINode(*PN);
}

but I think is a NO-NO, so suggestions?

The Visual C++ manual reports:

An expression uses the -> operator with a typedef identifier.
Example
// C2275.cpp
typedef struct S
{
     int mem;
} *S_t;
void func1( int *parm );
void func2()
{
     func1( &S_t->mem );   // C2275, S_t is a typedef
}

---
Paolo Invernizzi
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff_include.txt
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20040903/23633f67/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff_lib.txt
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20040903/23633f67/attachment-0001.txt>


More information about the llvm-dev mailing list