[cfe-dev] clang fails to build with latest LLVM revision

Chris Lattner clattner at apple.com
Tue Sep 4 09:56:02 PDT 2007


It looks like the mainline interfaces were changed.  Before it used  
to have several versions, including one that took a an array of  
operands as a base pointer + count, now it only takes two iterators  
as input.

Please change stuff like this:
   llvm::Value *ImagPtr = Builder.CreateGEP(SrcPtr, Zero, One,  
Name.c_str());

to:

   Value *Ops[] = {Zero, One};
   llvm::Value *ImagPtr = Builder.CreateGEP(SrcPtr, Ops, Ops+2,  
Name.c_str());

and it should work.

-Chris

On Sep 4, 2007, at 9:44 AM, Ted Kremenek wrote:

> This morning I did an update of both my LLVM and clang trees.  Now
> clang doesn't compile:
>
> llvm[1]: Compiling CGExprComplex.cpp for Debug build
> /Volumes/Data/Users/kremenek/dev/src/llvm/include/llvm/Instructions.h:
> In member function ‘void llvm::GetElementPtrInst::init(llvm::Value*,
> InputIterator, InputIterator, const std::string&,
> std::random_access_iterator_tag) [with InputIterator =
> llvm::Constant*]’:
> /Volumes/Data/Users/kremenek/dev/src/llvm/include/llvm/Instructions.h:
> 459:   instantiated from
> ‘llvm::GetElementPtrInst::GetElementPtrInst(llvm::Value*,
> InputIterator, InputIterator, const std::string&, llvm::Instruction*)
> [with InputIterator = llvm::Constant*]’
> /Volumes/Data/Users/kremenek/dev/src/llvm/include/llvm/Support/
> LLVMBuilder.h:223:   instantiated from ‘llvm::GetElementPtrInst*
> llvm::LLVMBuilder::CreateGEP(llvm::Value*, InputIterator,
> InputIterator, const char*) [with InputIterator = llvm::Constant*]’
> CGExprComplex.cpp:194:   instantiated from here
> /Volumes/Data/Users/kremenek/dev/src/llvm/include/llvm/Instructions.h:
> 404: error: no matching function for call to
> ‘llvm::GetElementPtrInst::init(llvm::Value*&, llvm::Constant*,
> ptrdiff_t&)’
> /Volumes/Data/Users/kremenek/dev/src/llvm/include/llvm/Instructions.h:
> 390: note: candidates are: void
> llvm::GetElementPtrInst::init(llvm::Value*, llvm::Value* const*,
> unsigned int)
> /Volumes/Data/Users/kremenek/dev/src/llvm/include/llvm/Instructions.h:
> 391: note:                 void
> llvm::GetElementPtrInst::init(llvm::Value*, llvm::Value*)
> make[1]: *** [/Volumes/Data/Users/kremenek/dev/src/llvm/tools/clang/
> CodeGen/Debug/CGExprComplex.o] Error 1
> make: *** [all] Error 1
>
> The revision numbers for the trees are as follows:
>
> (kremenek at grue:llvm)$ svn update
> At revision 41699.
>
> (kremenek at grue:clang)$ svn update
> At revision 41699.
>
> It appears that the signature for GetElementPtrInst::init has
> changed.  I can look into fixing this, but I'm not super savvy on the
> latest changes to the LLVM tree and how those changes effect the
> CodeGen component of clang.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev





More information about the cfe-dev mailing list