[LLVMdev] Error compiling ConstantProp.cpp

John Criswell criswell at illinois.edu
Tue May 3 07:15:08 PDT 2011


On 5/3/11 9:10 AM, tarun agrawal wrote:
> Hi
>
> While compiling the ConstantProp.cpp I am getting the following error.

Is ConstantProp.cpp from a version of LLVM other than LLVM 2.6?

LLVM's internal API changes between releases, so a source file written 
for one version of LLVM will not necessarily compile against an earlier 
or later version of LLVM.

As an aside, I've been told that writing transformations using IRBuilder 
tends to require fewer changes between LLVM releases, although I haven't 
tried using it myself yet.

-- John T.

>
> error: too few arguments to function ‘llvm::Constant* 
> llvm::ConstantFoldInstruction(
> llvm::Instruction*, llvm::LLVMContext&, const llvm::TargetData*)
>
>
> I am using llvm-2.6  and the ConstProp.cpp file is 
> http://llvm.org/docs/doxygen/html/ConstantProp_8cpp_source.html
>
> and the exact error message is:
>
> llvm[0]: Compiling ConstantProp.cpp for Release build  (PIC)
> /home/tarun/Desktop/compiler/
> LLVM/llvm-2.6/include/llvm/Analysis/ConstantFolding.h: In member 
> function ‘virtual 
> bool<unnamed>::ConstantPropagation::runOnFunction(llvm::Function&)’:
> /home/tarun/Desktop/compiler/LLVM/llvm-2.6/include/llvm/Analysis/ConstantFolding.h:32: 
> error: too few arguments to function ‘llvm::Constant* 
> llvm::ConstantFoldInstruction(llvm::Instruction*, llvm::LLVMContext&, 
> const llvm::TargetData*)’
> /home/tarun/Desktop/compiler/LLVM/llvm-2.6/lib/Transforms/Hello/ConstantProp.cpp:71: 
> error: at this point in file
> make: *** 
> [/home/tarun/Desktop/compiler/LLVM/build/lib/Transforms/Hello/Release/ConstantProp.o] 
> Error 1
>
> Regards
> Tarun
>
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110503/116ba00d/attachment.html>


More information about the llvm-dev mailing list