diff options
Diffstat (limited to 'CodeGen/CodeGenTypes.h')
-rw-r--r-- | CodeGen/CodeGenTypes.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/CodeGen/CodeGenTypes.h b/CodeGen/CodeGenTypes.h index 5ae49553ab..2ca3d3478c 100644 --- a/CodeGen/CodeGenTypes.h +++ b/CodeGen/CodeGenTypes.h @@ -15,6 +15,7 @@ #define CODEGEN_CODEGENTYPES_H #include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/SmallSet.h" #include <vector> namespace llvm { @@ -42,7 +43,8 @@ namespace CodeGen { class CGRecordLayout { CGRecordLayout(); // DO NOT IMPLEMENT public: - CGRecordLayout(llvm::Type *T) : STy(T) { + CGRecordLayout(llvm::Type *T, llvm::SmallSet<unsigned, 8> &PF) + : STy(T), PaddingFields(PF) { // FIXME : Collect info about fields that requires adjustments // (i.e. fields that do not directly map to llvm struct fields.) } @@ -52,8 +54,17 @@ namespace CodeGen { return STy; } + bool isPaddingField(unsigned No) const { + return PaddingFields.count(No) != 0; + } + + unsigned getNumPaddingFields() { + return PaddingFields.size(); + } + private: llvm::Type *STy; + llvm::SmallSet<unsigned, 8> PaddingFields; }; /// CodeGenTypes - This class organizes the cross-module state that is used |