 |
|
 |
|
| Files: |
1 |
|
Branches Taken: |
20.0% |
22 / 110 |
| Generated: |
2010-02-10 01:31 |
|
Branches Executed: |
40.0% |
44 / 110 |
| |
|
Line Coverage: |
75.0% |
24 / 32 |
| |
 |
|
 |
1 : //===-- FrontendActions.h - Useful Frontend Actions -------------*- C++ -*-===//
2 : //
3 : // The LLVM Compiler Infrastructure
4 : //
5 : // This file is distributed under the University of Illinois Open Source
6 : // License. See LICENSE.TXT for details.
7 : //
8 : //===----------------------------------------------------------------------===//
9 :
10 : #ifndef LLVM_CLANG_FRONTEND_FRONTENDACTIONS_H
11 : #define LLVM_CLANG_FRONTEND_FRONTENDACTIONS_H
12 :
13 : #include "clang/Frontend/FrontendAction.h"
14 : #include <string>
15 : #include <vector>
16 :
17 : namespace clang {
18 : class FixItRewriter;
19 :
20 : //===----------------------------------------------------------------------===//
21 : // AST Consumer Actions
22 : //===----------------------------------------------------------------------===//
23 :
188: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
24 376: class AnalysisAction : public ASTFrontendAction {
25 : protected:
26 : virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
27 : llvm::StringRef InFile);
28 : };
29 :
17: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
30 34: class ASTPrintAction : public ASTFrontendAction {
31 : protected:
32 : virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
33 : llvm::StringRef InFile);
34 : };
35 :
1: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
36 2: class ASTPrintXMLAction : public ASTFrontendAction {
37 : protected:
38 : virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
39 : llvm::StringRef InFile);
40 : };
41 :
5: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
42 10: class ASTDumpAction : public ASTFrontendAction {
43 : protected:
44 : virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
45 : llvm::StringRef InFile);
46 : };
47 :
0: branch 1 not taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
48 0: class ASTViewAction : public ASTFrontendAction {
49 : protected:
50 : virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
51 : llvm::StringRef InFile);
52 : };
53 :
2: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
54 4: class DeclContextPrintAction : public ASTFrontendAction {
55 : protected:
56 : virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
57 : llvm::StringRef InFile);
58 : };
59 :
1: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
60 2: class DumpRecordAction : public ASTFrontendAction {
61 : protected:
62 : virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
63 : llvm::StringRef InFile);
64 : };
65 :
66 : class FixItAction : public ASTFrontendAction {
67 : private:
68 : llvm::OwningPtr<FixItRewriter> Rewriter;
69 :
70 : protected:
71 :
72 : virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
73 : llvm::StringRef InFile);
74 :
75 : virtual bool BeginSourceFileAction(CompilerInstance &CI,
76 : llvm::StringRef Filename);
77 :
78 : virtual void EndSourceFileAction();
79 :
80 0: virtual bool hasASTSupport() const { return false; }
81 :
82 : public:
83 : FixItAction();
84 : ~FixItAction();
85 : };
86 :
44: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
87 88: class GeneratePCHAction : public ASTFrontendAction {
88 : protected:
89 : virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
90 : llvm::StringRef InFile);
91 :
92 44: virtual bool usesCompleteTranslationUnit() { return false; }
93 :
94 0: virtual bool hasASTSupport() const { return false; }
95 : };
96 :
3: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
97 6: class HTMLPrintAction : public ASTFrontendAction {
98 : protected:
99 : virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
100 : llvm::StringRef InFile);
101 : };
102 :
0: branch 1 not taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
103 0: class InheritanceViewAction : public ASTFrontendAction {
104 : protected:
105 : virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
106 : llvm::StringRef InFile);
107 : };
108 :
51: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
109 102: class RewriteObjCAction : public ASTFrontendAction {
110 : protected:
111 : virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
112 : llvm::StringRef InFile);
113 : };
114 :
1280: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
115 2560: class SyntaxOnlyAction : public ASTFrontendAction {
116 : protected:
117 : virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
118 : llvm::StringRef InFile);
119 :
120 : public:
121 1278: virtual bool hasCodeCompletionSupport() const { return true; }
122 : };
123 :
124 : /**
125 : * \brief Frontend action adaptor that merges ASTs together.
126 : *
127 : * This action takes an existing AST file and "merges" it into the AST
128 : * context, producing a merged context. This action is an action
129 : * adaptor, which forwards most of its calls to another action that
130 : * will consume the merged context.
131 : */
132 : class ASTMergeAction : public FrontendAction {
133 : /// \brief The action that the merge action adapts.
134 : FrontendAction *AdaptedAction;
135 :
136 : /// \brief The set of AST files to merge.
137 : std::vector<std::string> ASTFiles;
138 :
139 : protected:
140 : virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
141 : llvm::StringRef InFile);
142 :
143 : virtual bool BeginSourceFileAction(CompilerInstance &CI,
144 : llvm::StringRef Filename);
145 :
146 : virtual void ExecuteAction();
147 : virtual void EndSourceFileAction();
148 :
149 : public:
150 : ASTMergeAction(FrontendAction *AdaptedAction,
151 : std::string *ASTFiles, unsigned NumASTFiles);
152 : virtual ~ASTMergeAction();
153 :
154 : virtual bool usesPreprocessorOnly() const;
155 : virtual bool usesCompleteTranslationUnit();
156 : virtual bool hasPCHSupport() const;
157 : virtual bool hasASTSupport() const;
158 : virtual bool hasCodeCompletionSupport() const;
159 : };
160 :
161 : //===----------------------------------------------------------------------===//
162 : // Code Gen AST Actions
163 : //===----------------------------------------------------------------------===//
164 :
0: branch 1 not taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
0: branch 9 not taken
626: branch 10 taken
165 626: class CodeGenAction : public ASTFrontendAction {
166 : private:
167 : unsigned Act;
168 :
169 : protected:
170 : CodeGenAction(unsigned _Act);
171 :
172 : virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
173 : llvm::StringRef InFile);
174 : };
175 :
57: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
176 57: class EmitAssemblyAction : public CodeGenAction {
177 : public:
178 : EmitAssemblyAction();
179 : };
180 :
18: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
181 18: class EmitBCAction : public CodeGenAction {
182 : public:
183 : EmitBCAction();
184 : };
185 :
516: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
186 516: class EmitLLVMAction : public CodeGenAction {
187 : public:
188 : EmitLLVMAction();
189 : };
190 :
35: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
191 35: class EmitLLVMOnlyAction : public CodeGenAction {
192 : public:
193 : EmitLLVMOnlyAction();
194 : };
195 :
0: branch 1 not taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
196 0: class EmitObjAction : public CodeGenAction {
197 : public:
198 : EmitObjAction();
199 : };
200 :
201 : //===----------------------------------------------------------------------===//
202 : // Preprocessor Actions
203 : //===----------------------------------------------------------------------===//
204 :
0: branch 1 not taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
205 0: class DumpRawTokensAction : public PreprocessorFrontendAction {
206 : protected:
207 : void ExecuteAction();
208 : };
209 :
3: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
210 6: class DumpTokensAction : public PreprocessorFrontendAction {
211 : protected:
212 : void ExecuteAction();
213 : };
214 :
1: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
215 2: class GeneratePTHAction : public PreprocessorFrontendAction {
216 : protected:
217 : void ExecuteAction();
218 : };
219 :
13: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
220 26: class ParseOnlyAction : public PreprocessorFrontendAction {
221 : protected:
222 : void ExecuteAction();
223 : };
224 :
18: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
225 36: class PreprocessOnlyAction : public PreprocessorFrontendAction {
226 : protected:
227 : void ExecuteAction();
228 : };
229 :
2: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
230 4: class PrintParseAction : public PreprocessorFrontendAction {
231 : protected:
232 : void ExecuteAction();
233 : };
234 :
245: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
235 490: class PrintPreprocessedAction : public PreprocessorFrontendAction {
236 : protected:
237 : void ExecuteAction();
238 :
239 0: virtual bool hasPCHSupport() const { return true; }
240 : };
241 :
1: branch 1 taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
242 2: class RewriteMacrosAction : public PreprocessorFrontendAction {
243 : protected:
244 : void ExecuteAction();
245 : };
246 :
0: branch 1 not taken
0: branch 2 not taken
0: branch 5 not taken
0: branch 6 not taken
247 0: class RewriteTestAction : public PreprocessorFrontendAction {
248 : protected:
249 : void ExecuteAction();
250 : };
251 :
252 : } // end namespace clang
253 :
254 : #endif
Generated: 2010-02-10 01:31 by zcov