Skip to content

Commit 5906ad4

Browse files
committed
Fix CI build error
1 parent 7fe3396 commit 5906ad4

1 file changed

Lines changed: 6 additions & 17 deletions

File tree

gen/dcompute/targetMetal.cpp

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// file for details.
77
//
88
//===----------------------------------------------------------------------===//
9+
#if LDC_LLVM_SUPPORTED_TARGET_AArch64
910

1011
#include "declaration.h"
1112
#include "gen/dcompute/druntime.h"
@@ -21,9 +22,6 @@
2122
#include <string>
2223
#include <vector>
2324
#include "dmd/identifier.h"
24-
25-
#if LDC_LLVM_SUPPORTED_TARGET_AArch64
26-
2725
#include "gen/dcompute/target.h"
2826
#include "gen/abi/targets.h"
2927
#include "gen/logger.h"
@@ -49,25 +47,16 @@ class TargetMetal : public DComputeTarget {
4947
// TODO: need to find 32-bit triple
5048
llvm::StringRef tripleString = "air64_v28-apple-macosx26.0.0";
5149

52-
_ir->module.setTargetTriple(llvm::Triple(tripleString));
53-
50+
#if LLVM_VERSION_MAJOR>= 21
51+
_ir->module.setTargetTriple(llvm::Triple(tripleString));
52+
#else
53+
_ir->module.setTargetTriple(tripleString);
54+
#endif
5455

55-
// #if LDC_LLVM_VER >= 2100
56-
// _ir->module.setTargetTriple(llvm::Triple(tripleString));
57-
// #else
58-
// _ir->module.setTargetTriple(tripleString);
59-
// #endif
6056
llvm::StringRef dataLayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64"
6157
"-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-"
6258
"v512:512:512-v1024:1024:1024-n8:16:32";
6359

64-
// auto floatABI = ::FloatABI::Hard;
65-
// targetMachine = createTargetMachine(
66-
// targTriple,
67-
// is64 ? "" : "",
68-
// "", {},
69-
// is64 ? ExplicitBitness::M64 : ExplicitBitness::M32, floatABI,
70-
// llvm::Reloc::Static, llvm::CodeModel::Medium, codeGenOptLevel(), false);
7160
_ir->module.setDataLayout(is64 ? dataLayout: /* TODO: need to find 32-bit data layout */dataLayout);
7261
_ir->dcomputetarget = this;
7362
}

0 commit comments

Comments
 (0)