search for: getcontainedtyp

Displaying 11 results from an estimated 11 matches for "getcontainedtyp".

Did you mean: getcontainedtype
2011 Apr 15
0
[LLVMdev] llvm instrinsic (memcpy/memset/memmov)and ConstantExpression with cast
...the type as Pointer and > hence the size to be 8 bytes. > This is because all global variables in LLVM are pointers to the actual data in memory. What you need to do is: if (GlobalVariable * GV = dyn_cast<GlobalVariable>(CE->getArgument(0)) { Type * T = GV->getType()->getContainedType(); } > > I would like to get the type as StructTy and size to be 4 bytes. I > searched through the llvm code > > Any help is appreciated. > -- John T. > Thanks > > Sreekumar > > > _______________________________________________ > LLVM Developers mailing li...
2011 Apr 14
2
[LLVMdev] llvm instrinsic (memcpy/memset/memmov)and ConstantExpression with cast
Hi All, I have a question on ConstantExpressions and llvm intrinsic memcpy/memset/memmove. I am using llvm-2.8 release. In one of the C programs that I am compiling using clang frontend, the call to memcpy instrinsic looks like the following call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp2, i8* bitcast (%struct.ta* @tret to i8*), i64 4, i32 4, i1 false), !dbg !19 The second argument to memcpy is
2010 Apr 21
2
[LLVMdev] GlobalValue type
I tried to get the Type for a global value, but it always returns me a PointerType. This is ok, expect that I want to know what type is being pointed at. How do I do this?
2010 Apr 21
0
[LLVMdev] GlobalValue type
...You can utilize the doxygen docs (http://llvm.org/doxygen/hierarchy.html) to find which methods of classes give you the information you want. For example, you can look up the PointerType class and see the methods it provides. One of its methods returns the type it contains (I think it's getContainedType() or something like that; I don't recall the name exactly, but you can use doxygen to find it). -- John T. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/...
2010 Jan 18
5
[LLVMdev] [patch] Union Types - work in progress
...if (const UnionType* utype = dyn_cast<UnionType>(Ty)) { + if (const StructType* stype = dyn_cast<StructType>( + ID.ConstantVal->getType())) { + if (stype->getNumContainedTypes() == 1) { + int index = utype->getElementTypeIndex(stype- >getContainedType(0)); + if (index >= 0) { + V = ConstantUnion::get( + utype, cast<Constant>(ID.ConstantVal- >getOperand(0))); + return false; + } + } + } + } + Please split this out to a static helper function that...
2010 Jan 28
0
[LLVMdev] [patch] Union Types - work in progress
...utype = dyn_cast<UnionType>(Ty)) { > + if (const StructType* stype = dyn_cast<StructType>( > + ID.ConstantVal->getType())) { > + if (stype->getNumContainedTypes() == 1) { > + int index = > utype->getElementTypeIndex(stype->getContainedType(0)); > + if (index >= 0) { > + V = ConstantUnion::get( > + utype, cast<Constant>(ID.ConstantVal->getOperand(0))); > + return false; > + } > + } > + } > + } > + > > Ple...
2010 Jan 28
0
[LLVMdev] [patch] Union Types - work in progress
...utype = dyn_cast<UnionType>(Ty)) { > + if (const StructType* stype = dyn_cast<StructType>( > + ID.ConstantVal->getType())) { > + if (stype->getNumContainedTypes() == 1) { > + int index = > utype->getElementTypeIndex(stype->getContainedType(0)); > + if (index >= 0) { > + V = ConstantUnion::get( > + utype, cast<Constant>(ID.ConstantVal->getOperand(0))); > + return false; > + } > + } > + } > + } > + > > Ple...
2009 Apr 01
0
[LLVMdev] Type operator defenition
...manipulate objects. For example each time there is an expression: class int_t : some_custom_interger ; int_t a, b; ... a + b we have to do : O(n) const Type* ta = typeof("a"); for (int i=0, e=ta->getNumContainedTypes(); i<e; i++) if( isa<Function>(*ta->getContainedType(i)) ) if( ta->getName() == "$operator +" ) call(function, valueof("a"), valueof("b") ); where else we could do something like: O(1) enum { operator_add = 0, ... } ; call( typeof("a")->operator[operator_add], valueof(&quot...
2010 Jan 16
0
[LLVMdev] [patch] Union Types - work in progress
OK here's the patch for real this time :) On Fri, Jan 15, 2010 at 4:36 PM, Talin <viridia at gmail.com> wrote: > Here's a work in progress of the union patch. Note that the test "union.ll" > does not work, so you probably don't want to check this in as is. However, > I'd be interested in any feedback you're willing to give. > > -- > -- Talin
2010 Jan 16
2
[LLVMdev] [patch] Union Types - work in progress
Here's a work in progress of the union patch. Note that the test "union.ll" does not work, so you probably don't want to check this in as is. However, I'd be interested in any feedback you're willing to give. -- -- Talin -------------- next part -------------- An HTML attachment was scrubbed... URL:
2010 Feb 10
3
[LLVMdev] [patch] Union Types - work in progress
...UnionType>(Ty)) { >> + if (const StructType* stype = dyn_cast<StructType>( >> + ID.ConstantVal->getType())) { >> + if (stype->getNumContainedTypes() == 1) { >> + int index = >> utype->getElementTypeIndex(stype->getContainedType(0)); >> + if (index >= 0) { >> + V = ConstantUnion::get( >> + utype, cast<Constant>(ID.ConstantVal->getOperand(0))); >> + return false; >> + } >> + } >> + } >&g...