Displaying 4 results from an estimated 4 matches for "currentbblock".
Did you mean:
currentblock
2013 Jan 11
2
[LLVMdev] Make a comparation with IR builder
...list->accept(*this); /* get a vector contains variable names */
symbol->spec_init->accept(*this); /* Store in varType variable list */
lType = typeOf(varType);
for (unsigned int i = 0; i < varNames.size(); i++) {
AllocaInst *alloc = new AllocaInst(lType, varNames[i].c_str(), currentBBlock);
locals[varNames[i]] = alloc;
}
return NULL;
}
Can I load a AllocaInst using CreateLoad instruction?
Cheers,
Manuele
Il 11/01/2013 12:56, Justin Holewinski ha scritto:
>
> you're not showing enough code. What does accept() do?
>
> Based on your description, I strongly...
2013 Jan 11
0
[LLVMdev] Make a comparation with IR builder
...this); /* get a vector contains variable names */
> symbol->spec_init->accept(*this); /* Store in varType variable list */
> lType = typeOf(varType);
> for (unsigned int i = 0; i < varNames.size(); i++) {
> AllocaInst *alloc = new AllocaInst(lType, varNames[i].c_str(), currentBBlock);
> locals[varNames[i]] = alloc;
> }
>
> return NULL;
> }
>
> Can I load a AllocaInst using CreateLoad instruction?
>
>
Yes, your generated alloca is actually returning a "pointer of lType" type.
You need to load the value to an "lType" type....
2013 Jan 11
0
[LLVMdev] Make a comparation with IR builder
you're not showing enough code. What does accept() do?
Based on your description, I strongly suspect that your alloca and constant
are not the same type. Remember that alloca returns a pointer type that
you must load to get at the actual variable.
On Jan 11, 2013 3:28 AM, "Manuele Conti" <manuele.conti at sirius-es.it> wrote:
> Hi All,
> I'm writing a code
2013 Jan 11
2
[LLVMdev] Make a comparation with IR builder
Hi All,
I'm writing a code generation with my compiler. I read sever example and
documentation but I did understand what I make wrong.
What I try to do is a compare a local variable with a constant.
But when I create a ICMP instruction I get that instruction are not of
same type.
I'm using llvm by svn repository updated at two week ago.
The code that I try to generation is something