Skip to content

Commit

Permalink
Use __aarch64__ instead of TARGET_OS_SIMULATOR to determine target tr…
Browse files Browse the repository at this point in the history
…iple to account for Mac Catalyst
  • Loading branch information
light-tech committed Mar 3, 2021
1 parent 4b373f6 commit 1434cec
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Sample/Sample/Interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,12 @@ class SimpleJIT {

public:
static Expected<std::unique_ptr<SimpleJIT>> Create() {
#if TARGET_OS_SIMULATOR
#ifdef __aarch64__
auto JTMB = new JITTargetMachineBuilder(Triple("arm64-apple-darwin")); // FIXME: Memory leaks here
#else
auto JTMB = JITTargetMachineBuilder::detectHost();
if (!JTMB)
return JTMB.takeError();
#else
// FIXME: Memory leaks
auto JTMB = new JITTargetMachineBuilder(Triple("arm64-apple-darwin"));
#endif

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

#if TARGET_OS_SIMULATOR
const std::string TripleStr = llvm::sys::getProcessTriple();
#else
#ifdef __aarch64__
const std::string TripleStr = "arm64-apple-darwin";
#else
const std::string TripleStr = llvm::sys::getProcessTriple();
#endif

llvm::Triple T(TripleStr);

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

0 comments on commit 1434cec

Please sign in to comment.