[llvm] f0acfaf - [llvm][utils] Disable lldb formatters for PointerIntPair and PointerUnion

Dave Lee via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 15:51:31 PDT 2023


Author: Dave Lee
Date: 2023-07-13T15:51:25-07:00
New Revision: f0acfaf9241899552eca6baf3db1cebd1d6f2034

URL: https://github.com/llvm/llvm-project/commit/f0acfaf9241899552eca6baf3db1cebd1d6f2034
DIFF: https://github.com/llvm/llvm-project/commit/f0acfaf9241899552eca6baf3db1cebd1d6f2034.diff

LOG: [llvm][utils] Disable lldb formatters for PointerIntPair and PointerUnion

These synthetic providers use expression evaluation and fail in some cases.

Examples:

```
llvm::PointerIntPair<llvm::PointerUnion<const Type *, const ExtQuals *>,
                     Qualifiers::FastWidth> Value;
```

and

```
typedef llvm::PointerUnion<const ValueDecl *, const Expr *, TypeInfoLValue,
                           DynamicAllocLValue>
        PtrTy;
```

Original contribution: D117779

rdar://110791233
rdar://112195543

Differential Revision: https://reviews.llvm.org/D155219

Added: 
    

Modified: 
    llvm/utils/lldbDataFormatters.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/lldbDataFormatters.py b/llvm/utils/lldbDataFormatters.py
index df62ed0884ae46..29c17adf382e52 100644
--- a/llvm/utils/lldbDataFormatters.py
+++ b/llvm/utils/lldbDataFormatters.py
@@ -65,16 +65,20 @@ def __lldb_init_module(debugger, internal_dict):
         "-F lldbDataFormatters.ConstStringSummaryProvider "
         '-x "^lldb_private::ConstString$"'
     )
-    debugger.HandleCommand(
-        "type synthetic add -w llvm "
-        "-l lldbDataFormatters.PointerIntPairSynthProvider "
-        '-x "^llvm::PointerIntPair<.+>$"'
-    )
-    debugger.HandleCommand(
-        "type synthetic add -w llvm "
-        "-l lldbDataFormatters.PointerUnionSynthProvider "
-        '-x "^llvm::PointerUnion<.+>$"'
-    )
+
+    # The synthetic providers for PointerIntPair and PointerUnion are disabled
+    # because of a few issues. One example is template arguments that are
+    # non-pointer types that instead specialize PointerLikeTypeTraits.
+    # debugger.HandleCommand(
+    #     "type synthetic add -w llvm "
+    #     "-l lldbDataFormatters.PointerIntPairSynthProvider "
+    #     '-x "^llvm::PointerIntPair<.+>$"'
+    # )
+    # debugger.HandleCommand(
+    #     "type synthetic add -w llvm "
+    #     "-l lldbDataFormatters.PointerUnionSynthProvider "
+    #     '-x "^llvm::PointerUnion<.+>$"'
+    # )
 
 
 # Pretty printer for llvm::SmallVector/llvm::SmallVectorImpl


        


More information about the llvm-commits mailing list