Skip to content

Commit 2f600a5

Browse files
committed
[llvm] IDS auto codemod for IR library
1 parent def17cd commit 2f600a5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+2380
-2306
lines changed

llvm/include/llvm/IR/AbstractCallSite.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#ifndef LLVM_IR_ABSTRACTCALLSITE_H
1515
#define LLVM_IR_ABSTRACTCALLSITE_H
1616

17+
#include "llvm/Support/Compiler.h"
1718
#include "llvm/IR/Constants.h"
1819
#include "llvm/IR/Function.h"
1920
#include "llvm/IR/InstrTypes.h"
@@ -95,14 +96,14 @@ class AbstractCallSite {
9596
/// If the use is not a callee use of a call or invoke instruction, the
9697
/// callback metadata is used to determine the argument <-> parameter mapping
9798
/// as well as the callee of the abstract call site.
98-
AbstractCallSite(const Use *U);
99+
LLVM_ABI AbstractCallSite(const Use *U);
99100

100101
/// Add operand uses of \p CB that represent callback uses into
101102
/// \p CallbackUses.
102103
///
103104
/// All uses added to \p CallbackUses can be used to create abstract call
104105
/// sites for which AbstractCallSite::isCallbackCall() will return true.
105-
static void getCallbackUses(const CallBase &CB,
106+
LLVM_ABI static void getCallbackUses(const CallBase &CB,
106107
SmallVectorImpl<const Use *> &CallbackUses);
107108

108109
/// Conversion operator to conveniently check for a valid/initialized ACS.

llvm/include/llvm/IR/Analysis.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#ifndef LLVM_IR_ANALYSIS_H
1313
#define LLVM_IR_ANALYSIS_H
1414

15+
#include "llvm/Support/Compiler.h"
1516
#include "llvm/ADT/SmallPtrSet.h"
1617

1718
namespace llvm {
@@ -74,7 +75,7 @@ class CFGAnalyses {
7475
static AnalysisSetKey *ID() { return &SetKey; }
7576

7677
private:
77-
static AnalysisSetKey SetKey;
78+
LLVM_ABI static AnalysisSetKey SetKey;
7879
};
7980

8081
/// A set of analyses that are preserved following a run of a transformation
@@ -310,7 +311,7 @@ class PreservedAnalyses {
310311

311312
private:
312313
/// A special key used to indicate all analyses.
313-
static AnalysisSetKey AllAnalysesKey;
314+
LLVM_ABI static AnalysisSetKey AllAnalysesKey;
314315

315316
/// The IDs of analyses and analysis sets that are preserved.
316317
SmallPtrSet<void *, 2> PreservedIDs;

llvm/include/llvm/IR/Argument.h

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#ifndef LLVM_IR_ARGUMENT_H
1414
#define LLVM_IR_ARGUMENT_H
1515

16+
#include "llvm/Support/Compiler.h"
1617
#include "llvm/ADT/Twine.h"
1718
#include "llvm/IR/Attributes.h"
1819
#include "llvm/IR/Value.h"
@@ -37,7 +38,7 @@ class Argument final : public Value {
3738

3839
public:
3940
/// Argument constructor.
40-
explicit Argument(Type *Ty, const Twine &Name = "", Function *F = nullptr,
41+
LLVM_ABI explicit Argument(Type *Ty, const Twine &Name = "", Function *F = nullptr,
4142
unsigned ArgNo = 0);
4243

4344
inline const Function *getParent() const { return Parent; }
@@ -56,133 +57,133 @@ class Argument final : public Value {
5657
/// addrspace(0).
5758
/// If AllowUndefOrPoison is true, respect the semantics of nonnull attribute
5859
/// and return true even if the argument can be undef or poison.
59-
bool hasNonNullAttr(bool AllowUndefOrPoison = true) const;
60+
LLVM_ABI bool hasNonNullAttr(bool AllowUndefOrPoison = true) const;
6061

6162
/// If this argument has the dereferenceable attribute, return the number of
6263
/// bytes known to be dereferenceable. Otherwise, zero is returned.
63-
uint64_t getDereferenceableBytes() const;
64+
LLVM_ABI uint64_t getDereferenceableBytes() const;
6465

6566
/// If this argument has the dereferenceable_or_null attribute, return the
6667
/// number of bytes known to be dereferenceable. Otherwise, zero is returned.
67-
uint64_t getDereferenceableOrNullBytes() const;
68+
LLVM_ABI uint64_t getDereferenceableOrNullBytes() const;
6869

6970
/// If this argument has nofpclass attribute, return the mask representing
7071
/// disallowed floating-point values. Otherwise, fcNone is returned.
71-
FPClassTest getNoFPClass() const;
72+
LLVM_ABI FPClassTest getNoFPClass() const;
7273

7374
/// If this argument has a range attribute, return the value range of the
7475
/// argument. Otherwise, std::nullopt is returned.
75-
std::optional<ConstantRange> getRange() const;
76+
LLVM_ABI std::optional<ConstantRange> getRange() const;
7677

7778
/// Return true if this argument has the byval attribute.
78-
bool hasByValAttr() const;
79+
LLVM_ABI bool hasByValAttr() const;
7980

8081
/// Return true if this argument has the byref attribute.
81-
bool hasByRefAttr() const;
82+
LLVM_ABI bool hasByRefAttr() const;
8283

8384
/// Return true if this argument has the swiftself attribute.
84-
bool hasSwiftSelfAttr() const;
85+
LLVM_ABI bool hasSwiftSelfAttr() const;
8586

8687
/// Return true if this argument has the swifterror attribute.
87-
bool hasSwiftErrorAttr() const;
88+
LLVM_ABI bool hasSwiftErrorAttr() const;
8889

8990
/// Return true if this argument has the byval, inalloca, or preallocated
9091
/// attribute. These attributes represent arguments being passed by value,
9192
/// with an associated copy between the caller and callee
92-
bool hasPassPointeeByValueCopyAttr() const;
93+
LLVM_ABI bool hasPassPointeeByValueCopyAttr() const;
9394

9495
/// If this argument satisfies has hasPassPointeeByValueAttr, return the
9596
/// in-memory ABI size copied to the stack for the call. Otherwise, return 0.
96-
uint64_t getPassPointeeByValueCopySize(const DataLayout &DL) const;
97+
LLVM_ABI uint64_t getPassPointeeByValueCopySize(const DataLayout &DL) const;
9798

9899
/// Return true if this argument has the byval, sret, inalloca, preallocated,
99100
/// or byref attribute. These attributes represent arguments being passed by
100101
/// value (which may or may not involve a stack copy)
101-
bool hasPointeeInMemoryValueAttr() const;
102+
LLVM_ABI bool hasPointeeInMemoryValueAttr() const;
102103

103104
/// If hasPointeeInMemoryValueAttr returns true, the in-memory ABI type is
104105
/// returned. Otherwise, nullptr.
105-
Type *getPointeeInMemoryValueType() const;
106+
LLVM_ABI Type *getPointeeInMemoryValueType() const;
106107

107108
/// If this is a byval or inalloca argument, return its alignment.
108109
/// FIXME: Remove this function once transition to Align is over.
109110
/// Use getParamAlign() instead.
110-
LLVM_DEPRECATED("Use getParamAlign() instead", "getParamAlign")
111+
LLVM_ABI LLVM_DEPRECATED("Use getParamAlign() instead", "getParamAlign")
111112
uint64_t getParamAlignment() const;
112113

113114
/// If this is a byval or inalloca argument, return its alignment.
114-
MaybeAlign getParamAlign() const;
115+
LLVM_ABI MaybeAlign getParamAlign() const;
115116

116-
MaybeAlign getParamStackAlign() const;
117+
LLVM_ABI MaybeAlign getParamStackAlign() const;
117118

118119
/// If this is a byval argument, return its type.
119-
Type *getParamByValType() const;
120+
LLVM_ABI Type *getParamByValType() const;
120121

121122
/// If this is an sret argument, return its type.
122-
Type *getParamStructRetType() const;
123+
LLVM_ABI Type *getParamStructRetType() const;
123124

124125
/// If this is a byref argument, return its type.
125-
Type *getParamByRefType() const;
126+
LLVM_ABI Type *getParamByRefType() const;
126127

127128
/// If this is an inalloca argument, return its type.
128-
Type *getParamInAllocaType() const;
129+
LLVM_ABI Type *getParamInAllocaType() const;
129130

130131
/// Return true if this argument has the nest attribute.
131-
bool hasNestAttr() const;
132+
LLVM_ABI bool hasNestAttr() const;
132133

133134
/// Return true if this argument has the noalias attribute.
134-
bool hasNoAliasAttr() const;
135+
LLVM_ABI bool hasNoAliasAttr() const;
135136

136137
/// Return true if this argument has the nocapture attribute.
137-
bool hasNoCaptureAttr() const;
138+
LLVM_ABI bool hasNoCaptureAttr() const;
138139

139140
/// Return true if this argument has the nofree attribute.
140-
bool hasNoFreeAttr() const;
141+
LLVM_ABI bool hasNoFreeAttr() const;
141142

142143
/// Return true if this argument has the sret attribute.
143-
bool hasStructRetAttr() const;
144+
LLVM_ABI bool hasStructRetAttr() const;
144145

145146
/// Return true if this argument has the inreg attribute.
146-
bool hasInRegAttr() const;
147+
LLVM_ABI bool hasInRegAttr() const;
147148

148149
/// Return true if this argument has the returned attribute.
149-
bool hasReturnedAttr() const;
150+
LLVM_ABI bool hasReturnedAttr() const;
150151

151152
/// Return true if this argument has the readonly or readnone attribute.
152-
bool onlyReadsMemory() const;
153+
LLVM_ABI bool onlyReadsMemory() const;
153154

154155
/// Return true if this argument has the inalloca attribute.
155-
bool hasInAllocaAttr() const;
156+
LLVM_ABI bool hasInAllocaAttr() const;
156157

157158
/// Return true if this argument has the preallocated attribute.
158-
bool hasPreallocatedAttr() const;
159+
LLVM_ABI bool hasPreallocatedAttr() const;
159160

160161
/// Return true if this argument has the zext attribute.
161-
bool hasZExtAttr() const;
162+
LLVM_ABI bool hasZExtAttr() const;
162163

163164
/// Return true if this argument has the sext attribute.
164-
bool hasSExtAttr() const;
165+
LLVM_ABI bool hasSExtAttr() const;
165166

166167
/// Add attributes to an argument.
167-
void addAttrs(AttrBuilder &B);
168+
LLVM_ABI void addAttrs(AttrBuilder &B);
168169

169-
void addAttr(Attribute::AttrKind Kind);
170+
LLVM_ABI void addAttr(Attribute::AttrKind Kind);
170171

171-
void addAttr(Attribute Attr);
172+
LLVM_ABI void addAttr(Attribute Attr);
172173

173174
/// Remove attributes from an argument.
174-
void removeAttr(Attribute::AttrKind Kind);
175+
LLVM_ABI void removeAttr(Attribute::AttrKind Kind);
175176

176-
void removeAttrs(const AttributeMask &AM);
177+
LLVM_ABI void removeAttrs(const AttributeMask &AM);
177178

178179
/// Check if an argument has a given attribute.
179-
bool hasAttribute(Attribute::AttrKind Kind) const;
180+
LLVM_ABI bool hasAttribute(Attribute::AttrKind Kind) const;
180181

181-
bool hasAttribute(StringRef Kind) const;
182+
LLVM_ABI bool hasAttribute(StringRef Kind) const;
182183

183-
Attribute getAttribute(Attribute::AttrKind Kind) const;
184+
LLVM_ABI Attribute getAttribute(Attribute::AttrKind Kind) const;
184185

185-
AttributeSet getAttributes() const;
186+
LLVM_ABI AttributeSet getAttributes() const;
186187

187188
/// Method for support type inquiry through isa, cast, and dyn_cast.
188189
static bool classof(const Value *V) {

llvm/include/llvm/IR/AssemblyAnnotationWriter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Instruction;
2424
class Value;
2525
class formatted_raw_ostream;
2626

27-
class AssemblyAnnotationWriter {
27+
class LLVM_ABI AssemblyAnnotationWriter {
2828
public:
2929
virtual ~AssemblyAnnotationWriter();
3030

llvm/include/llvm/IR/Assumptions.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#ifndef LLVM_IR_ASSUMPTIONS_H
1616
#define LLVM_IR_ASSUMPTIONS_H
1717

18+
#include "llvm/Support/Compiler.h"
1819
#include "llvm/ADT/DenseSet.h"
1920
#include "llvm/ADT/StringRef.h"
2021
#include "llvm/ADT/StringSet.h"
@@ -29,7 +30,7 @@ constexpr StringRef AssumptionAttrKey = "llvm.assume";
2930

3031
/// A set of known assumption strings that are accepted without warning and
3132
/// which can be recommended as typo correction.
32-
extern StringSet<> KnownAssumptionStrings;
33+
LLVM_ABI extern StringSet<> KnownAssumptionStrings;
3334

3435
/// Helper that allows to insert a new assumption string in the known assumption
3536
/// set by creating a (static) object.
@@ -49,25 +50,25 @@ struct KnownAssumptionString {
4950
};
5051

5152
/// Return true if \p F has the assumption \p AssumptionStr attached.
52-
bool hasAssumption(const Function &F,
53+
LLVM_ABI bool hasAssumption(const Function &F,
5354
const KnownAssumptionString &AssumptionStr);
5455

5556
/// Return true if \p CB or the callee has the assumption \p AssumptionStr
5657
/// attached.
57-
bool hasAssumption(const CallBase &CB,
58+
LLVM_ABI bool hasAssumption(const CallBase &CB,
5859
const KnownAssumptionString &AssumptionStr);
5960

6061
/// Return the set of all assumptions for the function \p F.
61-
DenseSet<StringRef> getAssumptions(const Function &F);
62+
LLVM_ABI DenseSet<StringRef> getAssumptions(const Function &F);
6263

6364
/// Return the set of all assumptions for the call \p CB.
64-
DenseSet<StringRef> getAssumptions(const CallBase &CB);
65+
LLVM_ABI DenseSet<StringRef> getAssumptions(const CallBase &CB);
6566

6667
/// Appends the set of assumptions \p Assumptions to \F.
67-
bool addAssumptions(Function &F, const DenseSet<StringRef> &Assumptions);
68+
LLVM_ABI bool addAssumptions(Function &F, const DenseSet<StringRef> &Assumptions);
6869

6970
/// Appends the set of assumptions \p Assumptions to \CB.
70-
bool addAssumptions(CallBase &CB, const DenseSet<StringRef> &Assumptions);
71+
LLVM_ABI bool addAssumptions(CallBase &CB, const DenseSet<StringRef> &Assumptions);
7172

7273
} // namespace llvm
7374

0 commit comments

Comments
 (0)