X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FIR%2FDataLayout.h;h=19a3a6661feb668955c7d7ad80a3452c08b6ef9e;hb=da92e119096b6e2e93efbf44ed07ea0a715cef9c;hp=892d6c9936c03958a86a8c58c7ba4a283799eff4;hpb=80ec0f8f150866efb5e58d4d1e811ccb64bb99c6;p=oota-llvm.git diff --git a/include/llvm/IR/DataLayout.h b/include/llvm/IR/DataLayout.h index 892d6c9936c..19a3a6661fe 100644 --- a/include/llvm/IR/DataLayout.h +++ b/include/llvm/IR/DataLayout.h @@ -475,7 +475,8 @@ inline LLVMTargetDataRef wrap(const DataLayout *P) { class StructLayout { uint64_t StructSize; unsigned StructAlignment; - unsigned NumElements; + bool IsPadded : 1; + unsigned NumElements : 31; uint64_t MemberOffsets[1]; // variable sized array! public: uint64_t getSizeInBytes() const { return StructSize; } @@ -484,6 +485,10 @@ public: unsigned getAlignment() const { return StructAlignment; } + /// Returns whether the struct has padding or not between its fields. + /// NB: Padding in nested element is not taken into account. + bool hasPadding() const { return IsPadded; } + /// \brief Given a valid byte offset into the structure, returns the structure /// index that contains it. unsigned getElementContainingOffset(uint64_t Offset) const;