1 // Copyright (C) 2017 The Android Open Source Project
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //      http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef AST_UTIL_H_
16 #define AST_UTIL_H_
17 
18 #include "utils/source_path_utils.h"
19 
20 #include <clang/AST/AST.h>
21 #include <clang/AST/Type.h>
22 
23 #include <llvm/ADT/DenseSet.h>
24 
25 #include <map>
26 #include <string>
27 
28 
29 namespace header_checker {
30 namespace dumper {
31 
32 
33 struct ASTCaches {
ASTCachesASTCaches34   ASTCaches(const std::string &translation_unit_source,
35             const utils::RootDirs &root_dirs)
36       : translation_unit_source_(translation_unit_source),
37         root_dirs_(root_dirs) {}
38 
39   std::string translation_unit_source_;
40   const utils::RootDirs &root_dirs_;
41   std::map<const clang::Decl *, std::string> decl_to_source_file_cache_;
42 
43   llvm::DenseSet<clang::QualType> converted_qual_types_;
44 };
45 
46 
47 }  // namespace dumper
48 }  // namespace header_checker
49 
50 
51 #endif  // AST_UTIL_H_
52