Displaying 14 results from an estimated 14 matches for "classllvm_1_1constantexpr".
2012 Jan 27
3
[LLVMdev] How to get the string value?
Thanks Duncan,
Yes, it is a ConstantExpr! Thank you!
Now trying to find a clue in ConstantExpr's functions to get that string :-)
Regards,
Welson
On Thu, Jan 26, 2012 at 9:04 PM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Welson Sun,
>
> > Hi, if I have some LLVM code like this:
> >
> > @.str = private unnamed_addr constant [7 x i8]
2013 Apr 19
1
[LLVMdev] How to retrieve IntToPtr from StoreInst?
...sed here is a Constant Expression (llvm::ConstantExpr).
> You'll need to take the operand to the store, cast it to
> llvm::ConstantExpr, and then examine the opcode and operands of the
> constant expression.
>
> The ConstantExpr class is documented at
> http://llvm.org/doxygen/classllvm_1_1ConstantExpr.html and is described
> in the LLVM Language Reference Manual.
>
>
OK, I tried my best, and come up with code like below:
void MyPass::visitStoreInst(StoreInst &I)
{
Value *op2 = I.getOperand(1); // the address where we store data
if (const ConstantExpr *c = dyn_cast <C...
2012 Dec 19
2
[LLVMdev] GetElementPtrConstantExpr
...d I must emit the
> > following variable:
> > @yyy = linkonce_odr constant %xxx { [4 x i8] c"hello\00" }, but it's
> wrong.
> >
> > How do I do?
>
> You can use the ConstantExpr::getBitCast static member function:
>
>
> http://llvm.org/doxygen/classllvm_1_1ConstantExpr.html#aba93ec4079f8d709a1d5b4745310782e
>
> This is a common idiom on LLVM: a base class has static methods for
> creating instances of derived classes.
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llv...
2013 Apr 18
0
[LLVMdev] How to retrieve IntToPtr from StoreInst?
...to i8*)
The inttoptr used here is a Constant Expression (llvm::ConstantExpr).
You'll need to take the operand to the store, cast it to
llvm::ConstantExpr, and then examine the opcode and operands of the
constant expression.
The ConstantExpr class is documented at
http://llvm.org/doxygen/classllvm_1_1ConstantExpr.html and is described
in the LLVM Language Reference Manual.
-- John T.
>
> the second operand is "i8* inttoptr (i32 301959828 to i8*)", and i
> have no idea how i can retrieve the address 301959828, given the
> StoreInst argument of visitStoreInst.
>
> i am looking...
2010 May 08
2
[LLVMdev] does llvm have some way to get the size of data type
...re doxygen to produce
human-readable anchors? They might have avoided the duplication on
this thread, since Erick and John could have seen that I was linking
to their suggestions.
On Fri, May 7, 2010 at 8:47 PM, Jeffrey Yasskin <jyasskin at google.com> wrote:
> Try http://llvm.org/doxygen/classllvm_1_1ConstantExpr.html#a2ea738dfa37ea93c71756be89ba8d92
> or http://llvm.org/doxygen/classllvm_1_1TargetData.html#64c154a7844026e76e18f792ee4ad4b3
>
> On Fri, May 7, 2010 at 8:26 PM, Gang.Yao <ttoole9 at gmail.com> wrote:
>> Hi:
>>
>> just like the c function sizeof(). I would avoid...
2013 Apr 18
2
[LLVMdev] How to retrieve IntToPtr from StoreInst?
hi,
i am writing a simple LLVM pass to analyze the Store instruction.
my pass derives from InstVisitor class, and the method to handle Store
instruction is like this:
void MyPass::visitStoreInst(StoreInst &I) {
...
}
It is pretty simple to handle Store. however, in on test i got an
instruction like below:
store i8 %tmp5, i8* inttoptr (i32 301959828 to i8*)
the second operand is
2012 Dec 19
0
[LLVMdev] GetElementPtrConstantExpr
...> > following variable:
> > @yyy = linkonce_odr constant %xxx { [4 x i8] c"hello\00" }, but it's wrong.
> >
> > How do I do?
>
> You can use the ConstantExpr::getBitCast static member function:
>
> http://llvm.org/doxygen/classllvm_1_1ConstantExpr.html#aba93ec4079f8d709a1d5b4745310782e
>
> This is a common idiom on LLVM: a base class has static methods for
> creating instances of derived classes.
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.ed...
2010 May 08
0
[LLVMdev] does llvm have some way to get the size of data type
Try http://llvm.org/doxygen/classllvm_1_1ConstantExpr.html#a2ea738dfa37ea93c71756be89ba8d92
or http://llvm.org/doxygen/classllvm_1_1TargetData.html#64c154a7844026e76e18f792ee4ad4b3
On Fri, May 7, 2010 at 8:26 PM, Gang.Yao <ttoole9 at gmail.com> wrote:
> Hi:
>
> just like the c function sizeof(). I would avoid the usage of the c
> fu...
2010 May 08
0
[LLVMdev] does llvm have some way to get the size of data type
...man-readable anchors? They might have avoided the duplication on
> this thread, since Erick and John could have seen that I was linking
> to their suggestions.
>
> On Fri, May 7, 2010 at 8:47 PM, Jeffrey Yasskin <jyasskin at google.com> wrote:
>> Try http://llvm.org/doxygen/classllvm_1_1ConstantExpr.html#a2ea738dfa37ea93c71756be89ba8d92
>> or http://llvm.org/doxygen/classllvm_1_1TargetData.html#64c154a7844026e76e18f792ee4ad4b3
>>
>> On Fri, May 7, 2010 at 8:26 PM, Gang.Yao <ttoole9 at gmail.com> wrote:
>>> Hi:
>>>
>>> just like the c functio...
2012 Dec 18
0
[LLVMdev] GetElementPtrConstantExpr
...e the follow declaration: %xxx = type { i8* } and I must emit the
> following variable:
> @yyy = linkonce_odr constant %xxx { [4 x i8] c"hello\00" }, but it's wrong.
>
> How do I do?
You can use the ConstantExpr::getBitCast static member function:
http://llvm.org/doxygen/classllvm_1_1ConstantExpr.html#aba93ec4079f8d709a1d5b4745310782e
This is a common idiom on LLVM: a base class has static methods for
creating instances of derived classes.
2012 Dec 18
2
[LLVMdev] GetElementPtrConstantExpr
Because I need to convert an [4 x i8] type to i8* in the instantiation of a
GlobalVariable.
I have the follow declaration: %xxx = type { i8* } and I must emit the
following variable:
@yyy = linkonce_odr constant %xxx { [4 x i8] c"hello\00" }, but it's wrong.
How do I do?
2012/12/18 Óscar Fuentes <ofv at wanadoo.es>
> Alessio Giovanni Baroni <alessiogiovanni.baroni at
2010 May 08
5
[LLVMdev] does llvm have some way to get the size of data type
Hi:
just like the c function sizeof(). I would avoid the usage of the c
function call, and expect something like llvm
intrinsic or some class providing this functionality.
Does someone have experience in this?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100507/056bae50/attachment.html>
2012 Dec 29
2
[LLVMdev] GetElementPtrConstantExpr question
Hi all,
I just come across an IR instruction like this:
%0 = getelementptr i32* getelementptr inbounds ([42 x i32]* @aaa,
i32 0, i32 0), i32 %2
What does the part "i32* getelementptr inbounds ([42 x i32]* @aaa, i32
0, i32 0)" mean? As far as I could understand this is a
GetElementPtrConstantExpr, isn't it?
My question is: how can I instantiate a class that represents that
2012 Nov 11
4
[LLVMdev] IR sizeof?
Is there a way to get the size of a type in the IR assembly code? I know
the size must be known since alloca and getelementptr both implicitly
use it, but I don't see any way to get access to the size directly.
I know my final compiler will have to get the size itself, but I'm just
doing some simple tests directly in assembly now and am hoping there is
an easy way to get the size of a