[llvm-commits] fix for a compile error?

Sam Bishop sam at bishop.dhs.org
Sat Jan 12 14:47:17 PST 2008


I just tried to compile a fresh copy of LLVM (from svn) under Cygwin, 
and I got the following compiler errors:

llvm[2]: Compiling TargetData.cpp for Debug build
llvm[3]: Compiling SPUISelLowering.cpp for Debug build
SPUISelLowering.cpp: In function `llvm::SDOperand 
LowerLOAD(llvm::SDOperand, llvm::SelectionDAG&, const 
llvm::SPUSubtarget*)':
SPUISelLowering.cpp:558: error: invalid initialization of reference of 
type 'unsigned int&' from expression of type 'llvm::MVT::ValueType'
SPUISelLowering.cpp:457: error: in passing argument 8 of 
`llvm::SDOperand AlignedLoad(llvm::SDOperand, llvm::SelectionDAG&, 
const llvm::SPUSubtarget*, llvm::LSBaseSDNode*, unsigned int&, int&, 
int&, unsigned int&, bool&)'
[ The message is repeated for line 673, for the same reason. ]

I was able to fix this by changing the type of AlignedLoad()'s eighth 
argument to be llvm::MVT::ValueType.  This seems to better fit the 
intentions of the original author, but it bothers me that I don't 
understand why the compiler was complaining about the original code. 
A trivial patch is attached.

Thanks,
Sam Bishop
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: SPUISelLowering.cpp.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080112/e3679b23/attachment.ksh>


More information about the llvm-commits mailing list