forked from mikael-s-persson/templight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TemplightAction.h
64 lines (52 loc) · 1.94 KB
/
TemplightAction.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//===- TemplightAction.h ------ Clang Templight Frontend Action -*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_TEMPLIGHT_TEMPLIGHT_ACTION_H
#define LLVM_CLANG_TEMPLIGHT_TEMPLIGHT_ACTION_H
#include <memory>
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendAction.h"
#include "llvm/ADT/StringRef.h"
namespace clang {
class TemplightAction : public WrapperFrontendAction {
protected:
std::unique_ptr<clang::ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
StringRef InFile) override;
bool BeginInvocation(CompilerInstance &CI) override;
bool BeginSourceFileAction(CompilerInstance &CI, StringRef Filename) override;
void ExecuteAction() override;
void EndSourceFileAction() override;
public:
/// Construct a TemplightAction from an existing action, taking
/// ownership of it.
TemplightAction(std::unique_ptr<FrontendAction> WrappedAction);
bool usesPreprocessorOnly() const override;
TranslationUnitKind getTranslationUnitKind() override;
bool hasPCHSupport() const override;
bool hasASTFileSupport() const override;
bool hasIRSupport() const override;
bool hasCodeCompletionSupport() const override;
static std::string CreateOutputFilename(
CompilerInstance *CI,
const std::string& OptOutputName,
bool OptInstProfiler,
bool OptOutputToStdOut,
bool OptMemoryProfile);
unsigned InstProfiler : 1;
unsigned OutputToStdOut : 1;
unsigned MemoryProfile : 1;
unsigned OutputInSafeMode : 1;
unsigned IgnoreSystemInst : 1;
unsigned InteractiveDebug : 1;
std::string OutputFilename;
std::string BlackListFilename;
private:
void EnsureHasSema(CompilerInstance& CI);
};
}
#endif