diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-05-02 17:20:56 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-05-02 17:20:56 +0000 |
commit | 340fa242130c2d8d74c83edca0952e771aebe0e6 (patch) | |
tree | dea1131fbdb6341aeebc382316a1a741262a982f /lib/AST/ASTContext.cpp | |
parent | 0f0cdab31a4f71914b7f654501d69d96e9f378da (diff) |
More rule enforcement of zero bitfields for ms_struct.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130696 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 1f4d9a3718..8316ea68e9 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -543,6 +543,13 @@ bool ASTContext::ZeroBitfieldFollowsNonBitfield(const FieldDecl *FD, } +bool ASTContext::ZeroBitfieldFollowsBitfield(const FieldDecl *FD, + const FieldDecl *LastFD) const { + return (FD->isBitField() && LastFD && LastFD->isBitField() && + FD->getBitWidth()-> EvaluateAsInt(*this).getZExtValue() == 0); + +} + ASTContext::overridden_cxx_method_iterator ASTContext::overridden_methods_begin(const CXXMethodDecl *Method) const { llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector>::const_iterator Pos |