diff options
author | Yeoul Na <yeoul_na@apple.com> | 2024-04-03 16:35:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-03 16:35:11 -0700 |
commit | 750843875254b1d493f4d7c3d3921c1bced55b7c (patch) | |
tree | a04c4c296867ae9eb1a916dba1ccb155a54f90d3 | |
parent | 20433e9b2483d64843310e97062541dd73f54436 (diff) | |
download | llvm-750843875254b1d493f4d7c3d3921c1bced55b7c.zip llvm-750843875254b1d493f4d7c3d3921c1bced55b7c.tar.gz llvm-750843875254b1d493f4d7c3d3921c1bced55b7c.tar.bz2 |
[BoundsSafety] Minor fixes on counted_by (#87559)
DeclRef to field must be marked as LValue to be consistent with how the
field decl will be evaluated.
T->desugar() is unnecessary to call ->isArrayType().
-rw-r--r-- | clang/lib/AST/TypePrinter.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp index d0771eb..075c8aba 100644 --- a/clang/lib/AST/TypePrinter.cpp +++ b/clang/lib/AST/TypePrinter.cpp @@ -1763,14 +1763,14 @@ static void printCountAttributedImpl(const CountAttributedType *T, void TypePrinter::printCountAttributedBefore(const CountAttributedType *T, raw_ostream &OS) { printBefore(T->desugar(), OS); - if (!T->desugar()->isArrayType()) + if (!T->isArrayType()) printCountAttributedImpl(T, OS, Policy); } void TypePrinter::printCountAttributedAfter(const CountAttributedType *T, raw_ostream &OS) { printAfter(T->desugar(), OS); - if (T->desugar()->isArrayType()) + if (T->isArrayType()) printCountAttributedImpl(T, OS, Policy); } diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 80b4257..6b2eb24 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -2751,7 +2751,7 @@ Sema::ActOnIdExpression(Scope *S, CXXScopeSpec &SS, QualType type = VD->getType().getNonReferenceType(); // This will eventually be translated into MemberExpr upon // the use of instantiated struct fields. - return BuildDeclRefExpr(VD, type, VK_PRValue, NameLoc); + return BuildDeclRefExpr(VD, type, VK_LValue, NameLoc); } } } |