Skip to content

Commit 7bbfd68

Browse files
bulbazordmedismailben
authored andcommitted
[lldb][NFCI] Apply LLDB_DEPRECATED to things that have deprecated comments
Now that we have a proper way to deprecate things in the SB API, we should apply it where we have manually done so with comments. Differential Revision: https://reviews.llvm.org/D153824 Signed-off-by: Med Ismail Bennani <[email protected]>
1 parent 7e51f69 commit 7bbfd68

File tree

5 files changed

+46
-19
lines changed

5 files changed

+46
-19
lines changed

lldb/include/lldb/API/SBCommandReturnObject.h

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ class LLDB_API SBCommandReturnObject {
4747
const char *GetError();
4848

4949
#ifndef SWIG
50-
size_t PutOutput(FILE *fh); // DEPRECATED
50+
LLDB_DEPRECATED("Use PutOutput(SBFile) or PutOutput(FileSP)",
51+
"PutOutput(SBFile)")
52+
size_t PutOutput(FILE *fh);
5153
#endif
5254

5355
size_t PutOutput(SBFile file);
@@ -59,7 +61,9 @@ class LLDB_API SBCommandReturnObject {
5961
size_t GetErrorSize();
6062

6163
#ifndef SWIG
62-
size_t PutError(FILE *fh); // DEPRECATED
64+
LLDB_DEPRECATED("Use PutError(SBFile) or PutError(FileSP)",
65+
"PutError(SBFile)")
66+
size_t PutError(FILE *fh);
6367
#endif
6468

6569
size_t PutError(SBFile file);
@@ -83,13 +87,25 @@ class LLDB_API SBCommandReturnObject {
8387
bool GetDescription(lldb::SBStream &description);
8488

8589
#ifndef SWIG
86-
void SetImmediateOutputFile(FILE *fh); // DEPRECATED
87-
88-
void SetImmediateErrorFile(FILE *fh); // DEPRECATED
89-
90-
void SetImmediateOutputFile(FILE *fh, bool transfer_ownership); // DEPRECATED
91-
92-
void SetImmediateErrorFile(FILE *fh, bool transfer_ownership); // DEPRECATED
90+
LLDB_DEPRECATED(
91+
"Use SetImmediateOutputFile(SBFile) or SetImmediateOutputFile(FileSP)",
92+
"SetImmediateOutputFile(SBFile)")
93+
void SetImmediateOutputFile(FILE *fh);
94+
95+
LLDB_DEPRECATED(
96+
"Use SetImmediateErrorFile(SBFile) or SetImmediateErrorFile(FileSP)",
97+
"SetImmediateErrorFile(SBFile)")
98+
void SetImmediateErrorFile(FILE *fh);
99+
100+
LLDB_DEPRECATED(
101+
"Use SetImmediateOutputFile(SBFile) or SetImmediateOutputFile(FileSP)",
102+
"SetImmediateOutputFile(SBFile)")
103+
void SetImmediateOutputFile(FILE *fh, bool transfer_ownership);
104+
105+
LLDB_DEPRECATED(
106+
"Use SetImmediateErrorFile(SBFile) or SetImmediateErrorFile(FileSP)",
107+
"SetImmediateErrorFile(SBFile)")
108+
void SetImmediateErrorFile(FILE *fh, bool transfer_ownership);
93109
#endif
94110

95111
void SetImmediateOutputFile(SBFile file);

lldb/include/lldb/API/SBDebugger.h

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class LLDB_API SBDebugger {
113113

114114
static void Terminate();
115115

116-
// Deprecated, use the one that takes a source_init_files bool.
116+
LLDB_DEPRECATED("Use one of the other Create variants", "Create(bool)")
117117
static lldb::SBDebugger Create();
118118

119119
static lldb::SBDebugger Create(bool source_init_files);
@@ -206,9 +206,13 @@ class LLDB_API SBDebugger {
206206
lldb::SBListener GetListener();
207207

208208
#ifndef SWIG
209+
LLDB_DEPRECATED(
210+
"Use HandleProcessEvent(const SBProcess &, const SBEvent &, SBFile, "
211+
"SBFile) or HandleProcessEvent(const SBProcess &, const SBEvent &, "
212+
"FileSP, FileSP)",
213+
"HandleProcessEvent(const SBProcess &, const SBEvent &, SBFile, SBFile)")
209214
void HandleProcessEvent(const lldb::SBProcess &process,
210-
const lldb::SBEvent &event, FILE *out,
211-
FILE *err); // DEPRECATED
215+
const lldb::SBEvent &event, FILE *out, FILE *err);
212216
#endif
213217

214218
void HandleProcessEvent(const lldb::SBProcess &process,
@@ -321,8 +325,12 @@ class LLDB_API SBDebugger {
321325

322326
void SetLoggingCallback(lldb::LogOutputCallback log_callback, void *baton);
323327

324-
// DEPRECATED
328+
void SetDestroyCallback(lldb::SBDebuggerDestroyCallback destroy_callback,
329+
void *baton);
330+
325331
#ifndef SWIG
332+
LLDB_DEPRECATED("Use DispatchInput(const void *, size_t)",
333+
"DispatchInput(const void *, size_t)")
326334
void DispatchInput(void *baton, const void *data, size_t data_len);
327335
#endif
328336

lldb/include/lldb/API/SBFileSpec.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ class LLDB_API SBFileSpec {
1919

2020
SBFileSpec(const lldb::SBFileSpec &rhs);
2121

22-
SBFileSpec(const char *path); // Deprecated, use SBFileSpec (const char *path,
23-
// bool resolve)
22+
LLDB_DEPRECATED("Use the other constructor to determine if this the file "
23+
"spec should be resolved",
24+
"SBFileSpec(const char *, bool)")
25+
SBFileSpec(const char *path);
2426

2527
SBFileSpec(const char *path, bool resolve);
2628

lldb/include/lldb/API/SBProcess.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class LLDB_API SBProcess {
4848

4949
const char *GetPluginName();
5050

51-
// DEPRECATED: use GetPluginName()
51+
LLDB_DEPRECATED("Use GetPluginName()", "GetPluginName()")
5252
const char *GetShortPluginName();
5353

5454
void Clear();

lldb/include/lldb/API/SBValue.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ class LLDB_API SBValue {
105105

106106
const char *GetLocation();
107107

108-
// Deprecated - use the one that takes SBError&
108+
LLDB_DEPRECATED("Use the variant that takes an SBError &",
109+
"SetValueFromCString(const char *, SBError &)")
109110
bool SetValueFromCString(const char *value_str);
110111

111112
bool SetValueFromCString(const char *value_str, lldb::SBError &error);
@@ -123,7 +124,7 @@ class LLDB_API SBValue {
123124
lldb::SBValue CreateChildAtOffset(const char *name, uint32_t offset,
124125
lldb::SBType type);
125126

126-
// Deprecated - use the expression evaluator to perform type casting
127+
LLDB_DEPRECATED("Use the expression evaluator to perform type casting", "")
127128
lldb::SBValue Cast(lldb::SBType type);
128129

129130
lldb::SBValue CreateValueFromExpression(const char *name,
@@ -294,7 +295,7 @@ class LLDB_API SBValue {
294295

295296
lldb::SBValue Dereference();
296297

297-
// Deprecated - please use GetType().IsPointerType() instead.
298+
LLDB_DEPRECATED("Use GetType().IsPointerType() instead", "")
298299
bool TypeIsPointerType();
299300

300301
lldb::SBType GetType();

0 commit comments

Comments
 (0)