Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If the modifiedType and the minimally desugared type of an AttributedType are the same, then we do not need to show both in an AST dump. Here, we change VisitAttributedType to only visit the modifiedType when it is different from the equivalentType (the minimally desugared type), because the latter is already visited by default. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D142637
- Loading branch information
1 parent
83e84cd
commit 70acb3a
Showing
3 changed files
with
26 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -ast-dump %s | FileCheck %s | ||
|
||
int * _Nonnull x; | ||
using Ty = decltype(x); | ||
|
||
// CHECK: TypeAliasDecl 0x{{[^ ]*}} <line:4:1, col:22> col:7 Ty 'decltype(x)':'int *' | ||
// CHECK-NEXT: `-DecltypeType 0x{{[^ ]*}} 'decltype(x)' sugar | ||
// CHECK-NEXT: |-DeclRefExpr 0x{{[^ ]*}} <col:21> 'int * _Nonnull':'int *' lvalue Var 0x{{[^ ]*}} 'x' 'int * _Nonnull':'int *' non_odr_use_unevaluated | ||
// CHECK-NEXT: `-AttributedType 0x{{[^ ]*}} 'int * _Nonnull' sugar | ||
// CHECK-NEXT: `-PointerType 0x{{[^ ]*}} 'int *' | ||
// CHECK-NEXT: `-BuiltinType 0x{{[^ ]*}} 'int' | ||
// CHECK-NOT: `-PointerType | ||
|
||
[[clang::address_space(3)]] int *y; | ||
using Ty1 = decltype(y); | ||
|
||
// CHECK: TypeAliasDecl 0x{{[^ ]*}} <line:15:1, col:23> col:7 Ty1 'decltype(y)':'__attribute__((address_space(3))) int *' | ||
// CHECK-NEXT: `-DecltypeType 0x{{[^ ]*}} 'decltype(y)' sugar | ||
// CHECK-NEXT: |-DeclRefExpr 0x{{[^ ]*}} <col:22> '__attribute__((address_space(3))) int *' lvalue Var 0x{{[^ ]*}} 'y' '__attribute__((address_space(3))) int *' non_odr_use_unevaluated | ||
// CHECK-NEXT: `-PointerType 0x{{[^ ]*}} '__attribute__((address_space(3))) int *' | ||
// CHECK-NEXT: `-AttributedType 0x{{[^ ]*}} '__attribute__((address_space(3))) int' sugar | ||
// CHECK-NEXT |-BuiltinType 0x{{[^ ]*}} 'int' | ||
// CHECK-NEXT `-QualType 0x{{[^ ]*}} '__attribute__((address_space(3))) int' __attribute__((address_space(3))) | ||
// CHECK-NEXT `-BuiltinType 0x{{[^ ]*}} 'int' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters