search for: getelementoffset

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

Did you mean: getelementoffsetof
2016 Dec 29
4
Structure Padding and GetElementPtr
...there any way to map this "5th" access to the original "3rd" one? For > example, some APIs to tell whether one member is a real member, or a padded > one? > > > I would suggest converting the index of the struct GEP into an offset in > bytes; see StructLayout::getElementOffset. You can then compare that to > the layout of the original C++ class. > > -Eli > > -- > Employee of Qualcomm Innovation Center, Inc. > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project > > -------------- next part...
2012 May 24
1
[LLVMdev] About the result of getPointerSizeInBits();
Hi guys, Does getPointerSizeInBits need to return sizeof(void*) in Platform? I found that getPointerSizeInBits return 8 in x86-32 on win7-64, MSVC 2010. And if I have a struct { i32, i32* }; the structLayout->getElementOffset(1) return 8, but I think 4 is right. In generated ASM, the offset of second element is 4. Thanks. -- Ye Wu CELL: +86 159 9957 0103 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120524/1240307a/attachment...
2016 Dec 28
0
Structure Padding and GetElementPtr
...gt; > Is there any way to map this "5th" access to the original "3rd" one? > For example, some APIs to tell whether one member is a real member, or > a padded one? > I would suggest converting the index of the struct GEP into an offset in bytes; see StructLayout::getElementOffset. You can then compare that to the layout of the original C++ class. -Eli -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project -------------- next part -------------- An HTML attachment was s...
2016 Dec 29
0
Structure Padding and GetElementPtr
...is "5th" access to the original "3rd" one? For >> example, some APIs to tell whether one member is a real member, or a padded >> one? >> >> >> I would suggest converting the index of the struct GEP into an offset in >> bytes; see StructLayout::getElementOffset. You can then compare that to >> the layout of the original C++ class. >> >> -Eli >> >> -- >> Employee of Qualcomm Innovation Center, Inc. >> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project >&g...
2016 Dec 29
0
Structure Padding and GetElementPtr
...is "5th" access to the original "3rd" one? For >> example, some APIs to tell whether one member is a real member, or a padded >> one? >> >> >> I would suggest converting the index of the struct GEP into an offset in >> bytes; see StructLayout::getElementOffset. You can then compare that to >> the layout of the original C++ class. >> >> -Eli >> >> -- >> Employee of Qualcomm Innovation Center, Inc. >> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project >&g...
2016 Dec 29
1
Structure Padding and GetElementPtr
...s to the original "3rd" one? For >>> example, some APIs to tell whether one member is a real member, or a padded >>> one? >>> >>> >>> I would suggest converting the index of the struct GEP into an offset in >>> bytes; see StructLayout::getElementOffset. You can then compare that >>> to the layout of the original C++ class. >>> >>> -Eli >>> >>> -- >>> Employee of Qualcomm Innovation Center, Inc. >>> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation...
2016 Dec 29
1
Structure Padding and GetElementPtr
...s to the original "3rd" one? For >>> example, some APIs to tell whether one member is a real member, or a padded >>> one? >>> >>> >>> I would suggest converting the index of the struct GEP into an offset in >>> bytes; see StructLayout::getElementOffset. You can then compare that >>> to the layout of the original C++ class. >>> >>> -Eli >>> >>> -- >>> Employee of Qualcomm Innovation Center, Inc. >>> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation...
2011 Feb 04
3
[LLVMdev] Data layout of structs
Dear all, I'm currently working on the automated program analysis tool AProVE (http://aprove.informatik.rwth-aachen.de/) and would like to use LLVM for analysis of C programs. I have the following example C program dealing with simple lists of integers: ------------ start C example ------------- #include<stdlib.h> struct list_el { int val; struct list_el * next; }; typedef
2016 Dec 28
2
Structure Padding and GetElementPtr
Hi all, I'm writing a pass to understand the memory access to C++ class members. For each GetElementPtr instruction, I check the second index to the class pointer, to figure out which member it is intended to access. However, due to the structure padding, there are some fake members inserted into the structure. For example, when GEP works on the 5th element of the padded structure, it may in
2009 Jan 09
2
[LLVMdev] RFC: Store alignment should be LValue alignment, not source alignment
...TREE_CODE(DECL_CONTEXT(FieldDecl)) == QUAL_UNION_TYPE)); @@ -6064,7 +6100,9 @@ LValue TreeToLLVM::EmitLV_COMPONENT_REF( // the offset from BitStart. if (MemberIndex) { const StructLayout *SL = TD.getStructLayout(cast<StructType>(StructTy)); - BitStart -= SL->getElementOffset(MemberIndex) * 8; + unsigned Offset = SL->getElementOffset(MemberIndex); + BitStart -= Offset * 8; + LVAlign = MinAlign(LVAlign, Offset); } // If the FIELD_DECL has an annotate attribute on it, emit it. @@ -6130,7 +6168,7 @@ LValue TreeToLLVM::EmitLV_COMPONENT_REF(...