-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmusic_context.h
67 lines (50 loc) · 1.51 KB
/
music_context.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
65
66
67
#ifndef MUSIC_CONTEXT_H_
#define MUSIC_CONTEXT_H_
#include <vector>
#include <string>
#include <utility>
#include <map>
#include "clang/Frontend/CompilerInstance.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/ASTContext.h"
#include "configuration.h"
#include "symbol_table.h"
#include "stmt_context.h"
#include "mutant_database.h"
typedef std::vector<std::string> ScalarReferenceNameList;
// Block scope are bounded by curly braces {}.
// The closer the scope is to the end_loc of vector, the smaller it is.
// ScopeRangeList = {scope1, scope2, scope3, ...}
// {...scope1
// {...scope2
// {...scope3
// }
// }
// }
class MusicContext
{
public:
clang::CompilerInstance *comp_inst_;
LabelStmtToGotoStmtListMap *label_to_gotolist_map_;
SwitchStmtInfoList *switchstmt_info_list_;
ScalarReferenceNameList *non_VTWD_mutatable_scalarref_list_;
ScopeRangeList *scope_list_;
MutantDatabase &mutant_database_;
MusicContext(
clang::CompilerInstance *CI, Configuration *config,
LabelStmtToGotoStmtListMap *label_map,
SymbolTable* symbol_table, MutantDatabase &mutant_database);
bool IsRangeInMutationRange(clang::SourceRange range);
int getFunctionId();
SymbolTable* getSymbolTable();
StmtContext& getStmtContext();
Configuration* getConfiguration() const;
void IncrementFunctionId();
private:
int function_id_;
SymbolTable *symbol_table_;
StmtContext stmt_context_;
Configuration *config_;
};
#endif // MUSIC_CONTEXT_H_