bulbazord created this revision.
bulbazord added reviewers: JDevlieghere, mib, jingham, jasonmolenda.
Herald added a project: All.
bulbazord requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153824

Files:
  lldb/include/lldb/API/SBCommandReturnObject.h
  lldb/include/lldb/API/SBDebugger.h
  lldb/include/lldb/API/SBFileSpec.h
  lldb/include/lldb/API/SBProcess.h
  lldb/include/lldb/API/SBValue.h

Index: lldb/include/lldb/API/SBValue.h
===================================================================
--- lldb/include/lldb/API/SBValue.h
+++ lldb/include/lldb/API/SBValue.h
@@ -105,7 +105,8 @@
 
   const char *GetLocation();
 
-  // Deprecated - use the one that takes SBError&
+  LLDB_DEPRECATED("Use the variant that takes an SBError &",
+                  "SetValueFromCString(const char *, SBError &)")
   bool SetValueFromCString(const char *value_str);
 
   bool SetValueFromCString(const char *value_str, lldb::SBError &error);
@@ -123,7 +124,7 @@
   lldb::SBValue CreateChildAtOffset(const char *name, uint32_t offset,
                                     lldb::SBType type);
 
-  // Deprecated - use the expression evaluator to perform type casting
+  LLDB_DEPRECATED("Use the expression evaluator to perform type casting", "")
   lldb::SBValue Cast(lldb::SBType type);
 
   lldb::SBValue CreateValueFromExpression(const char *name,
@@ -294,7 +295,7 @@
 
   lldb::SBValue Dereference();
 
-  // Deprecated - please use GetType().IsPointerType() instead.
+  LLDB_DEPRECATED("Use GetType().IsPointerType() instead", "")
   bool TypeIsPointerType();
 
   lldb::SBType GetType();
Index: lldb/include/lldb/API/SBProcess.h
===================================================================
--- lldb/include/lldb/API/SBProcess.h
+++ lldb/include/lldb/API/SBProcess.h
@@ -48,7 +48,7 @@
 
   const char *GetPluginName();
 
-  // DEPRECATED: use GetPluginName()
+  LLDB_DEPRECATED("Use GetPluginName()", "GetPluginName()")
   const char *GetShortPluginName();
 
   void Clear();
Index: lldb/include/lldb/API/SBFileSpec.h
===================================================================
--- lldb/include/lldb/API/SBFileSpec.h
+++ lldb/include/lldb/API/SBFileSpec.h
@@ -19,8 +19,10 @@
 
   SBFileSpec(const lldb::SBFileSpec &rhs);
 
-  SBFileSpec(const char *path); // Deprecated, use SBFileSpec (const char *path,
-                                // bool resolve)
+  LLDB_DEPRECATED("Use the other constructor to determine if this the file "
+                  "spec should be resolved",
+                  "SBFileSpec(const char *, bool)")
+  SBFileSpec(const char *path);
 
   SBFileSpec(const char *path, bool resolve);
 
Index: lldb/include/lldb/API/SBDebugger.h
===================================================================
--- lldb/include/lldb/API/SBDebugger.h
+++ lldb/include/lldb/API/SBDebugger.h
@@ -115,7 +115,7 @@
 
   static void Terminate();
 
-  // Deprecated, use the one that takes a source_init_files bool.
+  LLDB_DEPRECATED("Use one of the other Create variants", "Create(bool)")
   static lldb::SBDebugger Create();
 
   static lldb::SBDebugger Create(bool source_init_files);
@@ -208,9 +208,14 @@
   lldb::SBListener GetListener();
 
 #ifndef SWIG
+  LLDB_DEPRECATED(
+      "Use HandleProcessEvent(const SBProcess &, const SBEvent &, SBFile, "
+      "SBFile) or HandleProcessEvent(const SBProcess &, const SBEvent &, "
+      "FileSP, FileSP)",
+      "HandleProcessEvent(const SBProcess &, const SBEvent &, SBFile, SBFile)")
   void HandleProcessEvent(const lldb::SBProcess &process,
                           const lldb::SBEvent &event, FILE *out,
-                          FILE *err); // DEPRECATED
+                          FILE *err);
 #endif
 
   void HandleProcessEvent(const lldb::SBProcess &process,
@@ -326,8 +331,9 @@
   void SetDestroyCallback(lldb::SBDebuggerDestroyCallback destroy_callback,
                           void *baton);
 
-  // DEPRECATED
 #ifndef SWIG
+  LLDB_DEPRECATED("Use DispatchInput(const void *, size_t)",
+                  "DispatchInput(const void *, size_t)")
   void DispatchInput(void *baton, const void *data, size_t data_len);
 #endif
 
Index: lldb/include/lldb/API/SBCommandReturnObject.h
===================================================================
--- lldb/include/lldb/API/SBCommandReturnObject.h
+++ lldb/include/lldb/API/SBCommandReturnObject.h
@@ -47,7 +47,9 @@
   const char *GetError();
 
 #ifndef SWIG
-  size_t PutOutput(FILE *fh); // DEPRECATED
+  LLDB_DEPRECATED("Use PutOutput(SBFile) or PutOutput(FileSP)",
+                  "PutOutput(SBFile)")
+  size_t PutOutput(FILE *fh);
 #endif
 
   size_t PutOutput(SBFile file);
@@ -59,7 +61,9 @@
   size_t GetErrorSize();
 
 #ifndef SWIG
-  size_t PutError(FILE *fh); // DEPRECATED
+  LLDB_DEPRECATED("Use PutError(SBFile) or PutError(FileSP)",
+                  "PutError(SBFile)")
+  size_t PutError(FILE *fh);
 #endif
 
   size_t PutError(SBFile file);
@@ -83,13 +87,25 @@
   bool GetDescription(lldb::SBStream &description);
 
 #ifndef SWIG
-  void SetImmediateOutputFile(FILE *fh); // DEPRECATED
-
-  void SetImmediateErrorFile(FILE *fh); // DEPRECATED
-
-  void SetImmediateOutputFile(FILE *fh, bool transfer_ownership); // DEPRECATED
-
-  void SetImmediateErrorFile(FILE *fh, bool transfer_ownership); // DEPRECATED
+  LLDB_DEPRECATED(
+      "Use SetImmediateOutputFile(SBFile) or SetImmediateOutputFile(FileSP)",
+      "SetImmediateOutputFile(SBFile)")
+  void SetImmediateOutputFile(FILE *fh);
+
+  LLDB_DEPRECATED(
+      "Use SetImmediateErrorFile(SBFile) or SetImmediateErrorFile(FileSP)",
+      "SetImmediateErrorFile(SBFile)")
+  void SetImmediateErrorFile(FILE *fh);
+
+  LLDB_DEPRECATED(
+      "Use SetImmediateOutputFile(SBFile) or SetImmediateOutputFile(FileSP)",
+      "SetImmediateOutputFile(SBFile)")
+  void SetImmediateOutputFile(FILE *fh, bool transfer_ownership);
+
+  LLDB_DEPRECATED(
+      "Use SetImmediateErrorFile(SBFile) or SetImmediateErrorFile(FileSP)",
+      "SetImmediateErrorFile(SBFile)")
+  void SetImmediateErrorFile(FILE *fh, bool transfer_ownership);
 #endif
 
   void SetImmediateOutputFile(SBFile file);
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PATCH] ... Alex Langford via Phabricator via lldb-commits

Reply via email to