|
1 | 1 | /*========================== begin_copyright_notice ============================ |
2 | 2 |
|
3 | | -Copyright (C) 2024 Intel Corporation |
| 3 | +Copyright (C) 2024-2025 Intel Corporation |
4 | 4 |
|
5 | 5 | SPDX-License-Identifier: MIT |
6 | 6 |
|
@@ -62,8 +62,6 @@ void registerPluginPasses(PassBuilder &PB) { |
62 | 62 | std::string Error = ""; |
63 | 63 | std::string CPUStr = ""; |
64 | 64 | std::string FeaturesStr = ""; |
65 | | - const Target *TheTarget = TargetRegistry::lookupTarget( |
66 | | - TheTriple.getArchName().str(), TheTriple, Error); |
67 | 65 |
|
68 | 66 | llvm::TargetMachine *TM = |
69 | 67 | GetTargetMachine(TheTriple, CPUStr, FeaturesStr, Options); |
@@ -105,19 +103,20 @@ void registerPluginPasses(PassBuilder &PB) { |
105 | 103 | } |
106 | 104 | } // namespace |
107 | 105 |
|
108 | | -PassPluginLibraryInfo getNewPMPluginInfo() { |
109 | | - return {LLVM_PLUGIN_API_VERSION, "NewPMPlugin", "v0.1", registerPluginPasses}; |
110 | | -} |
111 | | - |
112 | 106 | #ifdef __GNUC__ |
113 | 107 | #define DLL_PUBLIC __attribute__((visibility("default"))) |
114 | 108 | #else |
115 | 109 | #define DLL_PUBLIC __declspec(dllexport) |
116 | 110 | #endif |
117 | 111 |
|
118 | | -// TODO: Fix visibility |
119 | 112 | extern "C" { |
| 113 | +PassPluginLibraryInfo DLL_PUBLIC getNewPMPluginInfo() { |
| 114 | + return {LLVM_PLUGIN_API_VERSION, "NewPMPlugin", "v0.1", registerPluginPasses}; |
| 115 | +} |
| 116 | + |
| 117 | +#if !(defined(_WIN64) || defined(_WIN32)) |
120 | 118 | LLVM_ATTRIBUTE_WEAK DLL_PUBLIC PassPluginLibraryInfo llvmGetPassPluginInfo() { |
121 | 119 | return getNewPMPluginInfo(); |
122 | 120 | } |
| 121 | +#endif |
123 | 122 | } |
0 commit comments