search for: pointertyid

Displaying 20 results from an estimated 29 matches for "pointertyid".

Did you mean: pointerty
2010 May 28
2
[LLVMdev] Retrieving Underlying Type from AllocaInst
...with the CreateAlloca instruction so I can see if I need to do type conversion before the store instruction, However, I cannot simply use: alloca->getType()->isDoubleTy() etc. because this doesn't return true in the above case. The ID of the Ty member of the VTy member of the alloca is PointerTyID instead of DoubleTyID as the construction for AllocaInst::AllocaInst seems to create a PointerType pointing to the original type. I was hoping for a member function of the alloca that would return the original type that was passed to CreateAlloca. I can test for a PointerTyID and then perform a c...
2010 May 28
0
[LLVMdev] Retrieving Underlying Type from AllocaInst
...uction so I can see if I need to do type conversion before the > store instruction, However, I cannot simply use: > > alloca->getType()->isDoubleTy() etc. > > because this doesn't return true in the above case. The ID of the Ty > member of the VTy member of the alloca is PointerTyID instead of > DoubleTyID as the construction for AllocaInst::AllocaInst seems to > create a PointerType pointing to the original type. > > I was hoping for a member function of the alloca that would return the > original type that was passed to CreateAlloca. I can test for a > Poin...
2010 May 28
2
[LLVMdev] Retrieving Underlying Type from AllocaInst
...eed to do type conversion before the >> store instruction, However, I cannot simply use: >> >> alloca->getType()->isDoubleTy() etc. >> >> because this doesn't return true in the above case. The ID of the Ty >> member of the VTy member of the alloca is PointerTyID instead of >> DoubleTyID as the construction for AllocaInst::AllocaInst seems to >> create a PointerType pointing to the original type. >> >> I was hoping for a member function of the alloca that would return the >> original type that was passed to CreateAlloca. I can...
2004 Jul 01
1
[LLVMdev] Add assert in llvm::StroreInst::init and llvm::LoadInst::init
...silly error (swap arguments in llvm::StroreInst constructor call: llvm::Value* var = genExpr(bb,*varExpr,false); llvm::Value* val = genExpr(bb,*valExpr,true ); llvm::StoreInst* lStore = new llvm::StoreInst(var,val,bb); instead assert(var && var->getType()->getTypeID()==llvm::Type::PointerTyID && "var side isn't pointer type"); llvm::StoreInst* lStore = new llvm::StoreInst(val,var,bb); For val with type T* and var with type T** error catched in verifier: Stored value type does not match pointer operand type! store "Type10::Class1"** %result, &quo...
2010 May 28
0
[LLVMdev] Retrieving Underlying Type from AllocaInst
...I can see if I need to do type conversion before the > > store instruction, However, I cannot simply use: > > alloca->getType()->isDoubleTy() etc. > > because this doesn't return true in the above case. The ID of the Ty > > member of the VTy member of the alloca is PointerTyID instead of > > DoubleTyID as the construction for AllocaInst::AllocaInst seems to > > create a PointerType pointing to the original type. > > I was hoping for a member function of the alloca that would return the > > original type that was passed to CreateAlloca. I can test...
2007 Feb 05
0
[LLVMdev] automatically generating intrinsic declarations
On Mon, 5 Feb 2007, Dan Gohman wrote: > LLVM knows what all the types of the intrinsic functions are; I thought, > why are users (including llvm-gcc...) required to duplicate all this > information in order to use them? I mean in order to call > getOrInsertFunction to get declarations for them. That is an excellent question! :) In the bad old days, we used to allow intrinsics
2004 Jun 17
3
[LLVMdev] Primitive types
Hello, I'm getting this in debugger, where 't' is 'Type*': (gdb) p t->isPrimitiveType() $15 = false (gdb) p t->getPrimitiveID() $16 = PointerTyID (gdb) p t->getPrimitiveSize() $17 = 0 There are a couple of things that I'd like to ask. First, if isPrimitiveType() returns false, that the fact that getPrimitiveID returns reasonable value is quite strange. Maybe, the method is better called just getID, since it can get id for bo...
2007 Feb 06
1
[LLVMdev] automatically generating intrinsic declarations
...file: /var/cvs/llvm/llvm/include/llvm/Intrinsics.td,v retrieving revision 1.41 diff -u -r1.41 Intrinsics.td --- include/llvm/Intrinsics.td +++ include/llvm/Intrinsics.td @@ -68,6 +68,15 @@ LLVMType ElTy = elty; } +class LLVMPointerType<LLVMType elty> + : LLVMType<iPTR, "Type::PointerTyID">{ + LLVMType ElTy = elty; +} + +class LLVMEmptyStructType + : LLVMType<OtherVT, "Type::StructTyID">{ +} + def llvm_void_ty : LLVMType<isVoid, "Type::VoidTyID">; def llvm_bool_ty : LLVMIntegerType<i1, 1>; def llvm_i8_ty : LLVM...
2007 May 16
1
[LLVMdev] tiny compilation error with g++ 4.1.3
...st llvm::Type*)': /usr/src/Lang/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1347: error: cast from 'void*' to 'unsigned int' loses precision The trivial patch which works for me is to use intptr_t instead of unsigned, hence replacing the faulty line with case Type::PointerTyID: DOUT << "void* " << (intptr_t)(Val.PointerVal); break; Regards -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359 8, rue de la Faïencerie, 92340 Bourg La Reine, France *** opinions {a...
2007 Feb 05
2
[LLVMdev] automatically generating intrinsic declarations
LLVM knows what all the types of the intrinsic functions are; I thought, why are users (including llvm-gcc...) required to duplicate all this information in order to use them? I mean in order to call getOrInsertFunction to get declarations for them. So I wrote this patch, which allows all this code to be generated automatically. Is this a good approach? Dan -- Dan Gohman, Cray Inc. <djg at
2008 Nov 07
2
[LLVMdev] non-pointer gcroot
.... Can anyone suggest what should go at "todo; something here"? ... for (AllocaInst **I = Roots, **E = Roots + Count; I != E; ++I) if (!InitedRoots.count(*I)) { const Type* Ty = cast<PointerType>((*I)->getType())->getElementType(); if (Ty->getTypeID() == Type::PointerTyID) { new StoreInst(ConstantPointerNull::get(cast<PointerType>(Ty)), *I, IP); } else { // todo; something here } MadeChange = true; } ... thanks, scott
2007 Nov 25
2
[LLVMdev] C embedded extensions and LLVM
...> explaining >>> what the difference is though. :) >> > > Should have said: > >> Should I take the same approach to the encoding of pointer types in >> the types table? PointerTypes are a bit easier. The code to write them looks like this: case Type::PointerTyID: // POINTER: [pointee type] Code = bitc::TYPE_CODE_POINTER; TypeVals.push_back(VE.getTypeID(cast<PointerType>(T)- >getElementType())); The code to read them look like this: case bitc::TYPE_CODE_POINTER: // POINTER: [pointee type] if (Record.size() &l...
2004 Jun 17
0
[LLVMdev] Primitive types
On Thu, 17 Jun 2004, Vladimir Prus wrote: > I'm getting this in debugger, where 't' is 'Type*': > > (gdb) p t->isPrimitiveType() > $15 = false > (gdb) p t->getPrimitiveID() > $16 = PointerTyID > (gdb) p t->getPrimitiveSize() > $17 = 0 > > There are a couple of things that I'd like to ask. First, if > isPrimitiveType() returns false, that the fact that getPrimitiveID > returns reasonable value is quite strange. Maybe, the method is better > called just g...
2008 Sep 08
0
[LLVMdev] Problems when refining type
On Mon, Sep 8, 2008 at 2:45 PM, Scott Graham <scott.llvm at h4ck3r.net> wrote: > LLVMTypeRef a = LLVMPointerType(LLVMOpaqueType(), 0); > LLVMTypeHandleRef ha = LLVMCreateTypeHandle(a); > LLVMTypeRef atypes[1] = { LLVMResolveTypeHandle(ha) }; > LLVMRefineType(LLVMResolveTypeHandle(ha), LLVMStructType(atypes, 1, 0)); > > Can anyone explain what I'm doing wrong
2007 Oct 11
0
[LLVMdev] Can't bootstrap llvm-gcc-4.0 for x84_64
Hi David, > "LLVM type size doesn't match GCC type size!"' failed. this assertion checks that gcc types are converted into LLVM types of the same size. Try running cc1 in gdb. When you hit the assertion, go up a few stack frames until you get to ConvertType. Do call debug_tree(type) That will tell you what the gcc type was. From that and the LLVM type it should be clear
2008 Nov 08
0
[LLVMdev] non-pointer gcroot
...go at "todo; something here"? > > ... > for (AllocaInst **I = Roots, **E = Roots + Count; I != E; ++I) > if (!InitedRoots.count(*I)) { > const Type* Ty = cast<PointerType>((*I)->getType())- > >getElementType(); > if (Ty->getTypeID() == Type::PointerTyID) { > new StoreInst(ConstantPointerNull::get(cast<PointerType>(Ty)), > *I, IP); > } else { > // todo; something here > } > MadeChange = true; > } > ... Hi Scott, Using the new support for first-class aggregate values, you should be abl...
2007 Nov 25
0
[LLVMdev] C embedded extensions and LLVM
On Nov 24, 2007, at 7:47 PM, Christopher Lamb wrote: > > On Nov 21, 2007, at 6:22 PM, Chris Lattner wrote: > >> On Wed, 21 Nov 2007, Christopher Lamb wrote: >>>> Unlike alignment and volatility, I think that the address space >>>> qualifier >>>> should be represented explicitly in the type system. The >>>> reason for this
2007 Oct 11
3
[LLVMdev] Can't bootstrap llvm-gcc-4.0 for x84_64
...ype was. From that > and the LLVM type it should be clear what the ultimate > cause of the problem was. Ok, I think this must be related to the warning about 64-bit code. debug_type reveals the gcc type to be a function pointer of size 32, which would indicate 32-bit code. The llvm type is PointerTyID of size 64, indicating 64-bit code. This happens at line 796 of llvm-types.cpp: if (Ty->getTypeID() == Type::VoidTyID) Ty = Type::Int8Ty; // void* -> sbyte* return TypeDB.setType(type, PointerType::get(Ty)); Somehow PointerType::get is returning a 64-bit pointer even...
2010 Jan 09
0
[LLVMdev] [PATCH] - Union types, attempt 2
...NULL, NULL. + static UnionType *get(LLVMContext &Context, + const Type *type, ...) END_WITH_NULL; Please update the comments. Also, if you disallow empty unions here, you don't need to pass a context. +++ include/llvm/Type.h (working copy) @@ -86,6 +86,7 @@ PointerTyID, ///< 12: Pointers OpaqueTyID, ///< 13: Opaque: type with unknown structure VectorTyID, ///< 14: SIMD 'packed' format, or other vector type + UnionTyID, ///< 15: Unions Please put this up next to Struct for simplicity, the numbering here doesn...
2008 Jan 29
1
[LLVMdev] C embedded extensions and LLVM
...> explaining >>> what the difference is though. :) >> > > Should have said: > >> Should I take the same approach to the encoding of pointer types in >> the types table? PointerTypes are a bit easier. The code to write them looks like this: case Type::PointerTyID: // POINTER: [pointee type] Code = bitc::TYPE_CODE_POINTER; TypeVals.push_back(VE.getTypeID(cast<PointerType>(T)- >getElementType())); The code to read them look like this: case bitc::TYPE_CODE_POINTER: // POINTER: [pointee type] if (Record.size() &l...