JDevlieghere updated this revision to Diff 511516.
JDevlieghere added a comment.

Add a comment explaining why we're undefing the macro.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147736/new/

https://reviews.llvm.org/D147736

Files:
  lldb/include/lldb/API/SBDefines.h
  lldb/include/lldb/API/SBTarget.h
  lldb/include/lldb/lldb-defines.h


Index: lldb/include/lldb/lldb-defines.h
===================================================================
--- lldb/include/lldb/lldb-defines.h
+++ lldb/include/lldb/lldb-defines.h
@@ -125,4 +125,10 @@
 
 #define UNUSED_IF_ASSERT_DISABLED(x) ((void)(x))
 
+#if defined(__clang__)
+#define LLDB_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
+#else
+#define LLDB_DEPRECATED(MSG, FIX) [[deprecated(MSG)]]
+#endif
+
 #endif // LLDB_LLDB_DEFINES_H
Index: lldb/include/lldb/API/SBTarget.h
===================================================================
--- lldb/include/lldb/API/SBTarget.h
+++ lldb/include/lldb/API/SBTarget.h
@@ -390,7 +390,8 @@
   /// \return
   ///     An error to indicate success, fail, and any reason for
   ///     failure.
-  [[deprecated("Use SetModuleLoadAddress(lldb::SBModule, uint64_t)")]]
+  LLDB_DEPRECATED("Use SetModuleLoadAddress(lldb::SBModule, uint64_t)",
+                  "SetModuleLoadAddress(lldb::SBModule, uint64_t)")
   lldb::SBError SetModuleLoadAddress(lldb::SBModule module,
                                      int64_t sections_offset);
 #endif
Index: lldb/include/lldb/API/SBDefines.h
===================================================================
--- lldb/include/lldb/API/SBDefines.h
+++ lldb/include/lldb/API/SBDefines.h
@@ -27,6 +27,14 @@
 #endif
 #endif
 
+// Don't add the deprecated attribute when generating the bindings or when
+// building for anything older than C++14 which is the first version that
+// supports the attribute.
+#if defined(SWIG) or _cplusplus < 201300
+#undef LLDB_DEPRECATED
+#define LLDB_DEPRECATED(MSG, FIX)
+#endif
+
 // Forward Declarations
 namespace lldb {
 


Index: lldb/include/lldb/lldb-defines.h
===================================================================
--- lldb/include/lldb/lldb-defines.h
+++ lldb/include/lldb/lldb-defines.h
@@ -125,4 +125,10 @@
 
 #define UNUSED_IF_ASSERT_DISABLED(x) ((void)(x))
 
+#if defined(__clang__)
+#define LLDB_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
+#else
+#define LLDB_DEPRECATED(MSG, FIX) [[deprecated(MSG)]]
+#endif
+
 #endif // LLDB_LLDB_DEFINES_H
Index: lldb/include/lldb/API/SBTarget.h
===================================================================
--- lldb/include/lldb/API/SBTarget.h
+++ lldb/include/lldb/API/SBTarget.h
@@ -390,7 +390,8 @@
   /// \return
   ///     An error to indicate success, fail, and any reason for
   ///     failure.
-  [[deprecated("Use SetModuleLoadAddress(lldb::SBModule, uint64_t)")]]
+  LLDB_DEPRECATED("Use SetModuleLoadAddress(lldb::SBModule, uint64_t)",
+                  "SetModuleLoadAddress(lldb::SBModule, uint64_t)")
   lldb::SBError SetModuleLoadAddress(lldb::SBModule module,
                                      int64_t sections_offset);
 #endif
Index: lldb/include/lldb/API/SBDefines.h
===================================================================
--- lldb/include/lldb/API/SBDefines.h
+++ lldb/include/lldb/API/SBDefines.h
@@ -27,6 +27,14 @@
 #endif
 #endif
 
+// Don't add the deprecated attribute when generating the bindings or when
+// building for anything older than C++14 which is the first version that
+// supports the attribute.
+#if defined(SWIG) or _cplusplus < 201300
+#undef LLDB_DEPRECATED
+#define LLDB_DEPRECATED(MSG, FIX)
+#endif
+
 // Forward Declarations
 namespace lldb {
 
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to