[clang] [clang][bytecode] print array root state in Pointer::print() (PR #193494)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 22 06:17:07 PDT 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Timm Baeder (tbaederr)
<details>
<summary>Changes</summary>
And check isZero() so later output checks don't run into null pointers as much.
---
Full diff: https://github.com/llvm/llvm-project/pull/193494.diff
1 Files Affected:
- (modified) clang/lib/AST/ByteCode/Pointer.h (+6-1)
``````````diff
diff --git a/clang/lib/AST/ByteCode/Pointer.h b/clang/lib/AST/ByteCode/Pointer.h
index 1c2b2f7699d17..9cc7af4c78241 100644
--- a/clang/lib/AST/ByteCode/Pointer.h
+++ b/clang/lib/AST/ByteCode/Pointer.h
@@ -888,6 +888,9 @@ class Pointer {
inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const Pointer &P) {
P.print(OS);
OS << ' ';
+ if (P.isZero())
+ return OS;
+
if (const Descriptor *D = P.getFieldDesc())
D->dump(OS);
if (P.isArrayElement()) {
@@ -895,7 +898,9 @@ inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const Pointer &P) {
OS << " one-past-the-end";
else
OS << " index " << P.getIndex();
- }
+ } else if (P.isArrayRoot())
+ OS << " arrayroot";
+
if (P.isBlockPointer() && P.block() && P.block()->isDummy())
OS << " dummy";
if (!P.isLive())
``````````
</details>
https://github.com/llvm/llvm-project/pull/193494
More information about the cfe-commits
mailing list