Lines Matching full:clang

5 // This implements a Clang tool to generate compilation information that is
6 // sufficient to recompile the code with clang. For each compilation unit, all
20 #include "clang/Basic/Diagnostic.h"
21 #include "clang/Basic/FileManager.h"
22 #include "clang/Basic/SourceManager.h"
23 #include "clang/Frontend/CompilerInstance.h"
24 #include "clang/Frontend/FrontendActions.h"
25 #include "clang/Lex/HeaderSearchOptions.h"
26 #include "clang/Lex/PPCallbacks.h"
27 #include "clang/Lex/Preprocessor.h"
28 #include "clang/Tooling/CommonOptionsParser.h"
29 #include "clang/Tooling/CompilationDatabase.h"
30 #include "clang/Tooling/Refactoring.h"
31 #include "clang/Tooling/Tooling.h"
37 using clang::HeaderSearchOptions;
38 using clang::tooling::CommonOptionsParser;
48 class IncludeFinderPPCallbacks : public clang::PPCallbacks {
50 IncludeFinderPPCallbacks(clang::SourceManager* source_manager,
54 void FileChanged(clang::SourceLocation /*loc*/,
55 clang::PPCallbacks::FileChangeReason reason,
56 clang::SrcMgr::CharacteristicKind /*file_type*/,
57 clang::FileID /*prev_fid*/) override;
59 void InclusionDirective(clang::SourceLocation hash_loc,
60 const clang::Token& include_tok,
63 clang::CharSourceRange range,
64 const clang::FileEntry* file,
67 const clang::Module* imported,
68 clang::SrcMgr::CharacteristicKind /*file_type*/
76 clang::SourceManager* const source_manager_;
88 clang::SourceManager* source_manager, in IncludeFinderPPCallbacks()
105 case clang::frontend::System: in IncludeFinderPPCallbacks()
106 case clang::frontend::ExternCSystem: in IncludeFinderPPCallbacks()
107 case clang::frontend::CSystem: in IncludeFinderPPCallbacks()
108 case clang::frontend::CXXSystem: in IncludeFinderPPCallbacks()
109 case clang::frontend::ObjCSystem: in IncludeFinderPPCallbacks()
110 case clang::frontend::ObjCXXSystem: in IncludeFinderPPCallbacks()
111 case clang::frontend::After: in IncludeFinderPPCallbacks()
121 clang::SourceLocation /*loc*/, in FileChanged()
122 clang::PPCallbacks::FileChangeReason reason, in FileChanged()
123 clang::SrcMgr::CharacteristicKind /*file_type*/, in FileChanged()
124 clang::FileID /*prev_fid*/) { in FileChanged()
125 if (reason == clang::PPCallbacks::EnterFile) { in FileChanged()
144 clang::SourceLocation hash_loc, in InclusionDirective()
145 const clang::Token& include_tok, in InclusionDirective()
148 clang::CharSourceRange range, in InclusionDirective()
149 const clang::FileEntry* file, in InclusionDirective()
152 const clang::Module* imported, in InclusionDirective()
153 clang::SrcMgr::CharacteristicKind /*file_type*/ in InclusionDirective()
159 const clang::DirectoryEntry* const search_path_entry = in InclusionDirective()
161 const clang::DirectoryEntry* const current_file_parent_entry = in InclusionDirective()
208 const clang::FileEntry* main_file = in EndOfMainFile()
220 class CompilationIndexerAction : public clang::PreprocessorFrontendAction {
232 // Set up the state extracted during the compilation, and run Clang over the
235 // Maps file names to their contents as read by Clang's source manager.
240 vector<clang::FrontendInputFile> inputs = in ExecuteAction()
249 clang::Preprocessor& preprocessor = getCompilerInstance().getPreprocessor(); in Preprocess()
258 clang::Token token; in Preprocess()
261 } while (token.isNot(clang::tok::eof)); in Preprocess()
277 std::unique_ptr<clang::tooling::FrontendActionFactory> frontend_factory = in main()
278 clang::tooling::newFrontendActionFactory<CompilationIndexerAction>(); in main()
279 clang::tooling::ClangTool tool(options.getCompilations(), in main()