YLChenZ wrote:

> Would be good to print more information about them.

@tbaederr  It seems to only dump their type, like this:
```cpp
case APValue::LValue: {
    (void)Context;
    OS << "LValue Base=";
    APValue::LValueBase B = Value.getLValueBase();
    ...
    } else if (B.is<TypeInfoLValue>()) {
      OS << "TypeInfoLValue";
      const auto BTI = B.get<TypeInfoLValue>();
      BTI.print(OS, PrintPolicy);
    } else if (B.is<DynamicAllocLValue>()) {
      OS << "DynamicAllocLValue";
      auto BDA = B.getDynamicAllocType();
      dumpType(BDA);
    }
```

```cpp
//test.cpp
#include <typeinfo>
constexpr const std::type_info* val = &typeid(int);
```
```
lambda@ubuntu22:~/test$ clang++ -std=c++20 -Xclang -ast-dump -fsyntax-only 
test.cpp
LValue Base=TypeInfoLValue typeid(int), Null=0, Offset=0, HasPath=1, 
PathLength=0, Path=()
```

```cpp
//DAtest.cpp
constexpr int *m = new int(42);
```
```
lambda@ubuntu22:~/test$ clang++ -std=c++20 -Xclang -ast-dump -fsyntax-only 
DAtest.cpp
LValue Base=DynamicAllocLValue 'int', Null=0, Offset=0, HasPath=1, 
PathLength=0, Path=()
```

https://github.com/llvm/llvm-project/pull/135178
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to