Displaying 20 results from an estimated 2000 matches similar to: "[LLVMdev] How to recognize pointer variable & ordinary variable"
2010 Jul 21
1
[LLVMdev] How to recognize pointer variable & ordinary variable
Your last statement is correct. But still my stand does not change. I want
to differentiate ordinary local variable & pointer variables.
Let's have a program,
int a,b,c,*ptr;
I want to extract only the local variables. That's what my question was. I
think it is clear now. cast<PointerType>(A->getType()
>
> )->getElementType() is not working. I am also getting error
2010 Jul 21
0
[LLVMdev] How to recognize pointer variable & ordinary variable
Hi Soumya_Prasad_Ukil,
> How to recognize pointer variable & ordinary variable? I have tried with
> "isa<PointerType>(V->getType())", but failed.
I'm not sure what you are asking, but if you are asking whether an
alloca instruction A represents local memory of pointer type, you
can use A->getAllocatedType(). You can also use
2010 Aug 22
2
[LLVMdev] How to add a pass inside LLVM pass list
Soumya_Prasad_Ukil wrote:
> Pls help.
You didn't say what was actually running the passes. (llvm-gcc? clang?
opt -some -passes?) What you probably want is to modify one of the lists
in include/llvm/Support/StandardPasses.h.
Nick
>
> On 21 August 2010 17:32, Soumya_Prasad_Ukil <ukil.soumya at gmail.com
> <mailto:ukil.soumya at gmail.com>> wrote:
>
> I have
2010 Aug 22
1
[LLVMdev] How to add a pass inside LLVM pass list
Soumya_Prasad_Ukil wrote:
> Look I have written a PRE pass. opt is running that pass. I have
> included my pass name there in include/llvm/Support/StandardPasses.h
> file. To do that, I have got some error. Because it also requires the
> definition of the pass in some other file also. I observed how gvn pre
> pass is added to the pass list. I had followed the same way, but failed.
2010 Aug 22
0
[LLVMdev] How to add a pass inside LLVM pass list
Look I have written a PRE pass. opt is running that pass. I have included my
pass name there in include/llvm/Support/StandardPasses.h file. To do that, I
have got some error. Because it also requires the definition of the pass in
some other file also. I observed how gvn pre pass is added to the pass list.
I had followed the same way, but failed. Cna you kindly tell what needs to
be done in this
2010 Aug 22
0
[LLVMdev] How to add a pass inside LLVM pass list
Pls help.
On 21 August 2010 17:32, Soumya_Prasad_Ukil <ukil.soumya at gmail.com> wrote:
> I have written a simple pass. I have been successful to execute it. I want
> LLVM to execute it. I don't know how to include a pass in llvm actual pass
> list, such it automatically invokes it just like GVNPre pass or some other
> pass. They have already been limked in llvm actual pass
2010 Aug 21
2
[LLVMdev] How to add a pass inside LLVM pass list
I have written a simple pass. I have been successful to execute it. I want
LLVM to execute it. I don't know how to include a pass in llvm actual pass
list, such it automatically invokes it just like GVNPre pass or some other
pass. They have already been limked in llvm actual pass list.
--
regards,
soumya prasad ukil
-------------- next part --------------
An HTML attachment was scrubbed...
2010 Jul 19
1
[LLVMdev] How to use data structure of another pass
Can you tell me where pass_1 is defined? You have used it inside
getAnalysis<pass_1>(). Is it the name we generally give to a pass while
registry? In this case, don't I need to use getAnalysisUsage (AnalysisUsage
&AU) function?
On 20 July 2010 02:55, John Criswell <criswell at uiuc.edu> wrote:
> Soumya_Prasad_Ukil wrote:
>
>>
>> In LLVM, we generally
2010 Jul 19
2
[LLVMdev] How to use data structure of another pass
In LLVM, we generally use data structure of another pass by
implementing getAnalysisUsage (AnalysisUsage &AU) method. Suppose
SOURCE/lib/Transform directory I have added one pass named as pass_1, which
calculates all expressions in a program and stores all of them in an Expr
array(take it now for granted). Now I added another pass named as pass_2 in
the same directory to print all these
2010 Jul 20
2
[LLVMdev] How to recognize global & local variable?
Can you guys tell how to recognize local & global variables ? Is there any
macro on Value* defined in LLVM?
--
regards,
soumya prasad ukil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100721/cdc89d56/attachment.html>
2010 Jul 19
0
[LLVMdev] How to use data structure of another pass
Soumya_Prasad_Ukil wrote:
>
> In LLVM, we generally use data structure of another pass by
> implementing getAnalysisUsage (AnalysisUsage &AU) method. Suppose
> SOURCE/lib/Transform directory I have added one pass named as pass_1,
> which calculates all expressions in a program and stores all of them
> in an Expr array(take it now for granted). Now I added another
2010 May 28
2
[LLVMdev] Retrieving Underlying Type from AllocaInst
Is there a recommended way to retrieve the original type from an AllocaInst object?
For example, I am creating alloca instructions using the IRBuilder interface like:
alloca = builder.CreateAlloca( Type::getDoubleTy( context ), 0, variableName.c_str() );
and I place the alloca into a symbol table.
Later when I am generating instructions for an assignment operation, I want to check the type of
2010 May 28
2
[LLVMdev] Retrieving Underlying Type from AllocaInst
Thanks Nick,
Unfortunately, that is indeed what I asked for but not what I really am looking for.
My naive approach is to store symbol table entries as Value* objects so I can allocate global variables and alloca variables and place them into the symbol table and the rest of the code didn't need to know which kind they were, in general. Loads and Stores of these types (as well as other
2010 May 28
0
[LLVMdev] Retrieving Underlying Type from AllocaInst
Curtis Faith wrote:
> Is there a recommended way to retrieve the original type from an
> AllocaInst object?
>
> For example, I am creating alloca instructions using the IRBuilder
> interface like:
>
> alloca = builder.CreateAlloca( Type::getDoubleTy( context ), 0,
> variableName.c_str() );
>
> and I place the alloca into a symbol table.
>
> Later when I am
2010 Jul 21
0
[LLVMdev] How to recognize global & local variable?
Hi Soumya_Prasad_Ukil,
> Can you guys tell how to recognize local & global variables ? Is there
> any macro on Value* defined in LLVM?
Global variable: isa<GlobalVariable>(V)
Local variable: isa<AllocaInst>(V)
Ciao,
Duncan.
2010 May 28
0
[LLVMdev] Retrieving Underlying Type from AllocaInst
You should be able to use the second alternative that Nick proposed:
cast<PointerType*>(pointer_value->getType())->getElementType()
Reid
On Fri, May 28, 2010 at 9:37 AM, Curtis Faith <curtis at curtisfaith.com> wrote:
> Thanks Nick,
> Unfortunately, that is indeed what I asked for but not what I really am
> looking for.
> My naive approach is to store symbol table
2012 Sep 21
0
[LLVMdev] How To Get The Name of the type the popinter is pointing to
i am using llvm ,
i did this
if ( AllocaInst *allocInst =
dyn_cast<AllocaInst>(&*bbit)){
PointerType *p = allocInst->getType();
if ( p->getElementType()->isPointerTy()){
StringRef name =
allocInst->getName();
2012 Sep 20
5
[LLVMdev] How To Get The Name of the type the popinter is pointing to
I want to know the type of pointer .
for example
if we have
int *p,
struct node *w
char *q
then i want int for p,char for q , struct node for w.
any help would be appreciated.
--
View this message in context: http://llvm.1065342.n5.nabble.com/How-To-Get-The-Name-of-the-type-the-popinter-is-pointing-to-tp49121.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.
2010 Nov 17
1
[LLVMdev] Copy Instruction from one Basic block to another
I want to do the following:
suppose the program structure:
bb
/ \
bb1 bb2
\ /
bb3
2013 Sep 01
2
[LLVMdev] Distinguishing Pointer Variable and Ordinary Variable
Sorry I have actually edited the post.
I did check its type by using
isa<PointerType>(cast<AllocaInst>(instr->getOperand(1))->getAllocatedType())
but it is only detecting i32** %b on line 8 of IR as a pointer type.
Whereas I also want to detect the i32* %1 on line 11 of IR as a pointer
type. So how can I do this??
--
View this message in context: