Skip to content

Commit 1434cec

Browse files
committed
Use __aarch64__ instead of TARGET_OS_SIMULATOR to determine target triple to account for Mac Catalyst
1 parent 4b373f6 commit 1434cec

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

Sample/Sample/Interpreter.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,12 @@ class SimpleJIT {
7575

7676
public:
7777
static Expected<std::unique_ptr<SimpleJIT>> Create() {
78-
#if TARGET_OS_SIMULATOR
78+
#ifdef __aarch64__
79+
auto JTMB = new JITTargetMachineBuilder(Triple("arm64-apple-darwin")); // FIXME: Memory leaks here
80+
#else
7981
auto JTMB = JITTargetMachineBuilder::detectHost();
8082
if (!JTMB)
8183
return JTMB.takeError();
82-
#else
83-
// FIXME: Memory leaks
84-
auto JTMB = new JITTargetMachineBuilder(Triple("arm64-apple-darwin"));
8584
#endif
8685

8786
auto TM = JTMB->createTargetMachine();
@@ -136,11 +135,12 @@ int clangInterpret(int argc, const char **argv, llvm::raw_ostream &errorOutputSt
136135
IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
137136
DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagClient);
138137

139-
#if TARGET_OS_SIMULATOR
140-
const std::string TripleStr = llvm::sys::getProcessTriple();
141-
#else
138+
#ifdef __aarch64__
142139
const std::string TripleStr = "arm64-apple-darwin";
140+
#else
141+
const std::string TripleStr = llvm::sys::getProcessTriple();
143142
#endif
143+
144144
llvm::Triple T(TripleStr);
145145

146146
// Use ELF on Windows-32 and MingW for now.

0 commit comments

Comments
 (0)