[LLVMdev] Error for AllocaInst and Instruction

Rasha Omar
Thu, 25 Jul 2013 12:14:58 -0000

Bb >> BasicBlock*


On 25 July 2013 14:12, Rasha Omar <rasha.sala7 at gmail.com> wrote:

> Hi,
> For the following code
>         const Type * Int32Type >
IntegerType::getInt32Ty(getGlobalContext());
>         AllocaInst* newInst = new AllocaInst(Int32Type, 0,
"flag", Bb);
>         Bb->getInstList().push_back(newInst);
>
> It gives me the error
> "  error: no matching constructor for initialization of
'llvm::AllocaInst'
>             AllocaInst* newInst = new AllocaInst(Int32Type, 0,
"flag",
> Bb);"
>
>
> By using Instruction
>
>         const Type * Int32Type >
IntegerType::getInt32Ty(getGlobalContext());
>         Instruction* newInst = new Instruction(Int32Type, 0,
"flag", Bb);
>         Bb->getInstList().push_back(newInst);
>
>
> error: allocating an object of abstract class type
'llvm::Instruction'
>             Instruction* newInst = new Instruction(Int32Type, 0,
"flag",
> Bb);
>
>
> --
> *Rasha Salah Omar
> Msc Student at E-JUST
> Demonestrator  at Faculty of Computers and Informatics
> Benha University
> *
>



--
*Rasha Salah Omar
Msc Student at E-JUST
Demonestrator  at Faculty of Computers and Informatics
Benha University
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20130725/63869d1e/attachment.html>