[llvm] [llvm] add LLVM_FRIEND_ABI macro for friend function decls (PR #136595)

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 21 16:10:34 PDT 2025


https://github.com/compnerd approved this pull request.

I think that this is fine to make progress, but we should revisit the macros. Right now, I see the following:

- LLVM_ABI
- LLVM_FRIEND_ABI
- LLVM_TEMPLATE_ABI
- LLVM_EXPORT_TEMPLATE
- LLVM_ABI_EXPORT

The problem is that this is pretty complex for someone coming to this world. I think that we should try to minimise the number of macros. `*_ABI` is reasonable. `*_FRIEND_ABI` I suppose is not something that we can get away it. BTW, would it be possible to spell that as:

```c++
friend LLVM_ABI_FRIEND void function();
```

The `TEMPLATE_ABI` and `LLVM_EXPORT_TEMPLATE` would be nice to merge somehow if possible.

I don't understand the reason for `LLVM_ABI_EXPORT`, we should be able to use `LLVM_ABI` for that no?

https://github.com/llvm/llvm-project/pull/136595


More information about the llvm-commits mailing list