search for: getnumcontainedtyp

Displaying 10 results from an estimated 10 matches for "getnumcontainedtyp".

Did you mean: getnumcontainedtypes
2004 Dec 14
0
[LLVMdev] misc. patches
...========================= > RCS file: /var/cvs/llvm/llvm/include/llvm/Type.h,v > retrieving revision 1.67 > diff -u -r1.67 Type.h > --- include/llvm/Type.h 19 Nov 2004 16:39:04 -0000 1.67 > +++ include/llvm/Type.h 13 Dec 2004 13:11:57 -0000 > @@ -246,7 +246,8 @@ > > /// getNumContainedTypes - Return the number of types in the derived type. > /// > - unsigned getNumContainedTypes() const { return ContainedTys.size(); } > + typedef std::vector<PATypeHandle>::size_type size_type; > + size_type getNumContainedTypes() const { return ContainedTys.size(); } > &...
2004 Dec 13
6
[LLVMdev] misc. patches
Hi, here are some minor patches that for various reasons I've not submitted yet - I'm just trying to clear my list of differences before christmas... First of all the clear.patch file contains a patch that enables the JIT to drop all global mappings. I need this because when I have N threads I compile N different versions of my functions using different memory areas for global
2010 Jan 18
5
[LLVMdev] [patch] Union Types - work in progress
...to a union, if the union has a member which is the same type + // as the struct member. + 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; +...
2010 Jan 28
0
[LLVMdev] [patch] Union Types - work in progress
...has a member which is the same type > + // as the struct member. > + 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))); > +...
2010 Jan 28
0
[LLVMdev] [patch] Union Types - work in progress
...has a member which is the same type > + // as the struct member. > + 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))); > +...
2009 Apr 01
0
[LLVMdev] Type operator defenition
...r this seperate container is because most of languages defined operators to 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(...
2015 Feb 27
0
[LLVMdev] using a structs datafield as operand
...e could be a double typed datafield of a struct. The typefinder shows how to recursively crawl types using llvm::Type::subtype_reverse_iterator and thereby compiles a list of types occuring in the module. I could determine when I arrived at the 'deepest' level (an actual datafield) by getNumContainedTypes() (returns 0 in this case). Suppose I descended from e.g. a global struct down to a double field (of that struct). How and which information would I extract/store in order to be able to use the datafield as operand to an instruction later on? Thanks Alex
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
...s the same type >> + // as the struct member. >> + 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)));...