[clang] [clang][bytecode] Support different integral types (e.g. addresses) (PR #169769)

via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 14 05:22:25 PST 2026


Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/169769 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,h,c -- clang/test/AST/ByteCode/addr-label-diff.c clang/test/AST/ByteCode/addr-label-diff.cpp clang/lib/AST/ByteCode/Boolean.h clang/lib/AST/ByteCode/Context.cpp clang/lib/AST/ByteCode/Descriptor.cpp clang/lib/AST/ByteCode/Descriptor.h clang/lib/AST/ByteCode/EvalEmitter.cpp clang/lib/AST/ByteCode/FixedPoint.h clang/lib/AST/ByteCode/Floating.h clang/lib/AST/ByteCode/Integral.h clang/lib/AST/ByteCode/IntegralAP.h clang/lib/AST/ByteCode/Interp.cpp clang/lib/AST/ByteCode/Interp.h clang/lib/AST/ByteCode/InterpBuiltin.cpp clang/lib/AST/ByteCode/InterpFrame.cpp clang/lib/AST/ByteCode/InterpHelpers.h clang/lib/AST/ByteCode/InterpStack.h clang/lib/AST/ByteCode/MemberPointer.cpp clang/lib/AST/ByteCode/MemberPointer.h clang/lib/AST/ByteCode/Pointer.cpp clang/lib/AST/ByteCode/Pointer.h clang/lib/AST/ByteCode/PrimType.h clang/lib/AST/ByteCode/Primitives.h clang/lib/AST/ByteCode/Program.cpp clang/lib/AST/ByteCode/Program.h clang/test/AST/ByteCode/const-eval.c clang/test/AST/ByteCode/cxx11.cpp clang/test/CodeGen/const-init.c clang/test/CodeGen/const-label-addr.c clang/test/CodeGen/statements.c clang/test/CodeGen/staticinit.c clang/test/CodeGenCXX/2008-05-07-CrazyOffsetOf.cpp clang/test/CodeGenCXX/const-init-cxx11.cpp clang/test/CodeGenCXX/const-init.cpp clang/test/Sema/array-init.c clang/test/Sema/compound-literal.c clang/test/Sema/const-ptr-int-ptr-cast.c clang/test/SemaCXX/constexpr-string.cpp clang/unittests/AST/ByteCode/toAPValue.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/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
index 94eae89df..648be1c24 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
@@ -368,7 +368,6 @@ static bool interp__builtin_strlen(InterpState &S, CodePtr OpPC,
   unsigned ElemSize = StrPtr.getFieldDesc()->getElemDataSize();
   if (ElemSize != 1 && ElemSize != 2 && ElemSize != 4)
     return Invalid(S, OpPC);
-  
 
   if (ID == Builtin::BI__builtin_wcslen || ID == Builtin::BIwcslen) {
     const ASTContext &AC = S.getASTContext();
diff --git a/clang/lib/AST/ByteCode/MemberPointer.h b/clang/lib/AST/ByteCode/MemberPointer.h
index a1c7bd505..a3089f8e8 100644
--- a/clang/lib/AST/ByteCode/MemberPointer.h
+++ b/clang/lib/AST/ByteCode/MemberPointer.h
@@ -160,7 +160,8 @@ public:
        << ". IsDerived: " << isDerivedMember() << ")";
   }
 
-  std::string toDiagnosticString(const ASTContext &Ctx, const Program &P) const {
+  std::string toDiagnosticString(const ASTContext &Ctx,
+                                 const Program &P) const {
     return toAPValue(Ctx, P).getAsString(Ctx, getDecl()->getType());
   }
 };

``````````

</details>


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


More information about the cfe-commits mailing list