Commit b2aa20a5 authored by Nguyen, Thien Minh's avatar Nguyen, Thien Minh
Browse files

Merge branch 'master' into tnguyen/qsim-examples

parents 954a0238 41b63c68
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
#include <clang/CodeGen/CodeGenAction.h>

#include <filesystem>
#include <fstream>
#include <memory>

@@ -300,9 +301,16 @@ class LLVMJIT {
    return ES.lookup({&MainJD}, Mangle(Name.str()));
  }
};
#include <sys/stat.h>

QJIT::QJIT() {
  // FIXME if tmp directory doesnt exist create it
  // if tmp directory doesnt exist create it
  std::string tmp_dir = "@CMAKE_INSTALL_PREFIX@/tmp";
  if (!xacc::directoryExists(tmp_dir)) {
    auto status =
        mkdir(tmp_dir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
  }

  std::string cache_file_loc = "@CMAKE_INSTALL_PREFIX@/tmp/qjit_cache.json";
  if (!xacc::fileExists(cache_file_loc)) {
    // if it doesn't exist, create it
+2 −2
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ std::unique_ptr<clang::CodeGenAction> emit_llvm_ir(const std::string src_code) {
  int argc = argv_vec.size();
  void *MainAddr = (void *)(intptr_t)GetExecutablePath;
  std::string Path =
      "@LLVM_ROOT@/bin/clang++"; // GetExecutablePath(argv[0], MainAddr);
      "@LLVM_INSTALL_PREFIX@/bin/clang++"; // GetExecutablePath(argv[0], MainAddr);
  IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions();
  TextDiagnosticPrinter *DiagClient =
      new TextDiagnosticPrinter(llvm::errs(), &*DiagOpts);