Skip to content

Commit b4030a8

Browse files
committed
[llvm] remove LLVM_ABI_FRIEND in favor of LLVM_ABI
1 parent 7502380 commit b4030a8

File tree

18 files changed

+43
-56
lines changed

18 files changed

+43
-56
lines changed

llvm/include/llvm/ADT/APFloat.h

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ class IEEEFloat final {
572572
/// emphasizes producing different codes for different inputs in order to
573573
/// be used in canonicalization and memoization. As such, equality is
574574
/// bitwiseIsEqual, and 0 != -0.
575-
LLVM_ABI_FRIEND friend hash_code hash_value(const IEEEFloat &Arg);
575+
LLVM_ABI friend hash_code hash_value(const IEEEFloat &Arg);
576576

577577
/// Converts this value into a decimal string.
578578
///
@@ -629,13 +629,12 @@ class IEEEFloat final {
629629
/// 0 -> \c IEK_Zero
630630
/// Inf -> \c IEK_Inf
631631
///
632-
LLVM_ABI_FRIEND friend int ilogb(const IEEEFloat &Arg);
632+
LLVM_ABI friend int ilogb(const IEEEFloat &Arg);
633633

634634
/// Returns: X * 2^Exp for integral exponents.
635-
LLVM_ABI_FRIEND friend IEEEFloat scalbn(IEEEFloat X, int Exp, roundingMode);
635+
LLVM_ABI friend IEEEFloat scalbn(IEEEFloat X, int Exp, roundingMode);
636636

637-
LLVM_ABI_FRIEND friend IEEEFloat frexp(const IEEEFloat &X, int &Exp,
638-
roundingMode);
637+
LLVM_ABI friend IEEEFloat frexp(const IEEEFloat &X, int &Exp, roundingMode);
639638

640639
/// \name Special value setters.
641640
/// @{
@@ -906,11 +905,11 @@ class DoubleAPFloat final {
906905
LLVM_ABI LLVM_READONLY int getExactLog2() const;
907906
LLVM_ABI LLVM_READONLY int getExactLog2Abs() const;
908907

909-
LLVM_ABI_FRIEND friend DoubleAPFloat scalbn(const DoubleAPFloat &X, int Exp,
910-
roundingMode);
911-
LLVM_ABI_FRIEND friend DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp,
912-
roundingMode);
913-
LLVM_ABI_FRIEND friend hash_code hash_value(const DoubleAPFloat &Arg);
908+
LLVM_ABI friend DoubleAPFloat scalbn(const DoubleAPFloat &X, int Exp,
909+
roundingMode);
910+
LLVM_ABI friend DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp,
911+
roundingMode);
912+
LLVM_ABI friend hash_code hash_value(const DoubleAPFloat &Arg);
914913
};
915914

916915
LLVM_ABI hash_code hash_value(const DoubleAPFloat &Arg);
@@ -1518,7 +1517,7 @@ class APFloat : public APFloatBase {
15181517
APFLOAT_DISPATCH_ON_SEMANTICS(getExactLog2());
15191518
}
15201519

1521-
LLVM_ABI_FRIEND friend hash_code hash_value(const APFloat &Arg);
1520+
LLVM_ABI friend hash_code hash_value(const APFloat &Arg);
15221521
friend int ilogb(const APFloat &Arg) { return ilogb(Arg.getIEEE()); }
15231522
friend APFloat scalbn(APFloat X, int Exp, roundingMode RM);
15241523
friend APFloat frexp(const APFloat &X, int &Exp, roundingMode RM);

