From f16011fe27adaa7a0e79d7a8b704c09411a9681c Mon Sep 17 00:00:00 2001 From: Atell Krasnopolski Date: Tue, 1 Oct 2024 22:37:31 +0200 Subject: [PATCH] format --- include/clad/Differentiator/VisitorBase.h | 13 +++++++------ lib/Differentiator/VisitorBase.cpp | 10 ++++++---- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/include/clad/Differentiator/VisitorBase.h b/include/clad/Differentiator/VisitorBase.h index 1f58a119a..251455c92 100644 --- a/include/clad/Differentiator/VisitorBase.h +++ b/include/clad/Differentiator/VisitorBase.h @@ -364,16 +364,17 @@ namespace clad { /// \param[in] D The declaration to build a DeclRefExpr for. /// \param[in] SS The scope specifier for the declaration. /// \returns the DeclRefExpr for the given declaration. - clang::DeclRefExpr* BuildDeclRef(clang::DeclaratorDecl* D, - const clang::CXXScopeSpec* SS = nullptr, - clang::ExprValueKind VK = clang::VK_LValue); + clang::DeclRefExpr* + BuildDeclRef(clang::DeclaratorDecl* D, + const clang::CXXScopeSpec* SS = nullptr, + clang::ExprValueKind VK = clang::VK_LValue); /// Builds a DeclRefExpr to a given Decl, adding proper nested name /// qualifiers. /// \param[in] D The declaration to build a DeclRefExpr for. /// \param[in] NNS The nested name specifier to use. - clang::DeclRefExpr* BuildDeclRef(clang::DeclaratorDecl* D, - clang::NestedNameSpecifier* NNS, - clang::ExprValueKind VK = clang::VK_LValue); + clang::DeclRefExpr* + BuildDeclRef(clang::DeclaratorDecl* D, clang::NestedNameSpecifier* NNS, + clang::ExprValueKind VK = clang::VK_LValue); /// Stores the result of an expression in a temporary variable (of the same /// type as is the result of the expression) and returns a reference to it. diff --git a/lib/Differentiator/VisitorBase.cpp b/lib/Differentiator/VisitorBase.cpp index 105d62780..56f966392 100644 --- a/lib/Differentiator/VisitorBase.cpp +++ b/lib/Differentiator/VisitorBase.cpp @@ -236,7 +236,7 @@ namespace clad { } DeclRefExpr* VisitorBase::BuildDeclRef(DeclaratorDecl* D, - const CXXScopeSpec* SS /*=nullptr*/, + const CXXScopeSpec* SS /*=nullptr*/, ExprValueKind VK /*=VK_LValue*/) { QualType T = D->getType(); T = T.getNonReferenceType(); @@ -245,13 +245,13 @@ namespace clad { } DeclRefExpr* VisitorBase::BuildDeclRef(DeclaratorDecl* D, - NestedNameSpecifier* NNS, + NestedNameSpecifier* NNS, ExprValueKind VK /*=VK_LValue*/) { std::vector NNChain; CXXScopeSpec CSS; while (NNS) { // FIXME: proper support for dependent NNS needs to be added. - //if (!NNS->isDependent()) return BuildDeclRef(D); + // if (!NNS->isDependent()) return BuildDeclRef(D); NNChain.push_back(NNS); NNS = NNS->getPrefix(); @@ -261,7 +261,9 @@ namespace clad { for (size_t i = 0; i < NNChain.size(); ++i) { NNS = NNChain[i]; - // FIXME: this needs to be extended to support more NNS kinds. An inspiration can be take from getFullyQualifiedNestedNameSpecifier in llvm-project/clang/lib/AST/QualTypeNames.cpp + // FIXME: this needs to be extended to support more NNS kinds. An + // inspiration can be take from getFullyQualifiedNestedNameSpecifier in + // llvm-project/clang/lib/AST/QualTypeNames.cpp if (NNS->getKind() == NestedNameSpecifier::Namespace) { NamespaceDecl* NS = NNS->getAsNamespace(); CSS.Extend(m_Context, NS, noLoc, noLoc);