similar to: [LLVMdev] Dereference PointerType?

Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] Dereference 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
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
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
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
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 16
3
[LLVMdev] MallocInst/CallInst bitcast,
On Oct 16, 2009, at 4:43 AM, Daniel Waterworth wrote: > Never mind, I used ExecutionEngine's InstallLazyFunctionCreator and > DisableSymbolSearching to cause malloc and free calls to be handled > by my logging functions. Sorry for the unnecessary list mail. No problem, this is a better way to go. The MallocInst and FreeInst instructions are about to be removed from LLVM IR.
2009 Oct 16
0
[LLVMdev] MallocInst/CallInst bitcast,
Thanks very much. I only have one more question, (hopefully), which is, is there a better way of finding the direction of stack growth other than: static bool StackCmp(void *ptr) { volatile int a; return (void *)&a > ptr; } bool FindStackDirection() { volatile int a; return StackCmp((void *)&a); } Preferably one which isn't destroyed by optimization. Thanks again,
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.
2009 Oct 16
2
[LLVMdev] MallocInst/CallInst bitcast,
Hello, I'm writing a virtual machine that functions as a sandbox based on llvm. In order to prevent programs from accessing memory that has not been allocated to them, I want to replace calls to malloc and free with calls to a logged functions that will record the memory that is being allocated to the program. Is it possible to cast/convert a MallocInst or FreeInst to a CallInst? Thanks,
2009 Oct 16
0
[LLVMdev] MallocInst/CallInst bitcast,
Never mind, I used ExecutionEngine's InstallLazyFunctionCreator and DisableSymbolSearching to cause malloc and free calls to be handled by my logging functions. Sorry for the unnecessary list mail. Is it possible to find out the size and beginning pointer of the current stack frame, from a function operating outside of the virtual machine, but called by a function within it? Thanks, Daniel
2014 Nov 05
3
[LLVMdev] How to lower the intrinsic function 'llvm.objectsize'?
The documentation of LLVM says that "The llvm.objectsize intrinsic is lowered to a constant representing the size of the object concerned". I'm attempting to lower this intrinsic function to a constant in a pass. Below is the code snippet that I wrote: for (BasicBlock::iterator i = b.begin(), ie = b.end(); (i != ie) && (block_split == false);) { IntrinsicInst *ii =
2012 Aug 30
2
[LLVMdev] dynamic_cast error detection
Hi all, I'm trying to convert our code base from GCC 4.0 to LLVM (on mac OS X), and ran into a problem. In the past we used mach_override and the dynamic_cast source to override the built-in dynamic_cast operator to detect shared library issues (http://gcc.gnu.org/faq.html#dso). Basically we'd assert at runtime when a duplicated RTTI is found, giving us a chance to backtrace the offending
2012 Oct 04
2
[LLVMdev] TableGen: Requesting feedback for "TGContext"
Thanks for the feedback! >> Does anybody have anything else they think should go into TGContext or >> any other responsibilities it should have? Or any feedback about the >> idea in general? > > All memory allocations should go into its bump pointer, RecordKeeper should as well. Any other global state that exist should also. Sounds good. >> I'm also hoping
2016 Oct 07
3
RuntimeDyLdCOFF and RTTI on Windows
HI Stefan, CC'ing Reid Kleckner, who might have some insight here, and llvm-dev as this may be of interest to other windows JIT users. I am facing the issue that C++ dynamic_cast doesn't work for types > loaded from object files with RuntimeDyLd. <snip> Do you think it is possible that RuntimeDyLd misses type info data in > the COFF file or doesn't wire it up
2010 May 28
4
[LLVMdev] how to get TargetData?
Dear all I am trying to get the size of an LLVM pointer type. getPrimitiveSizeInBits() returns 0 for it and the documentation for isSized() suggest to use TargetData. I figured out from Kaleidoscope example that one can get a pointer to TagetData object through the execution engine but it seems to be an overkill. What is the right way to do it? Best regards, Victor -------------- next part
2012 Oct 04
7
[LLVMdev] TableGen: Requesting feedback for "TGContext"
Hi all, I'm sure that the last thing that you want to think about is TableGen's guts, but I'm pursuing a course in bringing TableGen up to snuff with the rest of LLVM. Basically, I would like to introduce a "TGContext" class (by analogy with LLVMContext) to harbor a proper unique'd type system and BumpPtr allocate all of TableGen's data (RecTy's, Record's,
2010 Nov 13
3
[LLVMdev] dyn_cast vs. dynamic_cast
LLVM has a relatively large number of proprietary replacements for standard C++ functions and classes. One of these is dyn_cast to replace dynamic_cast. The two calls appear to be semantically equivalent; the only difference that I can see is that dyn_cast reportedly works on classes that have no v-table [1]. Could someone please explain why I should use dyn_cast instead of dynamic_cast?
2012 Oct 04
0
[LLVMdev] TableGen: Requesting feedback for "TGContext"
It won't cause a negative effect, go for it! Dynamic_cast is realllly slow compared to dyn_cast, it is worth the memory. -Chris On Oct 3, 2012, at 9:39 PM, Sean Silva <silvas at purdue.edu> wrote: > Thanks for the feedback! > >>> Does anybody have anything else they think should go into TGContext or >>> any other responsibilities it should have? Or any
2012 Sep 02
0
[LLVMdev] dynamic_cast error detection
Hi Akos, you should send this to the clang mailing list instead. Ciao, Duncan. > I'm trying to convert our code base from GCC 4.0 to LLVM (on mac OS X), and ran > into a problem. In the past we used mach_override and the dynamic_cast source to > override the built-in dynamic_cast operator to detect shared library issues > (http://gcc.gnu.org/faq.html#dso). Basically we'd