Skip to content

Commit c046bca

Browse files
committed
PR feedback: rename LLVM_FRIEND_ABI -> LLVM_ABI_FRIEND
1 parent ec48663 commit c046bca

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

llvm/docs/InterfaceExportAnnotations.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ method in a C++ class, it may be annotated for export.
223223
Friend Functions
224224
~~~~~~~~~~~~~~~~
225225
Friend functions declared in a class, struct or union should be annotated with
226-
``LLVM_FRIEND_ABI`` if the corresponding function declaration is annotated with
226+
``LLVM_ABI_FRIEND`` if the corresponding function declaration is annotated with
227227
``LLVM_ABI``. This requirement applies even when the class containing the friend
228228
declaration is annotated with ``LLVM_ABI``.
229229

@@ -237,13 +237,13 @@ declaration is annotated with ``LLVM_ABI``.
237237
class ExampleClass {
238238
// Friend declaration of a function must be annotated the same as the actual
239239
// function declaration.
240-
LLVM_FRIEND_ABI friend int friend_function(ExampleClass &obj);
240+
LLVM_ABI_FRIEND friend int friend_function(ExampleClass &obj);
241241
};
242242
243243
.. note::
244244

245245
Annotating the friend declaration avoids an “inconsistent dll linkage”
246-
compiler error when building a DLL for Windows. The ``LLVM_FRIEND_ABI``
246+
compiler error when building a DLL for Windows. The ``LLVM_ABI_FRIEND``
247247
annotation is a no-op when building ELF or Mach-O shared libraries.
248248

249249
Virtual Table and Type Info

llvm/include/llvm/Support/Compiler.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
/// for both functions and classes. On windows its turned in to dllimport for
168168
/// library consumers, for other platforms its a default visibility attribute.
169169
///
170-
/// LLVM_FRIEND_ABI is for annotating friend function declarations when the
170+
/// LLVM_ABI_FRIEND is for annotating friend function declarations when the
171171
/// target function's original declaration is annotated with LLVM_ABI. This
172172
/// macro matches the LLVM_ABI macro on Windows, on other platforms it does
173173
/// nothing.
@@ -188,7 +188,7 @@
188188
// missing symbol linker errors on windows.
189189
#if defined(LLVM_BUILD_STATIC)
190190
#define LLVM_ABI
191-
#define LLVM_FRIEND_ABI
191+
#define LLVM_ABI_FRIEND
192192
#define LLVM_TEMPLATE_ABI
193193
#define LLVM_EXPORT_TEMPLATE
194194
#define LLVM_ABI_EXPORT
@@ -202,25 +202,25 @@
202202
#define LLVM_TEMPLATE_ABI __declspec(dllimport)
203203
#define LLVM_EXPORT_TEMPLATE
204204
#endif
205-
#define LLVM_FRIEND_ABI LLVM_ABI
205+
#define LLVM_ABI_FRIEND LLVM_ABI
206206
#define LLVM_ABI_EXPORT __declspec(dllexport)
207207
#elif defined(__ELF__) || defined(__MINGW32__) || defined(_AIX) || \
208208
defined(__MVS__)
209209
#define LLVM_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
210-
#define LLVM_FRIEND_ABI
210+
#define LLVM_ABI_FRIEND
211211
#define LLVM_TEMPLATE_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
212212
#define LLVM_EXPORT_TEMPLATE
213213
#define LLVM_ABI_EXPORT LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
214214
#elif defined(__MACH__) || defined(__WASM__) || defined(__EMSCRIPTEN__)
215215
#define LLVM_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
216-
#define LLVM_FRIEND_ABI
216+
#define LLVM_ABI_FRIEND
217217
#define LLVM_TEMPLATE_ABI
218218
#define LLVM_EXPORT_TEMPLATE
219219
#define LLVM_ABI_EXPORT LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
220220
#endif
221221
#else
222222
#define LLVM_ABI
223-
#define LLVM_FRIEND_ABI
223+
#define LLVM_ABI_FRIEND
224224
#define LLVM_TEMPLATE_ABI
225225
#define LLVM_EXPORT_TEMPLATE
226226
#define LLVM_ABI_EXPORT

0 commit comments

Comments
 (0)