[PATCH] D146809: [clang-repl] Implement Value pretty printing

Jun Zhang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 30 03:04:09 PDT 2023


junaire added inline comments.


================
Comment at: clang/test/Interpreter/pretty-print.cpp:107
+p2
+// CHECK-NEXT: (std::_MakeUniq<int>::__single_object &) std::unique_ptr -> [[Addr:@0x.*]]
+
----------------
Hi @mizvekov, do you have a clue about why it doesn't print the correct type? So in `ValuePrinter.cpp:50` I dumped the type it shows:
```
AutoType 0x62d000533c00 'typename _MakeUniq<int>::__single_object' sugar
`-ElaboratedType 0x62d000450500 'typename _MakeUniq<int>::__single_object' sugar
  `-TypedefType 0x62d0004501e0 'std::_MakeUniq<int>::__single_object' sugar
    |-Typedef 0x62d000450160 '__single_object'
    `-ElaboratedType 0x62d000450100 'unique_ptr<int>' sugar
      `-TemplateSpecializationType 0x62d0004500b0 'unique_ptr<int>' sugar unique_ptr
        |-TemplateArgument type 'int':'int'
        | `-SubstTemplateTypeParmType 0x62d00044fd50 'int' sugar typename depth 0 index 0 _Tp
        |   |-ClassTemplateSpecialization 0x62d00044fa08 '_MakeUniq'
        |   `-BuiltinType 0x621000019220 'int'
        `-RecordType 0x62d000450080 'class std::unique_ptr<int>'
          `-ClassTemplateSpecialization 0x62d00044ff70 'unique_ptr'
```

But in Cling it only has the RecordType. Do you think it's affected by your type resugaring patches?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146809



More information about the cfe-commits mailing list