llvm/include/llvm/ADT/SlowDynamicAPInt.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,17 @@ class SlowDynamicAPInt {
6262
LLVM_ABI SlowDynamicAPInt &operator++();
6363
LLVM_ABI SlowDynamicAPInt &operator--();
6464

65-
LLVM_ABI_FRIEND friend SlowDynamicAPInt abs(const SlowDynamicAPInt &X);
66-
LLVM_ABI_FRIEND friend SlowDynamicAPInt ceilDiv(const SlowDynamicAPInt &LHS,
67-
const SlowDynamicAPInt &RHS);
68-
LLVM_ABI_FRIEND friend SlowDynamicAPInt floorDiv(const SlowDynamicAPInt &LHS,
69-
const SlowDynamicAPInt &RHS);
65+
LLVM_ABI friend SlowDynamicAPInt abs(const SlowDynamicAPInt &X);
66+
LLVM_ABI friend SlowDynamicAPInt ceilDiv(const SlowDynamicAPInt &LHS,
67+
const SlowDynamicAPInt &RHS);
68+
LLVM_ABI friend SlowDynamicAPInt floorDiv(const SlowDynamicAPInt &LHS,
69+
const SlowDynamicAPInt &RHS);
7070
/// The operands must be non-negative for gcd.
71-
LLVM_ABI_FRIEND friend SlowDynamicAPInt gcd(const SlowDynamicAPInt &A,
72-
const SlowDynamicAPInt &B);
71+
LLVM_ABI friend SlowDynamicAPInt gcd(const SlowDynamicAPInt &A,
72+
const SlowDynamicAPInt &B);
7373

7474
/// Overload to compute a hash_code for a SlowDynamicAPInt value.
75-
LLVM_ABI_FRIEND friend hash_code
76-
hash_value(const SlowDynamicAPInt &X); // NOLINT
75+
LLVM_ABI friend hash_code hash_value(const SlowDynamicAPInt &X); // NOLINT
7776

7877
// Make DynamicAPInt a friend so it can access Val directly.
7978
friend DynamicAPInt;

llvm/include/llvm/Bitcode/BitcodeReader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ struct ParserCallbacks {
120120
IdentificationBit(IdentificationBit), ModuleBit(ModuleBit) {}
121121

122122
// Calls the ctor.
123-
LLVM_ABI_FRIEND friend Expected<BitcodeFileContents>
123+
LLVM_ABI friend Expected<BitcodeFileContents>
124124
getBitcodeFileContents(MemoryBufferRef Buffer);
125125

126126
Expected<std::unique_ptr<Module>>

llvm/include/llvm/CodeGen/MachineOperand.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ class MachineOperand {
764764
/// isIdenticalTo uses for comparison. It is thus suited for use in hash
765765
/// tables which use that function for equality comparisons only. This must
766766
/// stay exactly in sync with isIdenticalTo above.
767-
LLVM_ABI_FRIEND friend hash_code hash_value(const MachineOperand &MO);
767+
LLVM_ABI friend hash_code hash_value(const MachineOperand &MO);
768768

769769
/// ChangeToImmediate - Replace this operand with a new immediate operand of
770770
/// the specified value. If an operand is known to be an immediate already,

llvm/include/llvm/CodeGen/PseudoSourceValue.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ class LLVM_ABI PseudoSourceValue {
4646
private:
4747
unsigned Kind;
4848
unsigned AddressSpace;
49-
LLVM_ABI_FRIEND friend raw_ostream &
50-
llvm::operator<<(raw_ostream &OS, const PseudoSourceValue *PSV);
49+
LLVM_ABI friend raw_ostream &llvm::operator<<(raw_ostream &OS,
50+
const PseudoSourceValue *PSV);
5151

5252
friend class MachineMemOperand; // For printCustom().
5353
friend class MIRFormatter; // For printCustom().

llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ class ExecutorProcessControl;
4242
class LLVM_ABI LLJIT {
4343
template <typename, typename, typename> friend class LLJITBuilderSetters;
4444

45-
LLVM_ABI_FRIEND friend Expected<JITDylibSP>
46-
setUpGenericLLVMIRPlatform(LLJIT &J);
45+
LLVM_ABI friend Expected<JITDylibSP> setUpGenericLLVMIRPlatform(LLJIT &J);
4746

4847
public:
4948
/// Initializer support for LLJIT.

llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class SymbolStringPool {
3636
friend class SymbolStringPoolEntryUnsafe;
3737

3838
// Implemented in DebugUtils.h.
39-
LLVM_ABI_FRIEND friend raw_ostream &operator<<(raw_ostream &OS,
40-
const SymbolStringPool &SSP);
39+
LLVM_ABI friend raw_ostream &operator<<(raw_ostream &OS,
40+
const SymbolStringPool &SSP);
4141

4242
public:
4343
/// Destroy a SymbolStringPool.
@@ -94,8 +94,8 @@ class SymbolStringPtrBase {
9494
return LHS.S < RHS.S;
9595
}
9696

97-
LLVM_ABI_FRIEND friend raw_ostream &
98-
operator<<(raw_ostream &OS, const SymbolStringPtrBase &Sym);
97+
LLVM_ABI friend raw_ostream &operator<<(raw_ostream &OS,
98+
const SymbolStringPtrBase &Sym);
9999

100100
#ifndef NDEBUG
101101
// Returns true if the pool entry's ref count is above zero (or if the entry

llvm/include/llvm/ExecutionEngine/RuntimeDyld.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ class RuntimeDyld {
287287
LLVM_ABI void finalizeWithMemoryManagerLocking();
288288

289289
private:
290-
LLVM_ABI_FRIEND friend void jitLinkForORC(
290+
LLVM_ABI friend void jitLinkForORC(
291291
object::OwningBinary<object::ObjectFile> O,
292292
RuntimeDyld::MemoryManager &MemMgr, JITSymbolResolver &Resolver,
293293
bool ProcessAllSections,

llvm/include/llvm/IR/Function.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -783,9 +783,8 @@ class LLVM_ABI Function : public GlobalObject, public ilist_node<Function> {
783783

784784
private:
785785
// These need access to the underlying BB list.
786-
LLVM_ABI_FRIEND friend void BasicBlock::removeFromParent();
787-
LLVM_ABI_FRIEND friend iplist<BasicBlock>::iterator
788-
BasicBlock::eraseFromParent();
786+
LLVM_ABI friend void BasicBlock::removeFromParent();
787+
LLVM_ABI friend iplist<BasicBlock>::iterator BasicBlock::eraseFromParent();
789788
template <class BB_t, class BB_i_t, class BI_t, class II_t>
790789
friend class InstIterator;
791790
friend class llvm::SymbolTableListTraits<llvm::BasicBlock>;

llvm/include/llvm/ProfileData/SampleProfWriter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class LLVM_ABI SampleProfileWriterText : public SampleProfileWriter {
193193
/// cannot be skipped.
194194
bool MarkFlatProfiles = false;
195195

196-
LLVM_ABI_FRIEND friend ErrorOr<std::unique_ptr<SampleProfileWriter>>
196+
LLVM_ABI friend ErrorOr<std::unique_ptr<SampleProfileWriter>>
197197
SampleProfileWriter::create(std::unique_ptr<raw_ostream> &OS,
198198
SampleProfileFormat Format);
199199
};
@@ -225,7 +225,7 @@ class LLVM_ABI SampleProfileWriterBinary : public SampleProfileWriter {
225225
void addNames(const FunctionSamples &S);
226226

227227
private:
228-
LLVM_ABI_FRIEND friend ErrorOr<std::unique_ptr<SampleProfileWriter>>
228+
LLVM_ABI friend ErrorOr<std::unique_ptr<SampleProfileWriter>>
229229
SampleProfileWriter::create(std::unique_ptr<raw_ostream> &OS,
230230
SampleProfileFormat Format);
231231
};

llvm/include/llvm/Support/Compiler.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,6 @@
171171
/// for both functions and classes. On windows its turned in to dllimport for
172172
/// library consumers, for other platforms its a default visibility attribute.
173173
///
174-
/// LLVM_ABI_FRIEND is for annotating friend function declarations when the
175-
/// target function's original declaration is annotated with LLVM_ABI. This
176-
/// macro matches the LLVM_ABI macro on Windows, on other platforms it does
177-
/// nothing.
178-
///
179174
/// LLVM_C_ABI is used to annotated functions and data that need to be exported
180175
/// for the libllvm-c API. This used both for the llvm-c headers and for the
181176
/// functions declared in the different Target's c++ source files that don't
@@ -195,26 +190,22 @@
195190
#define LLVM_TEMPLATE_ABI __declspec(dllimport)
196191
#define LLVM_EXPORT_TEMPLATE
197192
#endif
198-
#define LLVM_ABI_FRIEND LLVM_ABI
199193
#define LLVM_ABI_EXPORT __declspec(dllexport)
200194
#elif defined(__ELF__) || defined(__MINGW32__) || defined(_AIX) || \
201195
defined(__MVS__) || defined(__CYGWIN__)
202196
#define LLVM_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
203-
#define LLVM_ABI_FRIEND
204197
#define LLVM_TEMPLATE_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
205198
#define LLVM_EXPORT_TEMPLATE
206199
#define LLVM_ABI_EXPORT LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
207200
#elif defined(__MACH__) || defined(__WASM__) || defined(__EMSCRIPTEN__)
208201
#define LLVM_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
209-
#define LLVM_ABI_FRIEND
210202
#define LLVM_TEMPLATE_ABI
211203
#define LLVM_EXPORT_TEMPLATE
212204
#define LLVM_ABI_EXPORT LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
213205
#endif
214206
#endif
215207
#if !defined(LLVM_ABI)
216208
#define LLVM_ABI
217-
#define LLVM_ABI_FRIEND
218209
#define LLVM_TEMPLATE_ABI
219210
#define LLVM_EXPORT_TEMPLATE
220211
#define LLVM_ABI_EXPORT

llvm/include/llvm/Support/Error.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ class ExpectedAsOutParameter {
11911191
/// (or Expected) and you want to call code that still returns
11921192
/// std::error_codes.
11931193
class LLVM_ABI ECError : public ErrorInfo<ECError> {
1194-
LLVM_ABI_FRIEND friend Error errorCodeToError(std::error_code);
1194+
LLVM_ABI friend Error errorCodeToError(std::error_code);
11951195

11961196
void anchor() override;
11971197

llvm/include/llvm/Support/FileSystem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ class basic_file_status {
220220

221221
/// Represents the result of a call to sys::fs::status().
222222
class file_status : public basic_file_status {
223-
LLVM_ABI_FRIEND friend bool equivalent(file_status A, file_status B);
223+
LLVM_ABI friend bool equivalent(file_status A, file_status B);
224224

225225
#if defined(LLVM_ON_UNIX)
226226
dev_t fs_st_dev = 0;

llvm/include/llvm/Support/JSON.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ class Value {
531531
llvm::StringRef, std::string, json::Array,
532532
json::Object>
533533
Union;
534-
LLVM_ABI_FRIEND friend bool operator==(const Value &, const Value &);
534+
LLVM_ABI friend bool operator==(const Value &, const Value &);
535535
};
536536

537537
LLVM_ABI bool operator==(const Value &, const Value &);
@@ -713,7 +713,7 @@ class Path::Root {
713713
llvm::StringLiteral ErrorMessage;
714714
std::vector<Path::Segment> ErrorPath; // Only valid in error state. Reversed.
715715

716-
LLVM_ABI_FRIEND friend void Path::report(llvm::StringLiteral Message);
716+
LLVM_ABI friend void Path::report(llvm::StringLiteral Message);
717717

718718
public:
719719
Root(llvm::StringRef Name = "") : Name(Name), ErrorMessage("") {}

llvm/include/llvm/Support/Path.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ class const_iterator
8080
Style S = Style::native; ///< The path style to use.
8181

8282
// An end iterator has Position = Path.size() + 1.
83-
LLVM_ABI_FRIEND friend const_iterator begin(StringRef path, Style style);
84-
LLVM_ABI_FRIEND friend const_iterator end(StringRef path);
83+
LLVM_ABI friend const_iterator begin(StringRef path, Style style);
84+
LLVM_ABI friend const_iterator end(StringRef path);
8585

8686
public:
8787
reference operator*() const { return Component; }
@@ -105,8 +105,8 @@ class reverse_iterator
105105
size_t Position = 0; ///< The iterators current position within Path.
106106
Style S = Style::native; ///< The path style to use.
107107

108-
LLVM_ABI_FRIEND friend reverse_iterator rbegin(StringRef path, Style style);
109-
LLVM_ABI_FRIEND friend reverse_iterator rend(StringRef path);
108+
LLVM_ABI friend reverse_iterator rbegin(StringRef path, Style style);
109+
LLVM_ABI friend reverse_iterator rend(StringRef path);
110110

111111
public:
112112
reference operator*() const { return Component; }

llvm/include/llvm/Support/PrettyStackTrace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace llvm {
5151
/// constructed and destructed, they will add their symbolic frames to a
5252
/// virtual stack trace. This gets dumped out if the program crashes.
5353
class LLVM_ABI PrettyStackTraceEntry {
54-
LLVM_ABI_FRIEND friend PrettyStackTraceEntry *
54+
LLVM_ABI friend PrettyStackTraceEntry *
5555
ReverseStackTrace(PrettyStackTraceEntry *);
5656

5757
PrettyStackTraceEntry *NextEntry;

llvm/include/llvm/XRay/InstrumentationMap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class InstrumentationMap {
8585
FunctionAddressMap FunctionAddresses;
8686
FunctionAddressReverseMap FunctionIds;
8787

88-
LLVM_ABI_FRIEND friend Expected<InstrumentationMap>
88+
LLVM_ABI friend Expected<InstrumentationMap>
8989
loadInstrumentationMap(StringRef);
9090

9191
public:

llvm/include/llvm/XRay/Trace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Trace {
5151

5252
typedef std::vector<XRayRecord>::const_iterator citerator;
5353

54-
LLVM_ABI_FRIEND friend Expected<Trace> loadTrace(const DataExtractor &, bool);
54+
LLVM_ABI friend Expected<Trace> loadTrace(const DataExtractor &, bool);
5555

5656
public:
5757
using size_type = RecordVector::size_type;

0 commit comments

Comments
 (0)