aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-05-04 18:51:37 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-05-04 18:51:37 +0000
commit9b3acaa32548d0ce78b9c39a3911397f6738a47c (patch)
tree687b5f76cca4c859622e1797757182c3dbb3f147 /lib/AST/ASTContext.cpp
parent36615b818637e0e378ff9faa9561fe025ae3c9bf (diff)
More ms_struct bitfield stuff:
Adjacent bit fields are packed into the same 1-, 2-, or 4-byte allocation unit if the integral types are the same size. // rdar://8823265. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130851 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 287c8b2af6..717c3a8ffe 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -551,6 +551,13 @@ bool ASTContext::ZeroBitfieldFollowsBitfield(const FieldDecl *FD,
}
+bool ASTContext::BitfieldFollowsBitfield(const FieldDecl *FD,
+ const FieldDecl *LastFD) const {
+ return (FD->isBitField() && LastFD && LastFD->isBitField() &&
+ FD->getBitWidth()-> EvaluateAsInt(*this).getZExtValue() &&
+ LastFD->getBitWidth()-> EvaluateAsInt(*this).getZExtValue());
+}
+
ASTContext::overridden_cxx_method_iterator
ASTContext::overridden_methods_begin(const CXXMethodDecl *Method) const {
llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector>::const_iterator Pos