[clang] [clang][AST] Dump saved APValue of all `VarDecl`s (PR #239672)

via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 6 21:49:37 PST 2026


Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/239672 at github.com>


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,c -- clang/lib/AST/TextNodeDumper.cpp clang/test/APINotes/namespaces.cpp clang/test/AST/ast-dump-decl.cpp clang/test/AST/ast-dump-lookups.cpp clang/test/AST/ast-dump-template-decls.cpp clang/test/AST/float16.cpp clang/test/AST/new-unknown-type.cpp clang/test/AST/pr47636.cpp clang/test/ASTSYCL/ast-dump-sycl-kernel-call-stmt.cpp clang/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p4-ast.cpp clang/test/Interpreter/sanity.c clang/test/Misc/pragma-attribute-cxx.cpp clang/test/SemaOpenACC/declare-construct-ast.cpp clang/test/SemaOpenACC/routine-construct-ast.cpp clang/test/SemaOpenACC/update-construct-ast.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/AST/TextNodeDumper.cpp b/clang/lib/AST/TextNodeDumper.cpp
index c5e316f50..3345fe093 100644
--- a/clang/lib/AST/TextNodeDumper.cpp
+++ b/clang/lib/AST/TextNodeDumper.cpp
@@ -2653,8 +2653,8 @@ void TextNodeDumper::VisitVarDecl(const VarDecl *D) {
     const Expr *E = D->getInit();
     // Only evaluate the value of constexpr VarDecls.
     // if (E && !E->isValueDependent() && D->isConstexpr() &&
-        // !D->getType()->isDependentType())
-      // D->evaluateValue();
+    // !D->getType()->isDependentType())
+    // D->evaluateValue();
 
     if (const APValue *V = D->getEvaluatedValue())
       AddChild("value", [=] { Visit(*V, E->getType()); });

``````````

</details>


https://github.com/llvm/llvm-project/pull/239672


More information about the cfe-commits mailing list