Skip to content

Commit 4242b97

Browse files
committed
[llvm] annotate remaining interfaces for DLL export
1 parent 6f4add3 commit 4242b97

File tree

24 files changed

+97
-84
lines changed

24 files changed

+97
-84
lines changed

llvm/include/llvm/Analysis/DXILResource.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace dxil {
3434

3535
// Returns the resource name from dx_resource_handlefrombinding or
3636
// dx_resource_handlefromimplicitbinding call
37-
StringRef getResourceNameFromBindingCall(CallInst *CI);
37+
LLVM_ABI StringRef getResourceNameFromBindingCall(CallInst *CI);
3838

3939
/// The dx.RawBuffer target extension type
4040
///

llvm/include/llvm/Analysis/IR2Vec.h

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#ifndef LLVM_ANALYSIS_IR2VEC_H
3030
#define LLVM_ANALYSIS_IR2VEC_H
3131

32+
#include "llvm/Support/Compiler.h"
3233
#include "llvm/ADT/DenseMap.h"
3334
#include "llvm/IR/PassManager.h"
3435
#include "llvm/Support/CommandLine.h"
@@ -57,9 +58,9 @@ enum class IR2VecKind { Symbolic };
5758

5859
namespace ir2vec {
5960

60-
extern cl::opt<float> OpcWeight;
61-
extern cl::opt<float> TypeWeight;
62-
extern cl::opt<float> ArgWeight;
61+
LLVM_ABI extern cl::opt<float> OpcWeight;
62+
LLVM_ABI extern cl::opt<float> TypeWeight;
63+
LLVM_ABI extern cl::opt<float> ArgWeight;
6364

6465
/// Embedding is a datatype that wraps std::vector<double>. It provides
6566
/// additional functionality for arithmetic and comparison operations.
@@ -106,16 +107,16 @@ struct Embedding {
106107
const std::vector<double> &getData() const { return Data; }
107108

108109
/// Arithmetic operators
109-
Embedding &operator+=(const Embedding &RHS);
110-
Embedding &operator-=(const Embedding &RHS);
110+
LLVM_ABI Embedding &operator+=(const Embedding &RHS);
111+
LLVM_ABI Embedding &operator-=(const Embedding &RHS);
111112

112113
/// Adds Src Embedding scaled by Factor with the called Embedding.
113114
/// Called_Embedding += Src * Factor
114-
Embedding &scaleAndAdd(const Embedding &Src, float Factor);
115+
LLVM_ABI Embedding &scaleAndAdd(const Embedding &Src, float Factor);
115116

116117
/// Returns true if the embedding is approximately equal to the RHS embedding
117118
/// within the specified tolerance.
118-
bool approximatelyEquals(const Embedding &RHS, double Tolerance = 1e-6) const;
119+
LLVM_ABI bool approximatelyEquals(const Embedding &RHS, double Tolerance = 1e-6) const;
119120
};
120121

121122
using InstEmbeddingsMap = DenseMap<const Instruction *, Embedding>;
@@ -148,7 +149,7 @@ class Embedder {
148149
mutable BBEmbeddingsMap BBVecMap;
149150
mutable InstEmbeddingsMap InstVecMap;
150151

151-
Embedder(const Function &F, const Vocab &Vocabulary);
152+
LLVM_ABI Embedder(const Function &F, const Vocab &Vocabulary);
152153

153154
/// Helper function to compute embeddings. It generates embeddings for all
154155
/// the instructions and basic blocks in the function F. Logic of computing
@@ -161,38 +162,38 @@ class Embedder {
161162

162163
/// Lookup vocabulary for a given Key. If the key is not found, it returns a
163164
/// zero vector.
164-
Embedding lookupVocab(const std::string &Key) const;
165+
LLVM_ABI Embedding lookupVocab(const std::string &Key) const;
165166

166167
public:
167168
virtual ~Embedder() = default;
168169

169170
/// Factory method to create an Embedder object.
170-
static Expected<std::unique_ptr<Embedder>>
171+
LLVM_ABI static Expected<std::unique_ptr<Embedder>>
171172
create(IR2VecKind Mode, const Function &F, const Vocab &Vocabulary);
172173

173174
/// Returns a map containing instructions and the corresponding embeddings for
174175
/// the function F if it has been computed. If not, it computes the embeddings
175176
/// for the function and returns the map.
176-
const InstEmbeddingsMap &getInstVecMap() const;
177+
LLVM_ABI const InstEmbeddingsMap &getInstVecMap() const;
177178

178179
/// Returns a map containing basic block and the corresponding embeddings for
179180
/// the function F if it has been computed. If not, it computes the embeddings
180181
/// for the function and returns the map.
181-
const BBEmbeddingsMap &getBBVecMap() const;
182+
LLVM_ABI const BBEmbeddingsMap &getBBVecMap() const;
182183

183184
/// Returns the embedding for a given basic block in the function F if it has
184185
/// been computed. If not, it computes the embedding for the basic block and
185186
/// returns it.
186-
const Embedding &getBBVector(const BasicBlock &BB) const;
187+
LLVM_ABI const Embedding &getBBVector(const BasicBlock &BB) const;
187188

188189
/// Computes and returns the embedding for the current function.
189-
const Embedding &getFunctionVector() const;
190+
LLVM_ABI const Embedding &getFunctionVector() const;
190191
};
191192

192193
/// Class for computing the Symbolic embeddings of IR2Vec.
193194
/// Symbolic embeddings are constructed based on the entity-level
194195
/// representations obtained from the Vocabulary.
195-
class SymbolicEmbedder : public Embedder {
196+
class LLVM_ABI SymbolicEmbedder : public Embedder {
196197
private:
197198
/// Utility function to compute the embedding for a given type.
198199
Embedding getTypeEmbedding(const Type *Ty) const;
@@ -219,12 +220,12 @@ class IR2VecVocabResult {
219220

220221
public:
221222
IR2VecVocabResult() = default;
222-
IR2VecVocabResult(ir2vec::Vocab &&Vocabulary);
223+
LLVM_ABI IR2VecVocabResult(ir2vec::Vocab &&Vocabulary);
223224

224225
bool isValid() const { return Valid; }
225-
const ir2vec::Vocab &getVocabulary() const;
226-
unsigned getDimension() const;
227-
bool invalidate(Module &M, const PreservedAnalyses &PA,
226+
LLVM_ABI const ir2vec::Vocab &getVocabulary() const;
227+
LLVM_ABI unsigned getDimension() const;
228+
LLVM_ABI bool invalidate(Module &M, const PreservedAnalyses &PA,
228229
ModuleAnalysisManager::Invalidator &Inv) const;
229230
};
230231

@@ -237,12 +238,12 @@ class IR2VecVocabAnalysis : public AnalysisInfoMixin<IR2VecVocabAnalysis> {
237238
void emitError(Error Err, LLVMContext &Ctx);
238239

239240
public:
240-
static AnalysisKey Key;
241+
LLVM_ABI static AnalysisKey Key;
241242
IR2VecVocabAnalysis() = default;
242-
explicit IR2VecVocabAnalysis(const ir2vec::Vocab &Vocab);
243-
explicit IR2VecVocabAnalysis(ir2vec::Vocab &&Vocab);
243+
LLVM_ABI explicit IR2VecVocabAnalysis(const ir2vec::Vocab &Vocab);
244+
LLVM_ABI explicit IR2VecVocabAnalysis(ir2vec::Vocab &&Vocab);
244245
using Result = IR2VecVocabResult;
245-
Result run(Module &M, ModuleAnalysisManager &MAM);
246+
LLVM_ABI Result run(Module &M, ModuleAnalysisManager &MAM);
246247
};
247248

248249
/// This pass prints the IR2Vec embeddings for instructions, basic blocks, and
@@ -253,7 +254,7 @@ class IR2VecPrinterPass : public PassInfoMixin<IR2VecPrinterPass> {
253254

254255
public:
255256
explicit IR2VecPrinterPass(raw_ostream &OS) : OS(OS) {}
256-
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
257+
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
257258
static bool isRequired() { return true; }
258259
};
259260

llvm/include/llvm/Analysis/ValueTracking.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,11 @@ LLVM_ABI std::optional<bool> computeKnownFPSignBit(const Value *V,
311311

312312
/// Return true if the sign bit of the FP value can be ignored by the user when
313313
/// the value is zero.
314-
bool canIgnoreSignBitOfZero(const Use &U);
314+
LLVM_ABI bool canIgnoreSignBitOfZero(const Use &U);
315315

316316
/// Return true if the sign bit of the FP value can be ignored by the user when
317317
/// the value is NaN.
318-
bool canIgnoreSignBitOfNaN(const Use &U);
318+
LLVM_ABI bool canIgnoreSignBitOfNaN(const Use &U);
319319

320320
/// If the specified value can be set by repeating the same byte in memory,
321321
/// return the i8 value that it is represented with. This is true for all i8

llvm/include/llvm/BinaryFormat/DXContainer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ enum class DescriptorRangeType : uint32_t {
181181
#include "DXContainerConstants.def"
182182
};
183183

184-
ArrayRef<EnumEntry<DescriptorRangeType>> getDescriptorRangeTypes();
184+
LLVM_ABI ArrayRef<EnumEntry<DescriptorRangeType>> getDescriptorRangeTypes();
185185

186186
#define ROOT_PARAMETER(Val, Enum) \
187187
case Val: \

llvm/include/llvm/CodeGenTypes/LowLevelType.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#ifndef LLVM_CODEGEN_LOWLEVELTYPE_H
2727
#define LLVM_CODEGEN_LOWLEVELTYPE_H
2828

29+
#include "llvm/Support/Compiler.h"
2930
#include "llvm/ADT/DenseMapInfo.h"
3031
#include "llvm/CodeGenTypes/MachineValueType.h"
3132
#include "llvm/Support/Debug.h"
@@ -140,7 +141,7 @@ class LLT {
140141
explicit constexpr LLT()
141142
: IsScalar(false), IsPointer(false), IsVector(false), RawData(0) {}
142143

143-
explicit LLT(MVT VT);
144+
LLVM_ABI explicit LLT(MVT VT);
144145

145146
constexpr bool isValid() const { return IsScalar || RawData != 0; }
146147
constexpr bool isScalar() const { return IsScalar; }
@@ -282,7 +283,7 @@ class LLT {
282283
return scalar(getScalarSizeInBits());
283284
}
284285

285-
void print(raw_ostream &OS) const;
286+
LLVM_ABI void print(raw_ostream &OS) const;
286287

287288
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
288289
LLVM_DUMP_METHOD void dump() const;

llvm/include/llvm/CodeGenTypes/MachineValueType.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#ifndef LLVM_CODEGEN_MACHINEVALUETYPE_H
1717
#define LLVM_CODEGEN_MACHINEVALUETYPE_H
1818

19+
#include "llvm/Support/Compiler.h"
1920
#include "llvm/ADT/Sequence.h"
2021
#include "llvm/Support/ErrorHandling.h"
2122
#include "llvm/Support/MathExtras.h"
@@ -65,10 +66,10 @@ namespace llvm {
6566
bool operator<=(const MVT& S) const { return SimpleTy <= S.SimpleTy; }
6667

6768
/// Support for debugging, callable in GDB: VT.dump()
68-
void dump() const;
69+
LLVM_ABI void dump() const;
6970

7071
/// Implement operator<<.
71-
void print(raw_ostream &OS) const;
72+
LLVM_ABI void print(raw_ostream &OS) const;
7273

7374
/// Return true if this is a valid simple valuetype.
7475
bool isValid() const {
@@ -509,11 +510,11 @@ namespace llvm {
509510
/// otherwise they are invalid.
510511
/// NB: This includes pointer types, which require a DataLayout to convert
511512
/// to a concrete value type.
512-
static MVT getVT(Type *Ty, bool HandleUnknown = false);
513+
LLVM_ABI static MVT getVT(Type *Ty, bool HandleUnknown = false);
513514

514515
/// Returns an APFloat semantics tag appropriate for the value type. If this
515516
/// is a vector type, the element semantics are returned.
516-
const fltSemantics &getFltSemantics() const;
517+
LLVM_ABI const fltSemantics &getFltSemantics() const;
517518

518519
public:
519520
/// SimpleValueType Iteration

llvm/include/llvm/DebugInfo/DWARF/DWARFCFIPrinter.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef LLVM_DEBUGINFO_DWARF_DWARFCFIPRINTER_H
1010
#define LLVM_DEBUGINFO_DWARF_DWARFCFIPRINTER_H
1111

12+
#include "llvm/Support/Compiler.h"
1213
#include "llvm/DebugInfo/DWARF/DWARFCFIProgram.h"
1314

1415
namespace llvm {
@@ -17,7 +18,7 @@ struct DIDumpOptions;
1718

1819
namespace dwarf {
1920

20-
void printCFIProgram(const CFIProgram &P, raw_ostream &OS,
21+
LLVM_ABI void printCFIProgram(const CFIProgram &P, raw_ostream &OS,
2122
const DIDumpOptions &DumpOpts, unsigned IndentLevel,
2223
std::optional<uint64_t> Address);
2324

llvm/include/llvm/DebugInfo/DWARF/DWARFCFIProgram.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ class CFIProgram {
106106
};
107107

108108
/// Get the OperandType as a "const char *".
109-
static const char *operandTypeString(OperandType OT);
109+
LLVM_ABI static const char *operandTypeString(OperandType OT);
110110

111111
/// Retrieve the array describing the types of operands according to the enum
112112
/// above. This is indexed by opcode.
113-
static ArrayRef<OperandType[MaxOperands]> getOperandTypes();
113+
LLVM_ABI static ArrayRef<OperandType[MaxOperands]> getOperandTypes();
114114

115115
private:
116116
std::vector<Instruction> Instructions;

llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class DWARFExpressionPrinter {
186186
/// \param E to be printed
187187
/// \param OS to this stream
188188
/// \param GetNameForDWARFReg callback to return dwarf register name
189-
static void print(const DWARFExpression *E, raw_ostream &OS,
189+
LLVM_ABI static void print(const DWARFExpression *E, raw_ostream &OS,
190190
DIDumpOptions DumpOpts, DWARFUnit *U, bool IsEH = false);
191191

192192
/// Print the expression in a format intended to be compact and useful to a
@@ -199,7 +199,7 @@ class DWARFExpressionPrinter {
199199
/// \param GetNameForDWARFReg callback to return dwarf register name
200200
///
201201
/// \returns true if the expression was successfully printed
202-
static bool printCompact(const DWARFExpression *E, raw_ostream &OS,
202+
LLVM_ABI static bool printCompact(const DWARFExpression *E, raw_ostream &OS,
203203
std::function<StringRef(uint64_t RegNum, bool IsEH)>
204204
GetNameForDWARFReg = nullptr);
205205

@@ -211,7 +211,7 @@ class DWARFExpressionPrinter {
211211
/// \param Operands to the opcode
212212
///
213213
/// returns true if the Op was successfully printed
214-
static bool prettyPrintRegisterOp(DWARFUnit *U, raw_ostream &OS,
214+
LLVM_ABI static bool prettyPrintRegisterOp(DWARFUnit *U, raw_ostream &OS,
215215
DIDumpOptions DumpOpts, uint8_t Opcode,
216216
ArrayRef<uint64_t> Operands);
217217

llvm/include/llvm/DebugInfo/LogicalView/Core/LVSourceLanguage.h

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

17+
#include "llvm/Support/Compiler.h"
1718
#include "llvm/ADT/StringRef.h"
1819
#include "llvm/BinaryFormat/Dwarf.h"
1920
#include "llvm/DebugInfo/CodeView/CodeView.h"
@@ -52,7 +53,7 @@ struct LVSourceLanguage {
5253

5354
bool isValid() const { return Language != Invalid; }
5455
TaggedLanguage get() const { return Language; }
55-
StringRef getName() const;
56+
LLVM_ABI StringRef getName() const;
5657

5758
private:
5859
TaggedLanguage Language = Invalid;

0 commit comments

Comments
 (0)