[Lldb-commits] [lldb] [LLDB] Add type casting to DIL, part 1 of 3. (PR #165199)

via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 17 11:26:55 PST 2025


================
@@ -339,6 +463,40 @@ std::string DILParser::ParseUnqualifiedId() {
   return identifier;
 }
 
+CompilerType
+DILParser::ResolveTypeDeclarators(CompilerType type,
+                                  const std::vector<Token> &ptr_operators) {
+  CompilerType bad_type;
+  // Resolve pointers/references.
+  for (Token tk : ptr_operators) {
+    uint32_t loc = tk.GetLocation();
+    if (tk.GetKind() == Token::star) {
+      // Pointers to reference types are forbidden.
+      if (type.IsReferenceType()) {
+        BailOut(llvm::formatv("'type name' declared as a pointer to a "
+                              "reference of type {0}",
+                              type.TypeDescription()),
+                loc, CurToken().GetSpelling().length());
+        return bad_type;
+      }
----------------
jimingham wrote:

The DIL implements the inspection of values in memory.  The operations it supports aren't intended to be "language accurate", for instance we aren't calling overloaded operators, etc.  And because of the ways you can name the children provided by synthetic child providers, it may even not describe the objects as they might appear in the source language.
So for that reason, I don't want to give the impression that this IS the expression parser.  That's one reason why I think it isn't terribly important that we support each (or even the current) language's way to express cast, dereference, etc.  That's just doing work to make an impression that isn't correct.

https://github.com/llvm/llvm-project/pull/165199


More information about the lldb-commits mailing list