aboutsummaryrefslogtreecommitdiff
path: root/include/clang/ASTMatchers
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-10-26 19:26:45 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-10-26 19:26:45 +0000
commita9671c2b454cb64c022cda40788ea39117237e12 (patch)
tree1cb169676ac6af1de3f22bcbd833c5dd4fbea403 /include/clang/ASTMatchers
parent3f79e28a57a5aab3a41f489201c26bd803efe344 (diff)
PR26547: alignof should return ABI alignment, not preferred alignment
Summary: - Add `UETT_PreferredAlignOf` to account for the difference between `__alignof` and `alignof` - `AlignOfType` now returns ABI alignment instead of preferred alignment iff clang-abi-compat > 7, and one uses _Alignof or alignof Patch by Nicole Mazzuca! Differential Revision: https://reviews.llvm.org/D53207 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345419 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/ASTMatchers')
-rw-r--r--include/clang/ASTMatchers/ASTMatchers.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/clang/ASTMatchers/ASTMatchers.h b/include/clang/ASTMatchers/ASTMatchers.h
index eb07ff70a9..3f8690bd8a 100644
--- a/include/clang/ASTMatchers/ASTMatchers.h
+++ b/include/clang/ASTMatchers/ASTMatchers.h
@@ -2425,8 +2425,9 @@ AST_MATCHER_P(UnaryExprOrTypeTraitExpr, ofKind, UnaryExprOrTypeTrait, Kind) {
/// alignof.
inline internal::Matcher<Stmt> alignOfExpr(
const internal::Matcher<UnaryExprOrTypeTraitExpr> &InnerMatcher) {
- return stmt(unaryExprOrTypeTraitExpr(allOf(
- ofKind(UETT_AlignOf), InnerMatcher)));
+ return stmt(unaryExprOrTypeTraitExpr(
+ allOf(anyOf(ofKind(UETT_AlignOf), ofKind(UETT_PreferredAlignOf)),
+ InnerMatcher)));
}
/// Same as unaryExprOrTypeTraitExpr, but only matching