Skip to content

Commit 19658d1

Browse files
authored
[llvm] annotate interfaces in llvm/Target for DLL export (#143615)
## Purpose This patch is one in a series of code-mods that annotate LLVM’s public interface for export. This patch annotates the `llvm/Target` library. These annotations currently have no meaningful impact on the LLVM build; however, they are a prerequisite to support an LLVM Windows DLL (shared library) build. ## Background This effort is tracked in #109483. Additional context is provided in [this discourse](https://discourse.llvm.org/t/psa-annotating-llvm-public-interface/85307), and documentation for `LLVM_ABI` and related annotations is found in the LLVM repo [here](https://github.com/llvm/llvm-project/blob/main/llvm/docs/InterfaceExportAnnotations.rst). A sub-set of these changes were generated automatically using the [Interface Definition Scanner (IDS)](https://github.com/compnerd/ids) tool, followed formatting with `git clang-format`. The bulk of this change is manual additions of `LLVM_ABI` to `LLVMInitializeX` functions defined in .cpp files under llvm/lib/Target. Adding `LLVM_ABI` to the function implementation is required here because they do not `#include "llvm/Support/TargetSelect.h"`, which contains the declarations for this functions and was already updated with `LLVM_ABI` in a previous patch. I considered patching these files with `#include "llvm/Support/TargetSelect.h"` instead, but since TargetSelect.h is a large file with a bunch of preprocessor x-macro stuff in it I was concerned it would unnecessarily impact compile times. In addition, a number of unit tests under llvm/unittests/Target required additional dependencies to make them build correctly against the LLVM DLL on Windows using MSVC. ## Validation Local builds and tests to validate cross-platform compatibility. This included llvm, clang, and lldb on the following configurations: - Windows with MSVC - Windows with Clang - Linux with GCC - Linux with Clang - Darwin with Clang
1 parent b1aa845 commit 19658d1

File tree

121 files changed

+322
-123
lines changed

Some content is hidden

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

121 files changed

+322
-123
lines changed

llvm/include/llvm/Target/CGPassBuilderOption.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#define LLVM_TARGET_CGPASSBUILDEROPTION_H
1616

1717
#include "llvm/Support/CommandLine.h"
18+
#include "llvm/Support/Compiler.h"
1819
#include "llvm/Target/TargetOptions.h"
1920
#include <optional>
2021

@@ -82,7 +83,7 @@ struct CGPassBuilderOption {
8283
std::optional<bool> DebugifyCheckAndStripAll;
8384
};
8485

85-
CGPassBuilderOption getCGPassBuilderOption();
86+
LLVM_ABI CGPassBuilderOption getCGPassBuilderOption();
8687

8788
} // namespace llvm
8889

llvm/include/llvm/Target/TargetLoweringObjectFile.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "llvm/MC/MCObjectFileInfo.h"
1818
#include "llvm/MC/MCRegister.h"
19+
#include "llvm/Support/Compiler.h"
1920
#include <cstdint>
2021

