similar to: [LLVMdev] How To Get The Name of the type the popinter is pointing to

Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] How To Get The Name of the type the popinter is pointing to"

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();
2009 Nov 11
4
[LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error
Hi, I'm trying to add function calls in the LLVM IR using the IRBuilder class. I've read both tutorials about functions but I still get assertion errors. I allocate memory for all function arguments and pass them as explained in the tutorial. My code is (this function is supposed to add a call to f in bb at pos): void addCallSite(Function *f, BasicBlock *bb, BasicBlock::iterator pos)
2009 Nov 11
0
[LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error
CreateAlloca(Type) returns an object of type Type*, the memory that can hold an object of type Type. You probably don't want to be creating allocas just before calling the function since 1) if that call winds up in a loop they'll grow your stack frame without bound, and 2) the memory they point to is initially uninitialized. Where did the tutorial tell you to do that? In general, when I
2013 Jan 15
2
[LLVMdev] [cfe-dev] no-alias generated as result of restrict function arguments
On Wed, Dec 12, 2012 at 01:59:55PM -0800, Dan Gohman wrote: > The bug here isn't in clang's use of noalias or in BasicAliasAnalysis' > implementation of noalias; it's in the code that's optimizing the > icmp. Let's come back to this. The attached patch decouples InstSimplify from the alias analysis and provides the conservative logic for when pointers are not
2012 Dec 12
0
[LLVMdev] [cfe-dev] no-alias generated as result of restrict function arguments
On Wed, Dec 12, 2012 at 1:26 PM, Joerg Sonnenberger <joerg at britannica.bec.de> wrote: > On Wed, Dec 12, 2012 at 11:01:01AM -0800, Dan Gohman wrote: >> > Is that >> > assumption violated if I explicitly cast away const and pass the result >> > to a function with NoAlias argument? >> >> Not immediately, no. It means that you can't access the
2012 Dec 12
3
[LLVMdev] [cfe-dev] no-alias generated as result of restrict function arguments
On Wed, Dec 12, 2012 at 11:01:01AM -0800, Dan Gohman wrote: > > Is that > > assumption violated if I explicitly cast away const and pass the result > > to a function with NoAlias argument? > > Not immediately, no. It means that you can't access the constant > pointer's pointee directly within the noalias argument's scope. Access > to that object must go
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
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
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
2011 Jun 06
2
[LLVMdev] Explanation
Hi All, I am trying to check if a Value type is a int32 pointer by using if(T == Type::getInt1PtrTy(Context, AS)) ... I am trying to understand the AS (address space). How do I get it? Thanks. George * * -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110606/775e4f09/attachment.html>
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
2014 Aug 04
3
[LLVMdev] LLVM AllocaInst and StoreInst
Hi, I am trying to write a simple interpreter. I am trying to generate LLVM IR for assignment operation. The code for the generation part looks like this llvm::Value* codeGenSymTab(llvm::LLVMContext& context) { > printf("\n CodeGen SymTab \n"); > Value *num = ConstantInt::get(Type::getInt64Ty(context), aTable.value, > true); > Value *alloc = new
2009 Oct 20
3
[LLVMdev] Dereference PointerType?
Hello, I'm wondering if it's possible to dereference a PointerType. I have an AllocaInst and although I can find the number of elements allocated, (using Instruction::getOperand(0)), I can't find a way to get the size of each element. What I'd like to do is: AllocaInst *alloca; PointerType *ptr_type = dynamic_cast<PointerType*>(alloca); assert(ptr_type); Type
2015 Dec 03
3
Function attributes for LibFunc and its impact on GlobalsAA
----- Original Message ----- > From: "James Molloy via llvm-dev" <llvm-dev at lists.llvm.org> > To: "Vaivaswatha Nagaraj" <vn at compilertree.com> > Cc: "LLVM Dev" <llvm-dev at lists.llvm.org> > Sent: Thursday, December 3, 2015 4:41:46 AM > Subject: Re: [llvm-dev] Function attributes for LibFunc and its impact on GlobalsAA > >
2011 Jun 06
0
[LLVMdev] Explanation
On 6 June 2011 17:08, George Baah <georgebaah at gmail.com> wrote: > if(T == Type::getInt1PtrTy(Context, AS)) ... Hi, You don't need to care about address spaces to check for an int32*: if (T->isPointerTy()) { const Type* intT = cast<PointerType>(T)->getElementType(); if (intT->isIntegerTy() && intT->getPrimitiveSizeInBits() == 32) cout <<
2013 Feb 25
2
[LLVMdev] Queries regarding function's arguments data type
Hi all, I am working on my Master's project in security and I am trying to iterate over the argument list of the function. Basically I need to do following things : 1. Check data type of each argument of the argument list of the function. 2. Based on its data type like character array or integer array, pointer, int, char, take different action. 3. I have added following code to check its
2008 Jun 28
2
[LLVMdev] need to store the address of a variable
Hello everybody, my problem is, that I want to get an array of pointers to all local variables in a function. This array will be used for transfering these Variables to another execution engine. I've code which generates this array, and a pointer to the target field of the array. name = variables.fname + "_pointerArray"; Instruction* pointerArray = new
2011 Oct 06
2
[LLVMdev] Initializing GC roots
Hello all, I set: InitRoots = true; in my gc plugin as i want the roots to be initialized to the "null" value. Is there a way to define which value should be the initial one? For example, i would like to initialize my roots to -5 (tagged, null value for the GC in my runtime system) instead of 0. Ofcourse, i could do it in the frontend (storing -5 to all GC roots), but i was wondering
2012 Feb 15
2
[LLVMdev] Wrong AliasAnalysis::getModRefInfo result
Just want to test out the LLVM's AliasAnalysis::getModRefInfo API. The input C code is very simple: void foo(int *a, int *b) { for(int i=0; i<10; i++) b[i] = a[i]*a[i]; } int main() { int a[10]; int b[10]; for(int i=0; i<10; i++) a[i] = i; foo(a,b); return 0; } Obviously, for "foo", it only reads from array "a" and only writes to array
2008 Nov 07
2
[LLVMdev] non-pointer gcroot
Hi I'm getting an assert in LowerIntrinsics::InsertRootInitializers because I'm gcroot'ing an alloca to a non-pointer. I was hoping to modify InsertRootInitializers to memset the structure in the case that it's not a pointer, but I'm not sure how to. Can anyone suggest what should go at "todo; something here"? ... for (AllocaInst **I = Roots, **E = Roots +