Skip to content

Commit d232abc

Browse files
committed
[lldb] Remove LLDB_RECORD_RESULT macro
1 parent c4cdf86 commit d232abc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+801
-850
lines changed

lldb/include/lldb/Utility/ReproducerInstrumentation.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ template <typename... Ts> inline std::string stringify_args(const Ts &... ts) {
125125
LLDB_RECORD_CHAR_PTR_(Result(*) Signature, (&Class::Method), StrOut, \
126126
__VA_ARGS__)
127127

128-
#define LLDB_RECORD_RESULT(Result) Result;
129-
130128
/// The LLDB_RECORD_DUMMY macro is special because it doesn't actually record
131129
/// anything. It's used to track API boundaries when we cannot record for
132130
/// technical reasons.

lldb/source/API/SBAddress.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const SBAddress &SBAddress::operator=(const SBAddress &rhs) {
5757

5858
if (this != &rhs)
5959
m_opaque_up = clone(rhs.m_opaque_up);
60-
return LLDB_RECORD_RESULT(*this);
60+
return *this;
6161
}
6262

6363
bool lldb::operator==(const SBAddress &lhs, const SBAddress &rhs) {
@@ -162,7 +162,7 @@ lldb::SBSection SBAddress::GetSection() {
162162
lldb::SBSection sb_section;
163163
if (m_opaque_up->IsValid())
164164
sb_section.SetSP(m_opaque_up->GetSection());
165-
return LLDB_RECORD_RESULT(sb_section);
165+
return sb_section;
166166
}
167167

168168
lldb::addr_t SBAddress::GetOffset() {
@@ -214,7 +214,7 @@ SBModule SBAddress::GetModule() {
214214
SBModule sb_module;
215215
if (m_opaque_up->IsValid())
216216
sb_module.SetSP(m_opaque_up->GetModule());
217-
return LLDB_RECORD_RESULT(sb_module);
217+
return sb_module;
218218
}
219219

220220
SBSymbolContext SBAddress::GetSymbolContext(uint32_t resolve_scope) {
@@ -225,7 +225,7 @@ SBSymbolContext SBAddress::GetSymbolContext(uint32_t resolve_scope) {
225225
SymbolContextItem scope = static_cast<SymbolContextItem>(resolve_scope);
226226
if (m_opaque_up->IsValid())
227227
m_opaque_up->CalculateSymbolContext(&sb_sc.ref(), scope);
228-
return LLDB_RECORD_RESULT(sb_sc);
228+
return sb_sc;
229229
}
230230

231231
SBCompileUnit SBAddress::GetCompileUnit() {
@@ -234,7 +234,7 @@ SBCompileUnit SBAddress::GetCompileUnit() {
234234
SBCompileUnit sb_comp_unit;
235235
if (m_opaque_up->IsValid())
236236
sb_comp_unit.reset(m_opaque_up->CalculateSymbolContextCompileUnit());
237-
return LLDB_RECORD_RESULT(sb_comp_unit);
237+
return sb_comp_unit;
238238
}
239239

240240
SBFunction SBAddress::GetFunction() {
@@ -243,7 +243,7 @@ SBFunction SBAddress::GetFunction() {
243243
SBFunction sb_function;
244244
if (m_opaque_up->IsValid())
245245
sb_function.reset(m_opaque_up->CalculateSymbolContextFunction());
246-
return LLDB_RECORD_RESULT(sb_function);
246+
return sb_function;
247247
}
248248

249249
SBBlock SBAddress::GetBlock() {
@@ -252,7 +252,7 @@ SBBlock SBAddress::GetBlock() {
252252
SBBlock sb_block;
253253
if (m_opaque_up->IsValid())
254254
sb_block.SetPtr(m_opaque_up->CalculateSymbolContextBlock());
255-
return LLDB_RECORD_RESULT(sb_block);
255+
return sb_block;
256256
}
257257

258258
SBSymbol SBAddress::GetSymbol() {
@@ -261,7 +261,7 @@ SBSymbol SBAddress::GetSymbol() {
261261
SBSymbol sb_symbol;
262262
if (m_opaque_up->IsValid())
263263
sb_symbol.reset(m_opaque_up->CalculateSymbolContextSymbol());
264-
return LLDB_RECORD_RESULT(sb_symbol);
264+
return sb_symbol;
265265
}
266266

267267
SBLineEntry SBAddress::GetLineEntry() {
@@ -273,5 +273,5 @@ SBLineEntry SBAddress::GetLineEntry() {
273273
if (m_opaque_up->CalculateSymbolContextLineEntry(line_entry))
274274
sb_line_entry.SetLineEntry(line_entry);
275275
}
276-
return LLDB_RECORD_RESULT(sb_line_entry);
276+
return sb_line_entry;
277277
}

lldb/source/API/SBAttachInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ SBAttachInfo &SBAttachInfo::operator=(const SBAttachInfo &rhs) {
6464

6565
if (this != &rhs)
6666
m_opaque_sp = clone(rhs.m_opaque_sp);
67-
return LLDB_RECORD_RESULT(*this);
67+
return *this;
6868
}
6969

7070
lldb::pid_t SBAttachInfo::GetProcessID() {
@@ -249,7 +249,7 @@ bool SBAttachInfo::ParentProcessIDIsValid() {
249249
SBListener SBAttachInfo::GetListener() {
250250
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBListener, SBAttachInfo, GetListener);
251251

252-
return LLDB_RECORD_RESULT(SBListener(m_opaque_sp->GetListener()));
252+
return SBListener(m_opaque_sp->GetListener());
253253
}
254254

255255
void SBAttachInfo::SetListener(SBListener &listener) {

lldb/source/API/SBBlock.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const SBBlock &SBBlock::operator=(const SBBlock &rhs) {
3939
SBBlock, operator=,(const lldb::SBBlock &), rhs);
4040

4141
m_opaque_ptr = rhs.m_opaque_ptr;
42-
return LLDB_RECORD_RESULT(*this);
42+
return *this;
4343
}
4444

4545
SBBlock::~SBBlock() { m_opaque_ptr = nullptr; }
@@ -86,7 +86,7 @@ SBFileSpec SBBlock::GetInlinedCallSiteFile() const {
8686
if (inlined_info)
8787
sb_file.SetFileSpec(inlined_info->GetCallSite().GetFile());
8888
}
89-
return LLDB_RECORD_RESULT(sb_file);
89+
return sb_file;
9090
}
9191

9292
uint32_t SBBlock::GetInlinedCallSiteLine() const {
@@ -128,7 +128,7 @@ SBBlock SBBlock::GetParent() {
128128
SBBlock sb_block;
129129
if (m_opaque_ptr)
130130
sb_block.m_opaque_ptr = m_opaque_ptr->GetParent();
131-
return LLDB_RECORD_RESULT(sb_block);
131+
return sb_block;
132132
}
133133

134134
lldb::SBBlock SBBlock::GetContainingInlinedBlock() {
@@ -137,7 +137,7 @@ lldb::SBBlock SBBlock::GetContainingInlinedBlock() {
137137
SBBlock sb_block;
138138
if (m_opaque_ptr)
139139
sb_block.m_opaque_ptr = m_opaque_ptr->GetContainingInlinedBlock();
140-
return LLDB_RECORD_RESULT(sb_block);
140+
return sb_block;
141141
}
142142

143143
SBBlock SBBlock::GetSibling() {
@@ -146,7 +146,7 @@ SBBlock SBBlock::GetSibling() {
146146
SBBlock sb_block;
147147
if (m_opaque_ptr)
148148
sb_block.m_opaque_ptr = m_opaque_ptr->GetSibling();
149-
return LLDB_RECORD_RESULT(sb_block);
149+
return sb_block;
150150
}
151151

152152
SBBlock SBBlock::GetFirstChild() {
@@ -155,7 +155,7 @@ SBBlock SBBlock::GetFirstChild() {
155155
SBBlock sb_block;
156156
if (m_opaque_ptr)
157157
sb_block.m_opaque_ptr = m_opaque_ptr->GetFirstChild();
158-
return LLDB_RECORD_RESULT(sb_block);
158+
return sb_block;
159159
}
160160

161161
lldb_private::Block *SBBlock::GetPtr() { return m_opaque_ptr; }
@@ -206,7 +206,7 @@ lldb::SBAddress SBBlock::GetRangeStartAddress(uint32_t idx) {
206206
sb_addr.ref() = range.GetBaseAddress();
207207
}
208208
}
209-
return LLDB_RECORD_RESULT(sb_addr);
209+
return sb_addr;
210210
}
211211

212212
lldb::SBAddress SBBlock::GetRangeEndAddress(uint32_t idx) {
@@ -221,7 +221,7 @@ lldb::SBAddress SBBlock::GetRangeEndAddress(uint32_t idx) {
221221
sb_addr.ref().Slide(range.GetByteSize());
222222
}
223223
}
224-
return LLDB_RECORD_RESULT(sb_addr);
224+
return sb_addr;
225225
}
226226

227227
uint32_t SBBlock::GetRangeIndexForBlockAddress(lldb::SBAddress block_addr) {
@@ -289,7 +289,7 @@ lldb::SBValueList SBBlock::GetVariables(lldb::SBFrame &frame, bool arguments,
289289
}
290290
}
291291
}
292-
return LLDB_RECORD_RESULT(value_list);
292+
return value_list;
293293
}
294294

295295
lldb::SBValueList SBBlock::GetVariables(lldb::SBTarget &target, bool arguments,
@@ -341,5 +341,5 @@ lldb::SBValueList SBBlock::GetVariables(lldb::SBTarget &target, bool arguments,
341341
}
342342
}
343343
}
344-
return LLDB_RECORD_RESULT(value_list);
344+
return value_list;
345345
}

lldb/source/API/SBBreakpoint.cpp

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const SBBreakpoint &SBBreakpoint::operator=(const SBBreakpoint &rhs) {
6464
SBBreakpoint, operator=,(const lldb::SBBreakpoint &), rhs);
6565

6666
m_opaque_wp = rhs.m_opaque_wp;
67-
return LLDB_RECORD_RESULT(*this);
67+
return *this;
6868
}
6969

7070
bool SBBreakpoint::operator==(const lldb::SBBreakpoint &rhs) {
@@ -86,9 +86,9 @@ SBTarget SBBreakpoint::GetTarget() const {
8686

8787
BreakpointSP bkpt_sp = GetSP();
8888
if (bkpt_sp)
89-
return LLDB_RECORD_RESULT(SBTarget(bkpt_sp->GetTargetSP()));
89+
return SBTarget(bkpt_sp->GetTargetSP());
9090

91-
return LLDB_RECORD_RESULT(SBTarget());
91+
return SBTarget();
9292
}
9393

9494
break_id_t SBBreakpoint::GetID() const {
@@ -148,7 +148,7 @@ SBBreakpointLocation SBBreakpoint::FindLocationByAddress(addr_t vm_addr) {
148148
sb_bp_location.SetLocation(bkpt_sp->FindLocationByAddress(address));
149149
}
150150
}
151-
return LLDB_RECORD_RESULT(sb_bp_location);
151+
return sb_bp_location;
152152
}
153153

154154
break_id_t SBBreakpoint::FindLocationIDByAddress(addr_t vm_addr) {
@@ -185,7 +185,7 @@ SBBreakpointLocation SBBreakpoint::FindLocationByID(break_id_t bp_loc_id) {
185185
sb_bp_location.SetLocation(bkpt_sp->FindLocationByID(bp_loc_id));
186186
}
187187

188-
return LLDB_RECORD_RESULT(sb_bp_location);
188+
return sb_bp_location;
189189
}
190190

191191
SBBreakpointLocation SBBreakpoint::GetLocationAtIndex(uint32_t index) {
@@ -201,7 +201,7 @@ SBBreakpointLocation SBBreakpoint::GetLocationAtIndex(uint32_t index) {
201201
sb_bp_location.SetLocation(bkpt_sp->GetLocationAtIndex(index));
202202
}
203203

204-
return LLDB_RECORD_RESULT(sb_bp_location);
204+
return sb_bp_location;
205205
}
206206

207207
void SBBreakpoint::SetEnabled(bool enable) {
@@ -560,17 +560,17 @@ SBError SBBreakpoint::AddLocation(SBAddress &address) {
560560

561561
if (!address.IsValid()) {
562562
error.SetErrorString("Can't add an invalid address.");
563-
return LLDB_RECORD_RESULT(error);
563+
return error;
564564
}
565565

566566
if (!bkpt_sp) {
567567
error.SetErrorString("No breakpoint to add a location to.");
568-
return LLDB_RECORD_RESULT(error);
568+
return error;
569569
}
570570

571571
if (!llvm::isa<BreakpointResolverScripted>(bkpt_sp->GetResolver().get())) {
572572
error.SetErrorString("Only a scripted resolver can add locations.");
573-
return LLDB_RECORD_RESULT(error);
573+
return error;
574574
}
575575

576576
if (bkpt_sp->GetSearchFilter()->AddressPasses(address.ref()))
@@ -582,7 +582,7 @@ SBError SBBreakpoint::AddLocation(SBAddress &address) {
582582
error.SetErrorStringWithFormat("Address: %s didn't pass the filter.",
583583
s.GetData());
584584
}
585-
return LLDB_RECORD_RESULT(error);
585+
return error;
586586
}
587587

588588
SBStructuredData SBBreakpoint::SerializeToStructuredData() {
@@ -593,11 +593,11 @@ SBStructuredData SBBreakpoint::SerializeToStructuredData() {
593593
BreakpointSP bkpt_sp = GetSP();
594594

595595
if (!bkpt_sp)
596-
return LLDB_RECORD_RESULT(data);
596+
return data;
597597

598598
StructuredData::ObjectSP bkpt_dict = bkpt_sp->SerializeToStructuredData();
599599
data.m_impl_up->SetObjectSP(bkpt_dict);
600-
return LLDB_RECORD_RESULT(data);
600+
return data;
601601
}
602602

603603
void SBBreakpoint::SetCallback(SBBreakpointHitCallback callback, void *baton) {
@@ -647,8 +647,8 @@ SBError SBBreakpoint::SetScriptCallbackFunction(
647647
sb_error.SetError(error);
648648
} else
649649
sb_error.SetErrorString("invalid breakpoint");
650-
651-
return LLDB_RECORD_RESULT(sb_error);
650+
651+
return sb_error;
652652
}
653653

654654
SBError SBBreakpoint::SetScriptCallbackBody(const char *callback_body_text) {
@@ -671,7 +671,7 @@ SBError SBBreakpoint::SetScriptCallbackBody(const char *callback_body_text) {
671671
} else
672672
sb_error.SetErrorString("invalid breakpoint");
673673

674-
return LLDB_RECORD_RESULT(sb_error);
674+
return sb_error;
675675
}
676676

677677
bool SBBreakpoint::AddName(const char *new_name) {
@@ -698,7 +698,7 @@ SBError SBBreakpoint::AddNameWithErrorHandling(const char *new_name) {
698698
status.SetErrorString("invalid breakpoint");
699699
}
700700

701-
return LLDB_RECORD_RESULT(status);
701+
return status;
702702
}
703703

704704
void SBBreakpoint::RemoveName(const char *name_to_remove) {
@@ -772,10 +772,9 @@ SBBreakpoint SBBreakpoint::GetBreakpointFromEvent(const lldb::SBEvent &event) {
772772
event);
773773

774774
if (event.IsValid())
775-
return LLDB_RECORD_RESULT(
776-
SBBreakpoint(Breakpoint::BreakpointEventData::GetBreakpointFromEvent(
777-
event.GetSP())));
778-
return LLDB_RECORD_RESULT(SBBreakpoint());
775+
return SBBreakpoint(
776+
Breakpoint::BreakpointEventData::GetBreakpointFromEvent(event.GetSP()));
777+
return SBBreakpoint();
779778
}
780779

781780
SBBreakpointLocation
@@ -790,7 +789,7 @@ SBBreakpoint::GetBreakpointLocationAtIndexFromEvent(const lldb::SBEvent &event,
790789
sb_breakpoint_loc.SetLocation(
791790
Breakpoint::BreakpointEventData::GetBreakpointLocationAtIndexFromEvent(
792791
event.GetSP(), loc_idx));
793-
return LLDB_RECORD_RESULT(sb_breakpoint_loc);
792+
return sb_breakpoint_loc;
794793
}
795794

796795
uint32_t
@@ -923,20 +922,20 @@ SBBreakpoint SBBreakpointList::GetBreakpointAtIndex(size_t idx) {
923922
(size_t), idx);
924923

925924
if (!m_opaque_sp)
926-
return LLDB_RECORD_RESULT(SBBreakpoint());
925+
return SBBreakpoint();
927926

928927
BreakpointSP bkpt_sp = m_opaque_sp->GetBreakpointAtIndex(idx);
929-
return LLDB_RECORD_RESULT(SBBreakpoint(bkpt_sp));
928+
return SBBreakpoint(bkpt_sp);
930929
}
931930

932931
SBBreakpoint SBBreakpointList::FindBreakpointByID(lldb::break_id_t id) {
933932
LLDB_RECORD_METHOD(lldb::SBBreakpoint, SBBreakpointList, FindBreakpointByID,
934933
(lldb::break_id_t), id);
935934

936935
if (!m_opaque_sp)
937-
return LLDB_RECORD_RESULT(SBBreakpoint());
936+
return SBBreakpoint();
938937
BreakpointSP bkpt_sp = m_opaque_sp->FindBreakpointByID(id);
939-
return LLDB_RECORD_RESULT(SBBreakpoint(bkpt_sp));
938+
return SBBreakpoint(bkpt_sp);
940939
}
941940

942941
void SBBreakpointList::Append(const SBBreakpoint &sb_bkpt) {

0 commit comments

Comments
 (0)