Displaying 8 results from an estimated 8 matches for "fieldno".
2009 Feb 19
2
[LLVMdev] please review this fix for PR3510
...0 (and <rdar://problem/6564697>).
The bug is a failure to handle a "hole" inside an initialized
structure, where the hole may be induced by a designated initializer
or by alignment:
http://llvm.org/bugs/show_bug.cgi?id=3510
The original code was greatly simplified by using FieldNo to index the
LLVM fields and the initializer in lock-step. Alas, that fails when
the initializer requires alignment padding; such padding is not
recorded in the LLVM structure type. This implies that the
initialized ResultElts[] may have many more fields than the LLVM type.
The patched c...
2008 Jul 07
0
[LLVMdev] (GEP) Index validity
...if (const StructType *STy = dyn_cast<StructType>(*TI)) {
- assert(Indices[CurIDX]->getType() == Type::Int32Ty &&
- "Illegal struct idx");
+ assert(isa<ConstantInt>(Indices[CurIDX]) && "Illegal struct idx");
unsigned FieldNo = cast<ConstantInt>(Indices[CurIDX])->getZExtValue();
// Get structure layout information...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://li...
2010 Mar 15
0
[LLVMdev] [patch] Writing ConstantUnions
...++i) {
+ Align = std::max(Align, (unsigned)getAlignment(*i, abi_or_pref));
+ }
+ return Align;
+ }
case Type::IntegerTyID:
case Type::VoidTyID:
AlignType = INTEGER_ALIGN;
@@ -600,6 +620,11 @@
// Update Ty to refer to current element
Ty = STy->getElementType(FieldNo);
+ } else if (const UnionType *UnTy = dyn_cast<UnionType>(*TI)) {
+ unsigned FieldNo = cast<ConstantInt>(Indices[CurIDX])->getZExtValue();
+
+ // Offset into union is canonically 0, but type changes
+ Ty = UnTy->getElementType(FieldNo);
} else {...
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.
--------------
2008 Jul 10
2
[LLVMdev] (GEP) Index validity
...Type *STy = dyn_cast<StructType>(*TI)) {
> - assert(Indices[CurIDX]->getType() == Type::Int32Ty &&
> - "Illegal struct idx");
> + assert(isa<ConstantInt>(Indices[CurIDX]) && "Illegal struct idx");
> unsigned FieldNo = cast<ConstantInt>(Indices[CurIDX])->getZExtValue();
>
> // Get structure layout information...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <...
2008 Jul 07
2
[LLVMdev] (GEP) Index validity
Hi all,
I'm fiddling around a bit with programmatically created GEP instructions,
which is failing when using i64 for any indix, except the first.
The reason behind this, is that StructureType::indexValid only accepts Value*
that are constant ints of width 32. I can't really see why this limitation is
here.
SequentialType solves this slightly differently, it allows for both 32 and 64
2011 Feb 04
3
[LLVMdev] ConstantBuilder proposal
...static Constant *GetSizeOf(const Type* Ty) {
return ConstantExpr::getSizeOf(Ty);
}
/// GetOffsetOf constant expr - computes the offset of a struct field in a
/// target independent way (Note: the return type is an i64).
///
static Constant *GetOffsetOf(const StructType* STy, unsigned FieldNo) {
return ConstantExpr::getOffsetOf(STy, FieldNo);
}
/// GetOffsetOf constant expr - This is a generalized form of GetOffsetOf,
/// which supports any aggregate type, and any Constant index.
///
static Constant *GetOffsetOf(const Type* Ty, Constant *FieldNo) {
return ConstantExpr...
2008 Jul 10
0
[LLVMdev] (GEP) Index validity
...ructType>(*TI)) {
>> - assert(Indices[CurIDX]->getType() == Type::Int32Ty &&
>> - "Illegal struct idx");
>> + assert(isa<ConstantInt>(Indices[CurIDX]) && "Illegal struct
>> idx");
>> unsigned FieldNo = cast<ConstantInt>(Indices[CurIDX])-
>> >getZExtValue();
>>
>> // Get structure layout information...
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lis...