search for: parseuniontyp

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

Did you mean: parseuniontype
2010 Feb 10
0
[LLVMdev] [patch] Union Types - work in progress
...e a better predicate somewhere? +LLVMTypeRef LLVMUnionTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, + unsigned ElementCount) { + std::vector<const Type*> Tys; + for (LLVMTypeRef *I = ElementTypes, + indentation of unsigned and use smallvector. +/// ParseUnionType +/// TypeRec +/// ::= 'union' '{' '}' +/// ::= 'union' '{' TypeRec (',' TypeRec)* '}' +bool LLParser::ParseUnionType(PATypeHolder &Result) { Unions can't be empty, so the first grammar production isn't valid. Otherwise...
2010 Feb 10
3
[LLVMdev] [patch] Union Types - work in progress
...n 93451) >> >> +template<> >> +struct ConstantKeyData<ConstantUnion> { >> + typedef Constant* ValType; >> + static ValType getValType(ConstantUnion *CS) { >> >> CU not CS. >> >> >> LLParser.cpp: >> >> In LLParser::ParseUnionType, you can use SmallVector instead of >> std::vector for ParamsList & ParamsListTy. >> >> @@ -2135,7 +2173,8 @@ >> ParseToken(lltok::rparen, "expected ')' in extractvalue >> constantexpr")) >> return true; >> >> -...
2010 Feb 12
1
[LLVMdev] [patch] Union Types - work in progress
...InContext(LLVMContextRef C, LLVMTypeRef > *ElementTypes, > + unsigned ElementCount) { > + std::vector<const Type*> Tys; > + for (LLVMTypeRef *I = ElementTypes, > + > > indentation of unsigned and use smallvector. > > Done. > > +/// ParseUnionType > +/// TypeRec > +/// ::= 'union' '{' '}' > +/// ::= 'union' '{' TypeRec (',' TypeRec)* '}' > +bool LLParser::ParseUnionType(PATypeHolder &Result) { > > Unions can't be empty, so the first grammar productio...
2010 Jan 18
5
[LLVMdev] [patch] Union Types - work in progress
...Ty); +} Please use "!ElemTy->isVoidTy()" etc. --- lib/VMCore/ConstantsContext.h (revision 93451) +template<> +struct ConstantKeyData<ConstantUnion> { + typedef Constant* ValType; + static ValType getValType(ConstantUnion *CS) { CU not CS. LLParser.cpp: In LLParser::ParseUnionType, you can use SmallVector instead of std::vector for ParamsList & ParamsListTy. @@ -2135,7 +2173,8 @@ ParseToken(lltok::rparen, "expected ')' in extractvalue constantexpr")) return true; - if (!isa<StructType>(Val->getType()) && !isa...
2010 Jan 28
0
[LLVMdev] [patch] Union Types - work in progress
...--- lib/VMCore/ConstantsContext.h (revision 93451) > > +template<> > +struct ConstantKeyData<ConstantUnion> { > + typedef Constant* ValType; > + static ValType getValType(ConstantUnion *CS) { > > CU not CS. > > > LLParser.cpp: > > In LLParser::ParseUnionType, you can use SmallVector instead of std::vector > for ParamsList & ParamsListTy. > > @@ -2135,7 +2173,8 @@ > ParseToken(lltok::rparen, "expected ')' in extractvalue > constantexpr")) > return true; > > - if (!isa<StructType>(Val-...
2010 Jan 28
0
[LLVMdev] [patch] Union Types - work in progress
...--- lib/VMCore/ConstantsContext.h (revision 93451) > > +template<> > +struct ConstantKeyData<ConstantUnion> { > + typedef Constant* ValType; > + static ValType getValType(ConstantUnion *CS) { > > CU not CS. > > > LLParser.cpp: > > In LLParser::ParseUnionType, you can use SmallVector instead of std::vector > for ParamsList & ParamsListTy. > > @@ -2135,7 +2173,8 @@ > ParseToken(lltok::rparen, "expected ')' in extractvalue > constantexpr")) > return true; > > - if (!isa<StructType>(Val-...
2010 Jan 09
0
[LLVMdev] [PATCH] - Union types, attempt 2
...) + : CompositeType(C, UnionTyID) { + ContainedTys = reinterpret_cast<PATypeHandle*>(this + 1); + NumContainedTys = Types.size(); + bool isAbstract = false; + for (unsigned i = 0; i < Types.size(); ++i) { No need to evaluate Types.size() every time through the loop. +bool LLParser::ParseUnionType(PATypeHolder &Result) { ... + if (!EatIfPresent(lltok::lbrace)) { + return Error(EltTyLoc, "'{' expected after 'union'"); + } Please use: if (ParseToken(lltok::lbrace, "'{' expected after 'union'")) return true; + EltTyLoc = Lex.ge...
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 06
3
[LLVMdev] [PATCH] - Union types, attempt 2
This patch adds a UnionType to DerivedTypes.h. It also adds code to the bitcode reader / writer and the assembly parser for the new type, as well as a tiny .ll test file in test/Assembler. It does not contain any code related to code generation or type layout - I wanted to see if this much was acceptable before I proceeded any further. Unlike my previous patch, in which the Union type was
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 Jan 11
2
[LLVMdev] [PATCH] - Union types, attempt 2
...+ ContainedTys = reinterpret_cast<PATypeHandle*>(this + 1); > + NumContainedTys = Types.size(); > + bool isAbstract = false; > + for (unsigned i = 0; i < Types.size(); ++i) { > > No need to evaluate Types.size() every time through the loop. > > > +bool LLParser::ParseUnionType(PATypeHolder &Result) { > ... > + if (!EatIfPresent(lltok::lbrace)) { > + return Error(EltTyLoc, "'{' expected after 'union'"); > + } > > Please use: > if (ParseToken(lltok::lbrace, "'{' expected after 'union'")) r...