Michael137 wrote:

Latest commit narrows the heuristics so it specifically applies to `CallExpr`s 
generated for structured bindings. Here's what the AST looks like when stopped 
in `IgnoreImplicitCallSingleStep` for a structured binding:

```
(lldb) p E->dump()                                                              
                                                                                
                     
CallExpr 0x912dd6cb8 'int' adl                                                  
                                                                                
                     
|-ImplicitCastExpr 0x912dd6ca0 'int (*)(triple)' <FunctionToPointerDecay>       
                                                                                
                     
| `-DeclRefExpr 0x912dd6be8 'int (triple)' lvalue Function 0x912dbdb98 'get' 
'int (triple)' (FunctionTemplate 0x912dbd990 'get')                             
                        
`-CXXConstructExpr 0x912dd80e0 'triple' 'void (triple &&) noexcept'             
                                                                                
                     
  `-ImplicitCastExpr 0x912dd64b0 'std::triple' xvalue <NoOp>                    
                                                                                
                     
    `-DeclRefExpr 0x912dd6490 'std::triple' lvalue Decomposition 0x912dd4f68 
first_binding 'k' 'std::triple'                                                 
                        

(lldb) p A->dump()                                                              
                                                                                
                     
CXXConstructExpr 0x912dd80e0 'triple' 'void (triple &&) noexcept'               
                                                                                
                     
`-ImplicitCastExpr 0x912dd64b0 'std::triple' xvalue <NoOp>                      
                                                                                
                     
  `-DeclRefExpr 0x912dd6490 'std::triple' lvalue Decomposition 0x912dd4f68 
first_binding 'k' 'std::triple'                                                 
                          
```

What my latest change does is try and get to that `DeclRefExpr 0x912dd6490 
'std::triple' lvalue Decomposition` node. And only for those cases ignore the 
`CallExpr`.

Let me know what you think @cor3ntin @AaronBallman. There might be a better way 
of doing this. Particularly, I wasn't sure how to unwrap the `DeclRefExpr`, so 
I just used `IgnoreUnlessSpelledInSource` again (recursively).

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

Reply via email to