[LLVMdev] Error compiling ConstantProp.cpp

Eli Friedman eli.friedman at gmail.com
Sat Apr 16 17:35:38 PDT 2011


On Sat, Apr 16, 2011 at 5:27 PM, tarun agrawal <tarun at cse.iitb.ac.in> wrote:
> 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

The LLVM C++ API is not stable; you can't copy-paste code from a newer
LLVM version into an older one and expect it to work.

-Eli

>
> On Sun, Apr 17, 2011 at 5:48 AM, Eli Friedman <eli.friedman at gmail.com>
> wrote:
>>
>> On Sat, Apr 16, 2011 at 5:07 PM, tarun agrawal <tarun at cse.iitb.ac.in>
>> wrote:
>> > While compiling the ConstantProp.cpp I am getting the following error.
>> >
>> > error: too few arguments to function ‘llvm::Constant*
>> > llvm::ConstantFoldInstruction(llvm::Instruction*, llvm::LLVMContext&,
>> > const
>> > llvm::TargetData*)
>>
>> If you're reporting a build error, please include the complete error
>> output and the source version you're using (release version or SVN
>> revision).
>>
>> -Eli
>
>




More information about the llvm-dev mailing list