This revision was automatically updated to reflect the committed changes. Closed by commit rGe6ec7ab5820f: NFC: TreeTransform.h: make the function TransformNestedNameSpecifierLoc more⦠(authored by zhouyizhou, committed by pengfei).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102577/new/ https://reviews.llvm.org/D102577 Files: clang/lib/Sema/TreeTransform.h Index: clang/lib/Sema/TreeTransform.h =================================================================== --- clang/lib/Sema/TreeTransform.h +++ clang/lib/Sema/TreeTransform.h @@ -4031,12 +4031,10 @@ return Sema::ConditionResult(); } -template<typename Derived> -NestedNameSpecifierLoc -TreeTransform<Derived>::TransformNestedNameSpecifierLoc( - NestedNameSpecifierLoc NNS, - QualType ObjectType, - NamedDecl *FirstQualifierInScope) { +template <typename Derived> +NestedNameSpecifierLoc TreeTransform<Derived>::TransformNestedNameSpecifierLoc( + NestedNameSpecifierLoc NNS, QualType ObjectType, + NamedDecl *FirstQualifierInScope) { SmallVector<NestedNameSpecifierLoc, 4> Qualifiers; for (NestedNameSpecifierLoc Qualifier = NNS; Qualifier; Qualifier = Qualifier.getPrefix()) @@ -4050,28 +4048,26 @@ switch (QNNS->getKind()) { case NestedNameSpecifier::Identifier: { Sema::NestedNameSpecInfo IdInfo(QNNS->getAsIdentifier(), - Q.getLocalBeginLoc(), Q.getLocalEndLoc(), ObjectType); + Q.getLocalBeginLoc(), Q.getLocalEndLoc(), + ObjectType); if (SemaRef.BuildCXXNestedNameSpecifier(/*Scope=*/nullptr, IdInfo, false, SS, FirstQualifierInScope, false)) return NestedNameSpecifierLoc(); - } break; + } case NestedNameSpecifier::Namespace: { - NamespaceDecl *NS - = cast_or_null<NamespaceDecl>( - getDerived().TransformDecl( - Q.getLocalBeginLoc(), - QNNS->getAsNamespace())); + NamespaceDecl *NS = + cast_or_null<NamespaceDecl>(getDerived().TransformDecl( + Q.getLocalBeginLoc(), QNNS->getAsNamespace())); SS.Extend(SemaRef.Context, NS, Q.getLocalBeginLoc(), Q.getLocalEndLoc()); break; } case NestedNameSpecifier::NamespaceAlias: { - NamespaceAliasDecl *Alias - = cast_or_null<NamespaceAliasDecl>( - getDerived().TransformDecl(Q.getLocalBeginLoc(), - QNNS->getAsNamespaceAlias())); + NamespaceAliasDecl *Alias = + cast_or_null<NamespaceAliasDecl>(getDerived().TransformDecl( + Q.getLocalBeginLoc(), QNNS->getAsNamespaceAlias())); SS.Extend(SemaRef.Context, Alias, Q.getLocalBeginLoc(), Q.getLocalEndLoc()); break; @@ -4107,7 +4103,7 @@ if (TL.getType()->isEnumeralType()) SemaRef.Diag(TL.getBeginLoc(), diag::warn_cxx98_compat_enum_nested_name_spec); - SS.Extend(SemaRef.Context, /*FIXME:*/SourceLocation(), TL, + SS.Extend(SemaRef.Context, /*FIXME:*/ SourceLocation(), TL, Q.getLocalEndLoc()); break; } @@ -4116,7 +4112,7 @@ TypedefTypeLoc TTL = TL.getAs<TypedefTypeLoc>(); if (!TTL || !TTL.getTypedefNameDecl()->isInvalidDecl()) { SemaRef.Diag(TL.getBeginLoc(), diag::err_nested_name_spec_non_tag) - << TL.getType() << SS.getRange(); + << TL.getType() << SS.getRange(); } return NestedNameSpecifierLoc(); }
Index: clang/lib/Sema/TreeTransform.h =================================================================== --- clang/lib/Sema/TreeTransform.h +++ clang/lib/Sema/TreeTransform.h @@ -4031,12 +4031,10 @@ return Sema::ConditionResult(); } -template<typename Derived> -NestedNameSpecifierLoc -TreeTransform<Derived>::TransformNestedNameSpecifierLoc( - NestedNameSpecifierLoc NNS, - QualType ObjectType, - NamedDecl *FirstQualifierInScope) { +template <typename Derived> +NestedNameSpecifierLoc TreeTransform<Derived>::TransformNestedNameSpecifierLoc( + NestedNameSpecifierLoc NNS, QualType ObjectType, + NamedDecl *FirstQualifierInScope) { SmallVector<NestedNameSpecifierLoc, 4> Qualifiers; for (NestedNameSpecifierLoc Qualifier = NNS; Qualifier; Qualifier = Qualifier.getPrefix()) @@ -4050,28 +4048,26 @@ switch (QNNS->getKind()) { case NestedNameSpecifier::Identifier: { Sema::NestedNameSpecInfo IdInfo(QNNS->getAsIdentifier(), - Q.getLocalBeginLoc(), Q.getLocalEndLoc(), ObjectType); + Q.getLocalBeginLoc(), Q.getLocalEndLoc(), + ObjectType); if (SemaRef.BuildCXXNestedNameSpecifier(/*Scope=*/nullptr, IdInfo, false, SS, FirstQualifierInScope, false)) return NestedNameSpecifierLoc(); - } break; + } case NestedNameSpecifier::Namespace: { - NamespaceDecl *NS - = cast_or_null<NamespaceDecl>( - getDerived().TransformDecl( - Q.getLocalBeginLoc(), - QNNS->getAsNamespace())); + NamespaceDecl *NS = + cast_or_null<NamespaceDecl>(getDerived().TransformDecl( + Q.getLocalBeginLoc(), QNNS->getAsNamespace())); SS.Extend(SemaRef.Context, NS, Q.getLocalBeginLoc(), Q.getLocalEndLoc()); break; } case NestedNameSpecifier::NamespaceAlias: { - NamespaceAliasDecl *Alias - = cast_or_null<NamespaceAliasDecl>( - getDerived().TransformDecl(Q.getLocalBeginLoc(), - QNNS->getAsNamespaceAlias())); + NamespaceAliasDecl *Alias = + cast_or_null<NamespaceAliasDecl>(getDerived().TransformDecl( + Q.getLocalBeginLoc(), QNNS->getAsNamespaceAlias())); SS.Extend(SemaRef.Context, Alias, Q.getLocalBeginLoc(), Q.getLocalEndLoc()); break; @@ -4107,7 +4103,7 @@ if (TL.getType()->isEnumeralType()) SemaRef.Diag(TL.getBeginLoc(), diag::warn_cxx98_compat_enum_nested_name_spec); - SS.Extend(SemaRef.Context, /*FIXME:*/SourceLocation(), TL, + SS.Extend(SemaRef.Context, /*FIXME:*/ SourceLocation(), TL, Q.getLocalEndLoc()); break; } @@ -4116,7 +4112,7 @@ TypedefTypeLoc TTL = TL.getAs<TypedefTypeLoc>(); if (!TTL || !TTL.getTypedefNameDecl()->isInvalidDecl()) { SemaRef.Diag(TL.getBeginLoc(), diag::err_nested_name_spec_non_tag) - << TL.getType() << SS.getRange(); + << TL.getType() << SS.getRange(); } return NestedNameSpecifierLoc(); }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits