[PATCH] D114936: [llvm-c] Add header deprecations

Aaron Puchert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 4 15:53:09 PDT 2022


aaronpuchert added a comment.
Herald added a project: All.

Nice to see that we have this now! (There was an earlier attempt in D18964 <https://reviews.llvm.org/D18964> that somehow didn't make it.)



================
Comment at: llvm/include/llvm-c/Deprecated.h:26-29
+  decl __attribute__((deprecated(message)))
+#elif defined(__GNUC__)
+# define LLVM_ATTRIBUTE_C_DEPRECATED(decl, message) \
+  decl __attribute__((deprecated))
----------------
Can't we always place the attribute in front of the declaration, and then remove the need to pass `decl` into the macro? Then we could write
```
LLVM_ATTRIBUTE_C_DEPRECATED("Use LLVMBar instead")
void LLVMFoo(void);
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114936



More information about the llvm-commits mailing list