similar to: [LLVMdev] Accessing merged globals through PointerType

Displaying 20 results from an estimated 140 matches similar to: "[LLVMdev] Accessing merged globals through PointerType"

2009 Oct 20
0
[LLVMdev] Dereference PointerType?
2009/10/20 Daniel Waterworth <da.waterworth at googlemail.com> > 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
2009 Oct 20
1
[LLVMdev] Dereference PointerType?
Hi Daniel, > Type *allocated_type = ptr_type->dereference(); // this is the > operation that doesn't seem to exist. Type *allocated_type = ptr_type->getElementType(); Ciao, Duncan.
2009 Oct 20
2
[LLVMdev] Dereference PointerType?
Daniel Waterworth <da.waterworth at googlemail.com> writes: [snip] Use the getElementType method of PointerType. >> size_t size; >> if (isa<PointerType>(allocated_type)) { >> size = sizeof(void*) * 8; >> } else { >> size = allocated_type->getPrimitiveSizeInBits(); >> } >> // size now equals the size (in bits) of the type allocated
2009 Oct 20
0
[LLVMdev] Dereference PointerType?
Óscar Fuentes wrote: > Daniel Waterworth <da.waterworth at googlemail.com> writes: > > [snip] > > Use the getElementType method of PointerType. > >>> size_t size; >>> if (isa<PointerType>(allocated_type)) { >>> size = sizeof(void*) * 8; >>> } else { >>> size = allocated_type->getPrimitiveSizeInBits(); >>>
2009 Oct 20
0
[LLVMdev] Dereference PointerType?
Daniel Waterworth <da.waterworth at googlemail.com> writes: > It may not be the best way to do what I'm trying to do, but it's not useless > and bogus. Consider the following: > > %1 = alloca i32* ; %1 is of type i32**, dereferenced it becomes a type i32* > and > ; the size of that is sizeof(void *) bytes What Duncan says is that any valid
2009 Oct 20
0
[LLVMdev] Dereference PointerType?
Hi Daniel, > It may not be the best way to do what I'm trying to do, but it's not > useless and bogus. Consider the following: > > %1 = alloca i32* ; %1 is of type i32**, dereferenced it becomes a type > i32* and > ; the size of that is sizeof(void *) bytes it is useless because getTypeAllocSize will handle any type, including pointer types.
2013 Jul 29
1
[LLVMdev] PointerType without body, post-construction set type?
With StructType you can create an empty structure and then call setBody later. How can one do the same thing with a PointerType? I'm translating a recursive structure which includes pointers to itself. I end up creating multiple copies of logically equivalent pointer types. -- edA-qa mort-ora-y -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Sign: Please digitally
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
2007 Dec 17
0
[LLVMdev] PointerType API Change
On 2007-12-17, at 00:31, Christopher Lamb wrote: > The API for getting PointerType objects has just changed to make > Embedded C address space information explicit. The old semantics of > PointerType::get() now apply to PointerType::getUnqual(), which > returns a pointer in the generic address space. PointerType::get() > now requires both a type and an address space. >
2007 Dec 17
0
[LLVMdev] PointerType API Change
On Dec 17, 2007, at 2:51 AM, Torvald Riegel wrote: > On Monday 17 December 2007, Christopher Lamb wrote: >> On Dec 17, 2007, at 1:22 AM, Torvald Riegel wrote: >>> Would it be possible to keep get() unchanged, with a default >>> behaviour, plus >>> a warning? Otherwise everybody (assuming everybody gets type void*) >>> will >>> have to update
2016 Oct 31
0
RFC: PointerType should derive from Type rather than SequentialType
On Mon, Oct 31, 2016 at 1:43 PM Peter Collingbourne <peter at pcc.me.uk> wrote: > Thanks David. I ended up trying this over the weekend (see > https://github.com/llvm-project/llvm-project/compare/master...pcc:pointertype). > It ended up being a net reduction in code size so seems like a useful > cleanup even independent of the typeless pointer work, I'll see if I can >
2007 Dec 17
0
[LLVMdev] PointerType API Change
On Dec 16, 2007, at 10:22 PM, Anton Korobeynikov wrote: > Christopher, > >> The API for getting PointerType objects has just changed to make >> Embedded C address space information explicit. The old semantics of >> PointerType::get() now apply to PointerType::getUnqual(), which >> returns a pointer in the generic address space. PointerType::get() >> now
2009 Oct 20
4
[LLVMdev] Dereference PointerType?
It may not be the best way to do what I'm trying to do, but it's not useless and bogus. Consider the following: %1 = alloca i32* ; %1 is of type i32**, dereferenced it becomes a type i32* and ; the size of that is sizeof(void *) bytes Having said that I am looking at the target data getTypeAllocSize method. Daniel 2009/10/20 Duncan Sands <baldrick at
2007 Dec 17
0
[LLVMdev] PointerType API Change
On Dec 17, 2007, at 1:22 AM, Torvald Riegel wrote: > Would it be possible to keep get() unchanged, with a default > behaviour, plus > a warning? Otherwise everybody (assuming everybody gets type void*) > will > have to update their LLVM passes, and either maintain two versions > of the > passes or require their clients to use a certain LLVM version. AFAIK API
2007 Dec 17
3
[LLVMdev] PointerType API Change
Christopher, > The API for getting PointerType objects has just changed to make > Embedded C address space information explicit. The old semantics of > PointerType::get() now apply to PointerType::getUnqual(), which > returns a pointer in the generic address space. PointerType::get() now > requires both a type and an address space. What is the reason of such change? -- With best
2007 Dec 17
3
[LLVMdev] PointerType API Change
The API for getting PointerType objects has just changed to make Embedded C address space information explicit. The old semantics of PointerType::get() now apply to PointerType::getUnqual(), which returns a pointer in the generic address space. PointerType::get() now requires both a type and an address space. The clang, llvm-gcc-4.0, and llvm-gcc-4.2, and internal llvm projects have all
2007 Dec 17
2
[LLVMdev] PointerType API Change
On Monday 17 December 2007, Christopher Lamb wrote: > On Dec 17, 2007, at 1:22 AM, Torvald Riegel wrote: > > Would it be possible to keep get() unchanged, with a default > > behaviour, plus > > a warning? Otherwise everybody (assuming everybody gets type void*) > > will > > have to update their LLVM passes, and either maintain two versions > > of the >
2016 Oct 31
0
RFC: PointerType should derive from Type rather than SequentialType
Seems pretty plausible to me - my only question would be whether it's worth the churn to do this intermediate step before finishing off typeless pointers (granted, I've stalled out on that for nearly a year, admittedly - but good to have extra hands/incentives - there's still a fair bit of work to do though, so understandable if it might not be useful to block progress on other things
2007 Dec 17
2
[LLVMdev] PointerType API Change
Would it be possible to keep get() unchanged, with a default behaviour, plus a warning? Otherwise everybody (assuming everybody gets type void*) will have to update their LLVM passes, and either maintain two versions of the passes or require their clients to use a certain LLVM version. Then passes could be "address-space-safe" or not. If the default parameter value for get() could
2016 Oct 30
2
RFC: PointerType should derive from Type rather than SequentialType
Hi all, An oddity that has existed for a long time in the IR is that PointerType derives from SequentialType. Per subject I propose to make PointerType derive from Type for a couple of reasons: - Values of type PointerType are unlike the other SequentialTypes (arrays and vectors) in that they do not hold values of the element type. By moving PointerType we can unify certain aspects of how the