summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-05-02 17:20:56 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-05-02 17:20:56 +0000
commiteb39741c0b4ab018d8e416cac82336e7a292e212 (patch)
tree22713a690863962536518a8e4176764aef1b84e2 /clang/lib/AST/ASTContext.cpp
parentd47ba853fc0a1e5149f18ee3f5fdf59699169eb5 (diff)
downloadbcm5719-llvm-eb39741c0b4ab018d8e416cac82336e7a292e212.tar.gz
bcm5719-llvm-eb39741c0b4ab018d8e416cac82336e7a292e212.zip
More rule enforcement of zero bitfields for ms_struct.
llvm-svn: 130696
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 1f4d9a37186..8316ea68e9e 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud