[clang] Revert "[clang][bytecode] Stop relying on `CheckEvaluationResult()` (… (PR #226637)

via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 25 22:07:00 PDT 2026


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,h -- clang/lib/AST/ByteCode/ByteCodeEmitter.h clang/lib/AST/ByteCode/Compiler.cpp clang/lib/AST/ByteCode/Context.cpp clang/lib/AST/ByteCode/Disasm.cpp clang/lib/AST/ByteCode/EvalEmitter.cpp clang/lib/AST/ByteCode/EvalEmitter.h clang/lib/AST/ByteCode/EvaluationResult.cpp clang/lib/AST/ByteCode/EvaluationResult.h clang/lib/AST/ByteCode/Interp.cpp clang/lib/AST/ByteCode/InterpBuiltinObjectSize.cpp clang/lib/AST/ByteCode/Pointer.cpp clang/lib/AST/ByteCode/Pointer.h clang/lib/AST/ExprConstShared.h clang/lib/AST/ExprConstant.cpp clang/test/AST/ByteCode/builtin-functions.cpp clang/test/AST/ByteCode/codegen-constexpr-unknown.cpp clang/test/AST/ByteCode/references.cpp clang/test/CodeGenCXX/global-init.cpp clang/test/SemaCXX/PR19955.cpp clang/test/SemaCXX/cxx2c-expansion-stmts.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/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 2df754dc9..d3d91677d 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -1964,7 +1964,7 @@ static bool IsGlobalLValue(APValue::LValueBase B) {
   if (!B)
     return true;
 
-  if (const ValueDecl *D = B.dyn_cast<const ValueDecl*>()) {
+  if (const ValueDecl *D = B.dyn_cast<const ValueDecl *>()) {
     // ... the address of an object with static storage duration,
     if (const VarDecl *VD = dyn_cast<VarDecl>(D))
       return VD->hasGlobalStorage();
@@ -1979,7 +1979,7 @@ static bool IsGlobalLValue(APValue::LValueBase B) {
   if (B.is<TypeInfoLValue>() || B.is<DynamicAllocLValue>())
     return true;
 
-  const Expr *E = B.get<const Expr*>();
+  const Expr *E = B.get<const Expr *>();
   switch (E->getStmtClass()) {
   default:
     return false;

``````````

</details>


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


More information about the cfe-commits mailing list