Skip to content

Commit 3a6c8c4

Browse files
Steelskinnikic
andauthored
llvm: Add missing LLVM_ABI annotations (#171629)
This patch updates various LLVM headers to properly add the `LLVM_ABI` and `LLVM_ABI_FOR_TEST` annotations to build LLVM as a DLL on Windows. This effort is tracked in #109483. --------- Co-authored-by: Nikita Popov <[email protected]>
1 parent c22d82a commit 3a6c8c4

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

llvm/include/llvm/CodeGen/LibcallLoweringInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class LibcallLoweringModuleAnalysis
110110
: public AnalysisInfoMixin<LibcallLoweringModuleAnalysis> {
111111
private:
112112
friend AnalysisInfoMixin<LibcallLoweringModuleAnalysis>;
113-
static AnalysisKey Key;
113+
LLVM_ABI static AnalysisKey Key;
114114

115115
LibcallLoweringModuleAnalysisResult LibcallLoweringMap;
116116

llvm/include/llvm/SandboxIR/Constant.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ class ConstantPtrAuth final : public Constant {
13791379
/// the only global-initializer user of the ptrauth signed pointer.
13801380
LLVM_ABI Constant *getAddrDiscriminator() const;
13811381

1382-
Constant *getDeactivationSymbol() const;
1382+
LLVM_ABI Constant *getDeactivationSymbol() const;
13831383

13841384
/// Whether there is any non-null address discriminator.
13851385
bool hasAddressDiscriminator() const {

llvm/include/llvm/Support/Hash.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ enum class KCFIHashAlgorithm { xxHash64, FNV1a };
2222

2323
/// Parse a KCFI hash algorithm name.
2424
/// Returns xxHash64 if the name is not recognized.
25-
KCFIHashAlgorithm parseKCFIHashAlgorithm(StringRef Name);
25+
LLVM_ABI KCFIHashAlgorithm parseKCFIHashAlgorithm(StringRef Name);
2626

2727
/// Convert a KCFI hash algorithm enum to its string representation.
28-
StringRef stringifyKCFIHashAlgorithm(KCFIHashAlgorithm Algorithm);
28+
LLVM_ABI StringRef stringifyKCFIHashAlgorithm(KCFIHashAlgorithm Algorithm);
2929

3030
/// Compute KCFI type ID from mangled type name.
3131
/// The algorithm can be xxHash64 or FNV-1a.
32-
uint32_t getKCFITypeID(StringRef MangledTypeName, KCFIHashAlgorithm Algorithm);
32+
LLVM_ABI uint32_t getKCFITypeID(StringRef MangledTypeName,
33+
KCFIHashAlgorithm Algorithm);
3334

3435
} // end namespace llvm
3536

llvm/include/llvm/Transforms/Utils/DebugSSAUpdater.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "llvm/IR/Instruction.h"
3030
#include "llvm/IR/ValueHandle.h"
3131
#include "llvm/IR/ValueMap.h"
32+
#include "llvm/Support/Compiler.h"
3233
#include <cstdint>
3334

3435
namespace llvm {
@@ -342,7 +343,7 @@ class DbgValueRangeTable {
342343
DenseMap<DebugVariableAggregate, DbgValueDef> OrigSingleLocVariableValueTable;
343344

344345
public:
345-
void addVariable(Function *F, DebugVariableAggregate DVA);
346+
LLVM_ABI_FOR_TEST void addVariable(Function *F, DebugVariableAggregate DVA);
346347
bool hasVariableEntry(DebugVariableAggregate DVA) const {
347348
return OrigVariableValueRangeTable.contains(DVA) ||
348349
OrigSingleLocVariableValueTable.contains(DVA);

0 commit comments

Comments
 (0)