================
@@ -902,8 +911,18 @@ inline llvm::raw_ostream &operator<<(llvm::raw_ostream
&OS, const Pointer &P) {
if (P.isArrayElement()) {
if (P.isOnePastEnd())
OS << " one-past-the-end";
- else
- OS << " index " << P.getIndex();
+ else {
+ OS << ' ';
+ std::string Indices;
+ llvm::raw_string_ostream SS(Indices);
+ Pointer K = P;
+ while (K.isArrayElement()) {
+ SS << ']' << K.expand().getIndex() << '[';
+ K = K.expand().getArray();
+ }
+ std::reverse(Indices.begin(), Indices.end());
+ OS << Indices;
----------------
efriedma-quic wrote:
Thanks, this will make things easier to debug in the future.
https://github.com/llvm/llvm-project/pull/200342
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits