Skip to content

Commit 1d37c09

Browse files
committed
driver: fix LLVM 23 build regressions
1 parent 3745b05 commit 1d37c09

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

driver/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,11 @@ void parseCommandLine(Strings &sourceFiles) {
322322
if (auto target = lookupTarget("", triple, errMsg)) {
323323
llvm::errs() << "Targeting " << target->getName() << ". ";
324324
// this prints the available CPUs and features of the target to stderr...
325+
#if LDC_LLVM_VER >= 2300
326+
target->createMCSubtargetInfo(triple, "help", "");
327+
#else
325328
target->createMCSubtargetInfo(cfg_triple, "help", "");
329+
#endif
326330
} else {
327331
error(Loc(), "%s", errMsg.c_str());
328332
fatal();

driver/plugins.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
#include "llvm/Support/CommandLine.h"
2626
#include "llvm/Support/DynamicLibrary.h"
2727
#include "llvm/ADT/SmallVector.h"
28+
#if LDC_LLVM_VER >= 2300
29+
#include "llvm/Plugins/PassPlugin.h"
30+
#else
2831
#include "llvm/Passes/PassPlugin.h"
32+
#endif
2933
#include "llvm/Support/Error.h"
3034

3135
#include "driver/cl_options.h"

0 commit comments

Comments
 (0)