Skip to content

Commit

Permalink
[clang][Interp][NFC] Improve Pointer::print()
Browse files Browse the repository at this point in the history
Print the symbolic values of Base and Offset if appropriate.
  • Loading branch information
tbaederr committed Aug 17, 2023
1 parent 51dfe3c commit 6f7812f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion clang/lib/AST/Interp/Pointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,17 @@ class Pointer {

/// Prints the pointer.
void print(llvm::raw_ostream &OS) const {
OS << Pointee << " {" << Base << ", " << Offset << ", ";
OS << Pointee << " {";
if (Base == RootPtrMark)
OS << "rootptr, ";
else
OS << Base << ", ";

if (Offset == PastEndMark)
OS << "pastend, ";
else
OS << Offset << ", ";

if (Pointee)
OS << Pointee->getSize();
else
Expand Down

0 comments on commit 6f7812f

Please sign in to comment.