forked from OSchip/llvm-project
				
			Minor cleanup of SBTypeSummary::CreateWithCallback to take an optional description argument
llvm-svn: 251377
This commit is contained in:
		
							parent
							
								
									9e9cf54eb2
								
							
						
					
					
						commit
						e7cbaf3e0e
					
				| 
						 | 
					@ -87,7 +87,8 @@ namespace lldb {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        static SBTypeSummary
 | 
					        static SBTypeSummary
 | 
				
			||||||
        CreateWithCallback (FormatCallback cb, 
 | 
					        CreateWithCallback (FormatCallback cb, 
 | 
				
			||||||
                            uint32_t options = 0);
 | 
					                            uint32_t options = 0,
 | 
				
			||||||
 | 
					                            const char* description = nullptr);
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        SBTypeSummary (const lldb::SBTypeSummary &rhs);
 | 
					        SBTypeSummary (const lldb::SBTypeSummary &rhs);
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -147,22 +147,25 @@ SBTypeSummary::CreateWithScriptCode (const char* data, uint32_t options)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SBTypeSummary
 | 
					SBTypeSummary
 | 
				
			||||||
SBTypeSummary::CreateWithCallback (FormatCallback cb, uint32_t options)
 | 
					SBTypeSummary::CreateWithCallback (FormatCallback cb, uint32_t options, const char* description)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    return SBTypeSummary(
 | 
					    SBTypeSummary retval;
 | 
				
			||||||
               TypeSummaryImplSP(
 | 
					    if (cb)
 | 
				
			||||||
                   cb ? new CXXFunctionSummaryFormat(options,
 | 
					    {
 | 
				
			||||||
 | 
					        retval.SetSP(TypeSummaryImplSP(new CXXFunctionSummaryFormat(options,
 | 
				
			||||||
                                                                    [cb] (ValueObject& valobj, Stream& stm, const TypeSummaryOptions& opt) -> bool {
 | 
					                                                                    [cb] (ValueObject& valobj, Stream& stm, const TypeSummaryOptions& opt) -> bool {
 | 
				
			||||||
                                                                        SBStream stream;
 | 
					                                                                        SBStream stream;
 | 
				
			||||||
                            if (!cb(SBValue(valobj.GetSP()), SBTypeSummaryOptions(&opt), stream))
 | 
					                                                                        SBValue sb_value(valobj.GetSP());
 | 
				
			||||||
 | 
					                                                                        SBTypeSummaryOptions options(&opt);
 | 
				
			||||||
 | 
					                                                                        if (!cb(sb_value, options, stream))
 | 
				
			||||||
                                                                            return false;
 | 
					                                                                            return false;
 | 
				
			||||||
                                                                        stm.Write(stream.GetData(), stream.GetSize());
 | 
					                                                                        stm.Write(stream.GetData(), stream.GetSize());
 | 
				
			||||||
                                                                        return true;
 | 
					                                                                        return true;
 | 
				
			||||||
                                                                    },
 | 
					                                                                    },
 | 
				
			||||||
                       "SBTypeSummary formatter callback"
 | 
					                                                                    description ? description : "callback summary formatter")));
 | 
				
			||||||
                   ) : nullptr
 | 
					    }
 | 
				
			||||||
                )
 | 
					    
 | 
				
			||||||
            );
 | 
					    return retval;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SBTypeSummary::SBTypeSummary (const lldb::SBTypeSummary &rhs) :
 | 
					SBTypeSummary::SBTypeSummary (const lldb::SBTypeSummary &rhs) :
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue