For the following code:
Type * type = IntegerType::getInt32Ty(getGlobalContext());
IRBuilder<> builder(BB);
std::set<Value *> Vset;
Value * Vresult=0;
for(std::set<Value*>::iterator Vit=Vset.begin();Vit!=Vset.end();Vit++)
{
Vresult=builder.CreateOr(Vit, Vresult, "WaitOr");
}
Vset is inserted in previous loop by 0 or 1 The error is
error: no matching member function for call to 'CreateOr'
Vresult=builder.CreateOr(Vit, Vresult, "WaitOr");
Which input is wrong in the CreateOr() ?
--
* Rasha Salah Omar
Msc Student at E-JUST
Demonestrator at Faculty of Computers and Informatics
Benha University*
* e-mail: rasha.omar at ejust.edu.eg*
P* Please consider the environment before printing this email.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20130816/15780333/attachment.html>
Hi Rasha,> Value * Vresult=0; > for(std::set<Value*>::iterator Vit=Vset.begin();Vit!=Vset.end();Vit++) > { > Vresult=builder.CreateOr(Vit, Vresult, "WaitOr"); > } > > Which input is wrong in the CreateOr() ?The first two. Vit needs to be dereferenced "*Vit" and Vresult needs to be initialised to a real value ("ConstantInt::get(SomeType, 0)" might make sense) before the first iteration of the loop. "Vit" is what's causing the compile-time failure though. The other one will just go wrong at runtime. Cheers. Tim.
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] > On Behalf Of Rasha Omar > Subject: [LLVMdev] CreateOr no matching member error> For the following code: > Type * type = IntegerType::getInt32Ty(getGlobalContext()); > IRBuilder<> builder(BB); > std::set<Value *> Vset; > Value * Vresult=0; > for(std::set<Value*>::iterator Vit=Vset.begin();Vit!=Vset.end();Vit++) > { > Vresult=builder.CreateOr(Vit, Vresult, "WaitOr"); > } > error: no matching member function for call to 'CreateOr' > Vresult=builder.CreateOr(Vit, Vresult, "WaitOr"); > Which input is wrong in the CreateOr() ?Vit is not of type Value*. Try *Vit in the CreateOr() call. - Chuck