riccibruno added a comment.

I agree with you that it's fine to use `printPretty`  for leaves (and 
additionally it would be annoying to duplicate the `LValue` case); that's what 
I was planning to do anyway.

What I am not sure I agree with is the additional complexity to handle the 
(debugger-only and easy to avoid) case where no context is given.



================
Comment at: clang/lib/AST/APValue.cpp:539
         Out << '[' << Path[I].getAsArrayIndex() << ']';
-        ElemTy = Ctx.getAsArrayType(ElemTy)->getElementType();
+        ElemTy = cast<ArrayType>(ElemTy.getCanonicalType())->getElementType();
       }
----------------
riccibruno wrote:
> And also I don't think that this change is safe since 
> `ASTContext::getAsArrayType` applies qualifiers from the array type to the 
> element type.
This works because we only use `ElemTy` to distinguish between the array case 
and the base-or-member case right?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85144/new/

https://reviews.llvm.org/D85144

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to