[all-commits] [llvm/llvm-project] ace516: Change the LLVM_ATTRIBUTE_DEPRECATED macro to use ...

Christian Sigg via All-commits all-commits at lists.llvm.org
Tue Jan 12 03:45:22 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ace516fb33d1f3de85f046e96efc1048b4ee8c08
      https://github.com/llvm/llvm-project/commit/ace516fb33d1f3de85f046e96efc1048b4ee8c08
  Author: Christian Sigg <csigg at google.com>
  Date:   2021-01-12 (Tue, 12 Jan 2021)

  Changed paths:
    M llvm/include/llvm/Support/Compiler.h

  Log Message:
  -----------
  Change the LLVM_ATTRIBUTE_DEPRECATED macro to use C++14 attribute.

C++14 attributes are superior because they can be applied to functions with inline definition and the syntax is cleaner.

I intend to convert all uses and then remove the macro.

One issue that might hold back switching uses to C++14  attributes is that
clang-format does not put long attributes on separate lines and formatted code will look like:

```
template <typename T>
[[deprecated("blah blah")]] void
    foooooooooooooooooooooooooooo() {
  ...
}
```

Putting long attributes on a separate line would be prettier.
See https://stackoverflow.com/questions/45740466/clang-format-setting-to-control-c-attributes

AttributeMacros probably won't help because it can't match the custom message.
https://clang.llvm.org/docs/ClangFormatStyleOptions.html

Reviewed By: rriddle, MaskRay

Differential Revision: https://reviews.llvm.org/D94219




More information about the All-commits mailing list