QCOR
xacc_llvm_compiler.hpp
1 #ifndef QCOR_XACC_LLVM_UTIL_HPP_
2 #define QCOR_XACC_LLVM_UTIL_HPP_
3 
4 #include "xacc.hpp"
5 
6 using namespace xacc;
7 
8 namespace qcor {
9 
10 // The goal of this class is to provide a compile
11 // implementation that maps LLVM IR string to a
12 // CompositeInstruction, and to implement translate
13 // to take a CompositeInstruction and create LLVM IR
14 // (using the usual qrt calls).
15 class LLVMCompiler : public xacc::Compiler {
16 public:
17  std::shared_ptr<xacc::IR> compile(const std::string &src,
18  std::shared_ptr<Accelerator> acc) override;
19 
20  std::shared_ptr<xacc::IR> compile(const std::string &src) override {
21  return compile(src, nullptr);
22  }
23 
24  const std::string
25  translate(std::shared_ptr<CompositeInstruction> program) override {
26  HeterogeneousMap empty;
27  return translate(program, empty);
28  }
29 
30  const std::string
31  translate(std::shared_ptr<CompositeInstruction> program,
32  HeterogeneousMap &options) override;
33 
34  const std::string name() const override { return "xacc-llvm"; }
35 
36  const std::string description() const override { return ""; }
37 
38  virtual ~LLVMCompiler() {}
39 };
40 
41 } // namespace qcor
42 
43 #endif
qcor::LLVMCompiler
Definition: xacc_llvm_compiler.hpp:15
qcor
Definition: qcor_syntax_handler.cpp:15