forked from Ericsson/CodeCompass
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathppincludecallback.h
More file actions
68 lines (54 loc) · 1.58 KB
/
ppincludecallback.h
File metadata and controls
68 lines (54 loc) · 1.58 KB
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
68
#ifndef CC_PARSER_PPINCLUDECALLBACK_H
#define CC_PARSER_PPINCLUDECALLBACK_H
#include <clang/Lex/PPCallbacks.h>
#include <clang/Lex/Preprocessor.h>
#include <clang/AST/ASTContext.h>
#include <model/cppastnode.h>
#include <model/cppastnode-odb.hxx>
#include <model/cppheaderinclusion.h>
#include <model/cppheaderinclusion-odb.hxx>
#include <parser/parsercontext.h>
#include <util/logutil.h>
#include "entitycache.h"
namespace cc
{
namespace parser
{
class PPIncludeCallback : public clang::PPCallbacks
{
public:
PPIncludeCallback(
ParserContext& ctx_,
clang::ASTContext& astContext_,
EntityCache& entityCache_,
clang::Preprocessor& pp_);
~PPIncludeCallback();
virtual void InclusionDirective(
clang::SourceLocation HashLoc,
const clang::Token &IncludeTok,
clang::StringRef FileName,
bool IsAngled,
clang::CharSourceRange FilenameRange,
clang::Optional<clang::FileEntryRef> File,
clang::StringRef SearchPath,
clang::StringRef RelativePath,
const clang::Module *Imported,
clang::SrcMgr::CharacteristicKind FileType) override;
private:
/**
* This function creates an AST Node from a file.
*/
model::CppAstNodePtr createFileAstNode(
const model::FilePtr& file_,
const clang::SourceRange& srcRange_);
ParserContext& _ctx;
const std::string _cppSourceType;
const clang::SourceManager& _clangSrcMgr;
FileLocUtil _fileLocUtil;
EntityCache& _entityCache;
std::vector<model::CppAstNodePtr> _astNodes;
std::vector<model::CppHeaderInclusionPtr> _headerIncs;
};
} // parser
} // cc
#endif // CC_PARSER_PPINCLUDECALLBACK_H