Displaying 12 results from an estimated 12 matches for "uniontyid".
2010 Mar 06
4
[LLVMdev] Changes between 2.6 and 2.7: SSA Verifier and visitFreeInst
Hi llvm,
1) The lib/VMCore/Verifier.cpp in 2.7 implements Verifier::VerifyType,
which is empty in 2.6. I noticed that it does not check all types,
for example, UnionTyID, OpaqueTyID, LabelTyID, MetadataTyID
and etc are ignored in the 'default' branch. Does it mean we dont
need to check them?
Another question is: How much does Verifier.cpp check statically?
Can I take it as a type checker for SSA? Is there any static
semantics that has not been checked yet?...
2010 Jan 09
0
[LLVMdev] [PATCH] - Union types, attempt 2
...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't need to be stable. The numbering in llvm-c/Core.h does need to be stable though.
+bool UnionType::indexValid(const Value *V) const {
+ // Union indexes require 32-bit integer constants.
+...
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 Mar 06
0
[LLVMdev] Changes between 2.6 and 2.7: SSA Verifier and visitFreeInst
On Mar 6, 2010, at 9:13 AM, Jianzhou Zhao wrote:
> Hi llvm,
>
> 1) The lib/VMCore/Verifier.cpp in 2.7 implements Verifier::VerifyType,
> which is empty in 2.6. I noticed that it does not check all types,
> for example, UnionTyID, OpaqueTyID, LabelTyID, MetadataTyID
> and etc are ignored in the 'default' branch. Does it mean we dont
> need to check them?
They are leaf types (just like integer type), there is nothing to check.
> Another question is: How much does Verifier.cpp check statically?
> Can I t...
2010 Jan 11
2
[LLVMdev] [PATCH] - Union types, attempt 2
...>
>
> +++ 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't need to be stable. The numbering in llvm-c/Core.h does need to be
> stable though.
>
>
> +bool UnionType::indexValid(const Value *V) const {
> + // Union indexe...
2010 Mar 06
0
[LLVMdev] Changes between 2.6 and 2.7: SSA Verifier and visitFreeInst
Jianzhou Zhao wrote:
> Hi llvm,
>
> 1) The lib/VMCore/Verifier.cpp in 2.7 implements Verifier::VerifyType,
> which is empty in 2.6. I noticed that it does not check all types,
> for example, UnionTyID, OpaqueTyID, LabelTyID, MetadataTyID
> and etc are ignored in the 'default' branch. Does it mean we dont
> need to check them?
We do need to check union. I'll add that. The others don't need a case
because they don't contain subtypes; it's impossible to have an illeg...
2010 Mar 15
0
[LLVMdev] [patch] Writing ConstantUnions
...- lib/Target/TargetData.cpp (revision 98552)
+++ lib/Target/TargetData.cpp (working copy)
@@ -460,6 +460,15 @@
case Type::StructTyID:
// Get the layout annotation... which is lazily created on demand.
return getStructLayout(cast<StructType>(Ty))->getSizeInBits();
+ case Type::UnionTyID: {
+ const UnionType *UnTy = cast<UnionType>(Ty);
+ uint64_t Size = 0;
+ for (UnionType::element_iterator i = UnTy->element_begin(),
+ e = UnTy->element_end(); i != e; ++i) {
+ Size = std::max(Size, getTypeSizeInBits(*i));
+ }
+ return Size;
+ }
case...
2010 Mar 15
3
[LLVMdev] [patch] Writing ConstantUnions
Hello,
I noticed a bit of a gap in the current code for unions: a
ConstantUnion cannot be written out to .ll.
Hopefully I'm not stepping on Talin's toes by posting this, it's a
fairly straightforward adaptation of the code for structs just above.
Tim.
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
--------------
2010 Mar 09
1
[LLVMdev] Changes between 2.6 and 2.7: SSA Verifier and visitFreeInst
...attner at apple.com> wrote:
>
> On Mar 6, 2010, at 9:13 AM, Jianzhou Zhao wrote:
>
>> Hi llvm,
>>
>> 1) The lib/VMCore/Verifier.cpp in 2.7 implements Verifier::VerifyType,
>> which is empty in 2.6. I noticed that it does not check all types,
>> for example, UnionTyID, OpaqueTyID, LabelTyID, MetadataTyID
>> and etc are ignored in the 'default' branch. Does it mean we dont
>> need to check them?
>
> They are leaf types (just like integer type), there is nothing to check.
>
>> Another question is: How much does Verifier.cpp check...
2010 Mar 07
1
[LLVMdev] Changes between 2.6 and 2.7: SSA Verifier and visitFreeInst
...at 2:35 PM, Nick Lewycky <nicholas at mxc.ca> wrote:
> Jianzhou Zhao wrote:
>>
>> Hi llvm,
>>
>> 1) The lib/VMCore/Verifier.cpp in 2.7 implements Verifier::VerifyType,
>> which is empty in 2.6. I noticed that it does not check all types,
>> for example, UnionTyID, OpaqueTyID, LabelTyID, MetadataTyID
>> and etc are ignored in the 'default' branch. Does it mean we dont
>> need to check them?
>
> We do need to check union. I'll add that. The others don't need a case
> because they don't contain subtypes; it's imposs...
2010 Mar 29
0
[LLVMdev] Union types
...=========================================================
--- lib/VMCore/Constants.cpp (revision 99809)
+++ lib/VMCore/Constants.cpp (working copy)
@@ -59,6 +59,7 @@
case Type::PointerTyID:
return ConstantPointerNull::get(cast<PointerType>(Ty));
case Type::StructTyID:
+ case Type::UnionTyID:
case Type::ArrayTyID:
case Type::VectorTyID:
return ConstantAggregateZero::get(Ty);
@@ -944,7 +945,8 @@
// Factory Function Implementation
ConstantAggregateZero* ConstantAggregateZero::get(const Type* Ty) {
- assert((Ty->isStructTy() || Ty->isArrayTy() ||...
2010 Mar 29
6
[LLVMdev] Union types
Hi All,
I've noticed the union type in the language manual [1] but it seems
it's not used too much.
According to the manual, the code:
union {
int a;
double b;
} a;
Could be compiled to:
%union.anon = type union { i32, double }
@a = common global %union.anon zeroinitializer, align 8 ;
<%union.anon*> [#uses=0]
But when I try to assemble it, I get:
$ llvm-as union.ll