2122
namespace llvm {
@@ -43,7 +44,7 @@ class StringRef;
4344
class TargetMachine;
4445
class DSOLocalEquivalent;
4546

46-
class TargetLoweringObjectFile : public MCObjectFileInfo {
47+
class LLVM_ABI TargetLoweringObjectFile : public MCObjectFileInfo {
4748
/// Name-mangler for global names.
4849
Mangler *Mang = nullptr;
4950

llvm/include/llvm/Target/TargetMachine.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "llvm/Support/Allocator.h"
2020
#include "llvm/Support/CodeGen.h"
2121
#include "llvm/Support/CommandLine.h"
22+
#include "llvm/Support/Compiler.h"
2223
#include "llvm/Support/Error.h"
2324
#include "llvm/Support/PGOOptions.h"
2425
#include "llvm/Target/CGPassBuilderOption.h"
@@ -28,7 +29,7 @@
2829
#include <string>
2930
#include <utility>
3031

31-
extern llvm::cl::opt<bool> NoKernelInfoEndLTO;
32+
extern LLVM_ABI llvm::cl::opt<bool> NoKernelInfoEndLTO;
3233

3334
namespace llvm {
3435

@@ -78,7 +79,7 @@ struct MachineFunctionInfo;
7879
/// machine. All target-specific information should be accessible through this
7980
/// interface.
8081
///
81-
class TargetMachine {
82+
class LLVM_ABI TargetMachine {
8283
protected: // Can only create subclasses.
8384
TargetMachine(const Target &T, StringRef DataLayoutString,
8485
const Triple &TargetTriple, StringRef CPU, StringRef FS,

llvm/include/llvm/Target/TargetOptions.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "llvm/ADT/FloatingPointMode.h"
1818
#include "llvm/MC/MCTargetOptions.h"
19+
#include "llvm/Support/Compiler.h"
1920

2021
#include <memory>
2122

@@ -158,12 +159,12 @@ class TargetOptions {
158159

159160
/// DisableFramePointerElim - This returns true if frame pointer elimination
160161
/// optimization should be disabled for the given machine function.
161-
bool DisableFramePointerElim(const MachineFunction &MF) const;
162+
LLVM_ABI bool DisableFramePointerElim(const MachineFunction &MF) const;
162163

163164
/// FramePointerIsReserved - This returns true if the frame pointer must
164165
/// always either point to a new frame record or be un-modified in the given
165166
/// function.
166-
bool FramePointerIsReserved(const MachineFunction &MF) const;
167+
LLVM_ABI bool FramePointerIsReserved(const MachineFunction &MF) const;
167168

168169
/// If greater than 0, override the default value of
169170
/// MCAsmInfo::BinutilsVersion.
@@ -219,7 +220,7 @@ class TargetOptions {
219220
/// truncations). If this is enabled (set to true), the code generator must
220221
/// assume that the rounding mode may dynamically change.
221222
unsigned HonorSignDependentRoundingFPMathOption : 1;
222-
bool HonorSignDependentRoundingFPMath() const;
223+
LLVM_ABI bool HonorSignDependentRoundingFPMath() const;
223224

224225
/// NoZerosInBSS - By default some codegens place zero-initialized data to
225226
/// .bss section. This flag disables such behaviour (necessary, e.g. for
@@ -346,7 +347,7 @@ class TargetOptions {
346347
unsigned EnableDebugEntryValues : 1;
347348
/// NOTE: There are targets that still do not support the debug entry values
348349
/// production.
349-
bool ShouldEmitDebugEntryValues() const;
350+
LLVM_ABI bool ShouldEmitDebugEntryValues() const;
350351

351352
// When set to true, use experimental new debug variable location tracking,
352353
// which seeks to follow the values of variables rather than their location,
@@ -450,7 +451,7 @@ class TargetOptions {
450451

451452
DenormalMode getRawFP32DenormalMode() const { return FP32DenormalMode; }
452453

453-
DenormalMode getDenormalMode(const fltSemantics &FPType) const;
454+
LLVM_ABI DenormalMode getDenormalMode(const fltSemantics &FPType) const;
454455

455456
/// What exception model to use
456457
ExceptionHandling ExceptionModel = ExceptionHandling::None;

llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#include "llvm/MC/TargetRegistry.h"
5959
#include "llvm/Support/Casting.h"
6060
#include "llvm/Support/CommandLine.h"
61+
#include "llvm/Support/Compiler.h"
6162
#include "llvm/Support/ErrorHandling.h"
6263
#include "llvm/Support/raw_ostream.h"
6364
#include "llvm/Target/TargetMachine.h"
@@ -3534,7 +3535,8 @@ INITIALIZE_PASS(AArch64AsmPrinter, "aarch64-asm-printer",
35343535
"AArch64 Assembly Printer", false, false)
35353536

35363537
// Force static initialization.
3537-
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAArch64AsmPrinter() {
3538+
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void
3539+
LLVMInitializeAArch64AsmPrinter() {
35383540
RegisterAsmPrinter<AArch64AsmPrinter> X(getTheAArch64leTarget());
35393541
RegisterAsmPrinter<AArch64AsmPrinter> Y(getTheAArch64beTarget());
35403542
RegisterAsmPrinter<AArch64AsmPrinter> Z(getTheARM64Target());

llvm/lib/Target/AArch64/AArch64TargetMachine.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include "llvm/Passes/PassBuilder.h"
4545
#include "llvm/Support/CodeGen.h"
4646
#include "llvm/Support/CommandLine.h"
47+
#include "llvm/Support/Compiler.h"
4748
#include "llvm/Target/TargetLoweringObjectFile.h"
4849
#include "llvm/Target/TargetOptions.h"
4950
#include "llvm/TargetParser/Triple.h"
@@ -223,7 +224,8 @@ static cl::opt<bool>
223224
cl::desc("Enable Machine Pipeliner for AArch64"),
224225
cl::init(false), cl::Hidden);
225226

226-
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAArch64Target() {
227+
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void
228+
LLVMInitializeAArch64Target() {
227229
// Register the target.
228230
RegisterTargetMachine<AArch64leTargetMachine> X(getTheAArch64leTarget());
229231
RegisterTargetMachine<AArch64beTargetMachine> Y(getTheAArch64beTarget());

llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8322,7 +8322,8 @@ bool AArch64AsmParser::classifySymbolRef(const MCExpr *Expr,
83228322
}
83238323

83248324
/// Force static initialization.
8325-
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAArch64AsmParser() {
8325+
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void
8326+
LLVMInitializeAArch64AsmParser() {
83268327
RegisterMCAsmParser<AArch64AsmParser> X(getTheAArch64leTarget());
83278328
RegisterMCAsmParser<AArch64AsmParser> Y(getTheAArch64beTarget());
83288329
RegisterMCAsmParser<AArch64AsmParser> Z(getTheARM64Target());

llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ createAArch64ExternalSymbolizer(const Triple &TT, LLVMOpInfoCallback GetOpInfo,
310310
SymbolLookUp, DisInfo);
311311
}
312312

313-
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAArch64Disassembler() {
313+
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void
314+
LLVMInitializeAArch64Disassembler() {
314315
TargetRegistry::RegisterMCDisassembler(getTheAArch64leTarget(),
315316
createAArch64Disassembler);
316317
TargetRegistry::RegisterMCDisassembler(getTheAArch64beTarget(),

llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "llvm/MC/MCStreamer.h"
2828
#include "llvm/MC/MCSubtargetInfo.h"
2929
#include "llvm/MC/TargetRegistry.h"
30+
#include "llvm/Support/Compiler.h"
3031
#include "llvm/Support/Endian.h"
3132
#include "llvm/Support/ErrorHandling.h"
3233
#include "llvm/TargetParser/AArch64TargetParser.h"
@@ -503,7 +504,8 @@ static MCInstrAnalysis *createAArch64InstrAnalysis(const MCInstrInfo *Info) {
503504
}
504505

505506
// Force static initialization.
506-
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAArch64TargetMC() {
507+
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void
508+
LLVMInitializeAArch64TargetMC() {
507509
for (Target *T : {&getTheAArch64leTarget(), &getTheAArch64beTarget(),
508510
&getTheAArch64_32Target(), &getTheARM64Target(),
509511
&getTheARM64_32Target()}) {

llvm/lib/Target/AArch64/TargetInfo/AArch64TargetInfo.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "TargetInfo/AArch64TargetInfo.h"
1010
#include "llvm/MC/TargetRegistry.h"
11+
#include "llvm/Support/Compiler.h"
1112

1213
using namespace llvm;
1314
Target &llvm::getTheAArch64leTarget() {
@@ -31,7 +32,8 @@ Target &llvm::getTheARM64_32Target() {
3132
return TheARM64_32Target;
3233
}
3334

34-
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAArch64TargetInfo() {
35+
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void
36+
LLVMInitializeAArch64TargetInfo() {
3537
// Now register the "arm64" name for use with "-march". We don't want it to
3638
// take possession of the Triple::aarch64 tags though.
3739
TargetRegistry::RegisterTarget(getTheARM64Target(), "arm64",

llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "llvm/MC/MCStreamer.h"
4444
#include "llvm/MC/TargetRegistry.h"
4545
#include "llvm/Support/AMDHSAKernelDescriptor.h"
46+
#include "llvm/Support/Compiler.h"
4647
#include "llvm/Target/TargetLoweringObjectFile.h"
4748
#include "llvm/Target/TargetMachine.h"
4849
#include "llvm/TargetParser/TargetParser.h"
@@ -83,7 +84,8 @@ createAMDGPUAsmPrinterPass(TargetMachine &tm,
8384
return new AMDGPUAsmPrinter(tm, std::move(Streamer));
8485
}
8586

86-
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUAsmPrinter() {
87+
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void
88+
LLVMInitializeAMDGPUAsmPrinter() {
8789
TargetRegistry::RegisterAsmPrinter(getTheR600Target(),
8890
llvm::createR600AsmPrinterPass);
8991
TargetRegistry::RegisterAsmPrinter(getTheGCNTarget(),

llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
#include "llvm/InitializePasses.h"
9090
#include "llvm/MC/TargetRegistry.h"
9191
#include "llvm/Passes/PassBuilder.h"
92+
#include "llvm/Support/Compiler.h"
9293
#include "llvm/Support/FormatVariadic.h"
9394
#include "llvm/Transforms/HipStdPar/HipStdPar.h"
9495
#include "llvm/Transforms/IPO.h"
@@ -481,7 +482,7 @@ static cl::opt<bool> HasClosedWorldAssumption(
481482
cl::desc("Whether has closed-world assumption at link time"),
482483
cl::init(false), cl::Hidden);
483484

484-
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTarget() {
485+
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTarget() {
485486
// Register the target
486487
RegisterTargetMachine<R600TargetMachine> X(getTheR600Target());
487488
RegisterTargetMachine<GCNTargetMachine> Y(getTheGCNTarget());

llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "llvm/Support/AMDGPUMetadata.h"
4040
#include "llvm/Support/AMDHSAKernelDescriptor.h"
4141
#include "llvm/Support/Casting.h"
42+
#include "llvm/Support/Compiler.h"
4243
#include "llvm/Support/MathExtras.h"
4344
#include "llvm/TargetParser/TargetParser.h"
4445
#include <optional>
@@ -9800,7 +9801,8 @@ void AMDGPUAsmParser::cvtSDWA(MCInst &Inst, const OperandVector &Operands,
98009801
}
98019802

98029803
/// Force static initialization.
9803-
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUAsmParser() {
9804+
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void
9805+
LLVMInitializeAMDGPUAsmParser() {
98049806
RegisterMCAsmParser<AMDGPUAsmParser> A(getTheR600Target());
98059807
RegisterMCAsmParser<AMDGPUAsmParser> B(getTheGCNTarget());
98069808
}

llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "llvm/MC/MCSubtargetInfo.h"
3535
#include "llvm/MC/TargetRegistry.h"
3636
#include "llvm/Support/AMDHSAKernelDescriptor.h"
37+
#include "llvm/Support/Compiler.h"
3738

3839
using namespace llvm;
3940

@@ -2648,7 +2649,8 @@ static MCDisassembler *createAMDGPUDisassembler(const Target &T,
26482649
return new AMDGPUDisassembler(STI, Ctx, T.createMCInstrInfo());
26492650
}
26502651

2651-
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUDisassembler() {
2652+
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void
2653+
LLVMInitializeAMDGPUDisassembler() {
26522654
TargetRegistry::RegisterMCDisassembler(getTheGCNTarget(),
26532655
createAMDGPUDisassembler);
26542656
TargetRegistry::RegisterMCSymbolizer(getTheGCNTarget(),

llvm/lib/Target/AMDGPU/MCA/AMDGPUCustomBehaviour.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "TargetInfo/AMDGPUTargetInfo.h"
1717
#include "Utils/AMDGPUBaseInfo.h"
1818
#include "llvm/MC/TargetRegistry.h"
19+
#include "llvm/Support/Compiler.h"
1920
#include "llvm/Support/WithColor.h"
2021

2122
namespace llvm::mca {
@@ -353,7 +354,8 @@ createAMDGPUInstrPostProcess(const MCSubtargetInfo &STI,
353354

354355
/// Extern function to initialize the targets for the AMDGPU backend
355356

356-
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTargetMCA() {
357+
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void
358+
LLVMInitializeAMDGPUTargetMCA() {
357359
TargetRegistry::RegisterCustomBehaviour(getTheR600Target(),
358360
createAMDGPUCustomBehaviour);
359361
TargetRegistry::RegisterInstrPostProcess(getTheR600Target(),

llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "llvm/MC/MCStreamer.h"
3232
#include "llvm/MC/MCSubtargetInfo.h"
3333
#include "llvm/MC/TargetRegistry.h"
34+
#include "llvm/Support/Compiler.h"
3435

3536
using namespace llvm;
3637

@@ -156,7 +157,8 @@ static MCInstrAnalysis *createAMDGPUMCInstrAnalysis(const MCInstrInfo *Info) {
156157
return new AMDGPUMCInstrAnalysis(Info);
157158
}
158159

159-
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTargetMC() {
160+
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void
161+
LLVMInitializeAMDGPUTargetMC() {
160162

161163
TargetRegistry::RegisterMCInstrInfo(getTheGCNTarget(), createAMDGPUMCInstrInfo);
162164
TargetRegistry::RegisterMCInstrInfo(getTheR600Target(),

llvm/lib/Target/AMDGPU/TargetInfo/AMDGPUTargetInfo.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include "TargetInfo/AMDGPUTargetInfo.h"
1414
#include "llvm/MC/TargetRegistry.h"
15+
#include "llvm/Support/Compiler.h"
1516

1617
using namespace llvm;
1718

@@ -28,7 +29,8 @@ Target &llvm::getTheGCNTarget() {
2829
}
2930

3031
/// Extern function to initialize the targets for the AMDGPU backend
31-
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTargetInfo() {
32+
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void
33+
LLVMInitializeAMDGPUTargetInfo() {
3234
RegisterTarget<Triple::r600, false> R600(getTheR600Target(), "r600",
3335
"AMD GPUs HD2XXX-HD6XXX", "AMDGPU");
3436
RegisterTarget<Triple::amdgcn, false> GCN(getTheGCNTarget(), "amdgcn",

llvm/lib/Target/ARM/ARMAsmPrinter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include "llvm/MC/MCSymbol.h"
4141
#include "llvm/MC/TargetRegistry.h"
4242
#include "llvm/Support/ARMBuildAttributes.h"
43+
#include "llvm/Support/Compiler.h"
4344
#include "llvm/Support/Debug.h"
4445
#include "llvm/Support/ErrorHandling.h"
4546
#include "llvm/Support/raw_ostream.h"
@@ -2456,7 +2457,8 @@ INITIALIZE_PASS(ARMAsmPrinter, "arm-asm-printer", "ARM Assembly Printer", false,
24562457
//===----------------------------------------------------------------------===//
24572458

24582459
// Force static initialization.
2459-
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMAsmPrinter() {
2460+
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void
2461+
LLVMInitializeARMAsmPrinter() {
24602462
RegisterAsmPrinter<ARMAsmPrinter> X(getTheARMLETarget());
24612463
RegisterAsmPrinter<ARMAsmPrinter> Y(getTheARMBETarget());
24622464
RegisterAsmPrinter<ARMAsmPrinter> A(getTheThumbLETarget());

llvm/lib/Target/ARM/ARMTargetMachine.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "llvm/Pass.h"
4242
#include "llvm/Support/CodeGen.h"
4343
#include "llvm/Support/CommandLine.h"
44+
#include "llvm/Support/Compiler.h"
4445
#include "llvm/Support/ErrorHandling.h"
4546
#include "llvm/Target/TargetLoweringObjectFile.h"
4647
#include "llvm/Target/TargetOptions.h"
@@ -82,7 +83,7 @@ namespace llvm {
8283
void initializeARMExecutionDomainFixPass(PassRegistry&);
8384
}
8485

85-
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMTarget() {
86+
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMTarget() {
8687
// Register the target.
8788
RegisterTargetMachine<ARMLETargetMachine> X(getTheARMLETarget());
8889
RegisterTargetMachine<ARMLETargetMachine> A(getTheThumbLETarget());

llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12722,7 +12722,7 @@ bool ARMAsmParser::parseDirectiveSEHCustom(SMLoc L) {
1272212722
}
1272312723

1272412724
/// Force static initialization.
12725-
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMAsmParser() {
12725+
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMAsmParser() {
1272612726
RegisterMCAsmParser<ARMAsmParser> X(getTheARMLETarget());
1272712727
RegisterMCAsmParser<ARMAsmParser> Y(getTheARMBETarget());
1272812728
RegisterMCAsmParser<ARMAsmParser> A(getTheThumbLETarget());

llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,8 @@ DecodeStatus ARMDisassembler::getThumbInstruction(MCInst &MI, uint64_t &Size,
12691269
return MCDisassembler::Fail;
12701270
}
12711271

1272-
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMDisassembler() {
1272+
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void
1273+
LLVMInitializeARMDisassembler() {
12731274
TargetRegistry::RegisterMCDisassembler(getTheARMLETarget(),
12741275
createARMDisassembler);
12751276
TargetRegistry::RegisterMCDisassembler(getTheARMBETarget(),

llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "llvm/MC/MCStreamer.h"
2828
#include "llvm/MC/MCSubtargetInfo.h"
2929
#include "llvm/MC/TargetRegistry.h"
30+
#include "llvm/Support/Compiler.h"
3031
#include "llvm/Support/ErrorHandling.h"
3132
#include "llvm/TargetParser/Triple.h"
3233

@@ -770,7 +771,7 @@ bool ARM::isCDECoproc(size_t Coproc, const MCSubtargetInfo &STI) {
770771
}
771772

772773
// Force static initialization.
773-
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMTargetMC() {
774+
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMTargetMC() {
774775
for (Target *T : {&getTheARMLETarget(), &getTheARMBETarget(),
775776
&getTheThumbLETarget(), &getTheThumbBETarget()}) {
776777
// Register the MC asm info.

0 commit comments

Comments
 (0)