summaryrefslogtreecommitdiff
path: root/Context.hh
blob: e300a19ab26826861149ddc449fdc43a31118cf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef PCC_CONTEXT_H
#define PCC_CONTEXT_H

#include <llvm/IR/IRBuilder.h>
#include <llvm/IR/Module.h>

namespace pcc {
using Value = llvm::Value*;
class Context {
  public:
    Context(const char* name);
    llvm::Module* GetModule();
    llvm::IRBuilder<>* GetBuilder();

  private:
    llvm::IRBuilder<> builder_;
    llvm::Module module_;
};

extern llvm::LLVMContext GlobalContext;
} // namespace pcc

#endif