-
Notifications
You must be signed in to change notification settings - Fork 9
/
CCIntParser.h
45 lines (36 loc) · 1.16 KB
/
CCIntParser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef LLVM_CLANG_TOOLS_CLANG_CCINT_CCINT_PARSER_H
#define LLVM_CLANG_TOOLS_CLANG_CCINT_CCINT_PARSER_H
#include "clang/AST/GlobalDecl.h"
#include "clang/CodeGen/CodeGenAction.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"
#include <list>
#include <memory>
namespace llvm {
class LLVMContext;
class Module;
} // namespace llvm
namespace clang {
class ASTConsumer;
class CompilerInstance;
class CCIntAction;
class Parser;
class CCIntParser {
std::unique_ptr<CCIntAction> Act;
std::shared_ptr<CompilerInstance> CI;
std::shared_ptr<Parser> P;
llvm::StringRef MangledName;
std::unique_ptr<llvm::Module> TheModule;
public:
CCIntParser(std::unique_ptr<CompilerInstance> Instance,
llvm::LLVMContext &LLVMCtx, llvm::Error &Err);
~CCIntParser();
CompilerInstance *getCI() { return CI.get(); }
std::unique_ptr<llvm::Module> getModule() { return std::move(TheModule); }
llvm::Error Parse(llvm::StringRef FileName, bool Wrap);
llvm::StringRef GetMangledName() const;
std::string WrapInput(const std::string &Code);
};
} // end namespace clang
#endif // LLVM_CLANG_TOOLS_CLANG_CCINT_CCINT_PARSER_H