aboutsummaryrefslogtreecommitdiff
path: root/CodeGen/CodeGenTypes.h
diff options
context:
space:
mode:
authorLauro Ramos Venancio <lauro.venancio@gmail.com>2008-01-21 22:54:57 +0000
committerLauro Ramos Venancio <lauro.venancio@gmail.com>2008-01-21 22:54:57 +0000
commit2c46ce8de96787aa8e040690a80896f1148c29b0 (patch)
tree7ab00ba256f009156702e262ef0a076e1b42f25a /CodeGen/CodeGenTypes.h
parent7c39ff7eb3dd7ae9b2b81cb66a139c9b52f47f1d (diff)
Simplify the bitfield codegen.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46230 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CodeGenTypes.h')
-rw-r--r--CodeGen/CodeGenTypes.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/CodeGen/CodeGenTypes.h b/CodeGen/CodeGenTypes.h
index f10dc534ef..db3ba9c2af 100644
--- a/CodeGen/CodeGenTypes.h
+++ b/CodeGen/CodeGenTypes.h
@@ -78,18 +78,11 @@ class CodeGenTypes {
class BitFieldInfo {
public:
- explicit BitFieldInfo(unsigned N, unsigned B, unsigned E)
- : No(N), Begin(B), End(E) {}
- private:
- // No - llvm struct field number that is used to
- // access this field. It may be not same as struct field number.
- // For example,
- // struct S { char a; short b:2; }
- // Here field 'b' is second field however it is accessed as
- // 9th and 10th bitfield of first field whose type is short.
- unsigned No;
+ explicit BitFieldInfo(unsigned B, unsigned S)
+ : Begin(B), Size(S) {}
+
unsigned Begin;
- unsigned End;
+ unsigned Size;
};
llvm::DenseMap<const FieldDecl *, BitFieldInfo> BitFields;
@@ -140,8 +133,13 @@ public: // These are internal details of CGT that shouldn't be used externally.
std::vector<const llvm::Type*> &ArgTys);
/// addFieldInfo - Assign field number to field FD.
- void addFieldInfo(const FieldDecl *FD, unsigned No, unsigned Begin,
- unsigned End);
+ void addFieldInfo(const FieldDecl *FD, unsigned No);
+
+ /// addBitFieldInfo - Assign a start bit and a size to field FD.
+ void addBitFieldInfo(const FieldDecl *FD, unsigned Begin, unsigned Size);
+
+ /// getBitFieldInfo - Return the BitFieldInfo that corresponds to the field FD.
+ BitFieldInfo getBitFieldInfo(const FieldDecl *FD);
};
} // end namespace CodeGen