This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Add an LLDB_DEPRECATED macro similar to LLVM_DEPRECATED
ClosedPublic

Authored by JDevlieghere on Apr 6 2023, 12:51 PM.

Details

Summary

Add an LLDB_DEPRECATED macro similar to LLVM_DEPRECATED. We cannot
directly reuse the LLVM one, because it's defined in Compiler.h which is
not something we can include in the SB API.

For the SB API, the macro is undef'd if:

  1. We're building the SWIG bindings. We might still want to expose deprecated methods to our scripting users.
  2. We're targeting anything older than C++14 as the [[deprecated]] attribute was added for C++14 and the SB API can be used by projects compiling against an older language version.

Diff Detail

Event Timeline

JDevlieghere created this revision.Apr 6 2023, 12:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2023, 12:51 PM
JDevlieghere requested review of this revision.Apr 6 2023, 12:51 PM

FWIW I added the current [[deprecated]] attribute in ea95da180900.

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

bulbazord accepted this revision.Apr 6 2023, 2:24 PM
bulbazord added inline comments.
lldb/include/lldb/API/SBDefines.h
33

nit: Use __cplusplus < 201402L to be more specific.

I got that value from https://en.cppreference.com/w/cpp/preprocessor/replace

This revision is now accepted and ready to land.Apr 6 2023, 2:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2023, 2:56 PM
kastiglione added inline comments.
lldb/include/lldb/API/SBDefines.h
33

@JDevlieghere should this be || instead of or?