clang-tools  7.0.0
CanonicalIncludes.cpp
Go to the documentation of this file.
1 //===-- CanonicalIncludes.h - remap #inclue headers--------------*- 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 #include "CanonicalIncludes.h"
11 #include "../Headers.h"
12 #include "clang/Driver/Types.h"
13 #include "llvm/Support/Regex.h"
14 
15 namespace clang {
16 namespace clangd {
17 namespace {
18 const char IWYUPragma[] = "// IWYU pragma: private, include ";
19 } // namespace
20 
21 void CanonicalIncludes::addMapping(llvm::StringRef Path,
22  llvm::StringRef CanonicalPath) {
23  addRegexMapping((llvm::Twine("^") + llvm::Regex::escape(Path) + "$").str(),
24  CanonicalPath);
25 }
26 
27 void CanonicalIncludes::addRegexMapping(llvm::StringRef RE,
28  llvm::StringRef CanonicalPath) {
29  this->RegexHeaderMappingTable.emplace_back(llvm::Regex(RE), CanonicalPath);
30 }
31 
32 void CanonicalIncludes::addSymbolMapping(llvm::StringRef QualifiedName,
33  llvm::StringRef CanonicalPath) {
34  this->SymbolMapping[QualifiedName] = CanonicalPath;
35 }
36 
37 llvm::StringRef
38 CanonicalIncludes::mapHeader(llvm::ArrayRef<std::string> Headers,
39  llvm::StringRef QualifiedName) const {
40  assert(!Headers.empty());
41  auto SE = SymbolMapping.find(QualifiedName);
42  if (SE != SymbolMapping.end())
43  return SE->second;
44  std::lock_guard<std::mutex> Lock(RegexMutex);
45  // Find the first header such that the extension is not '.inc', and isn't a
46  // recognized non-header file
47  auto I =
48  std::find_if(Headers.begin(), Headers.end(), [](llvm::StringRef Include) {
49  // Skip .inc file whose including header file should
50  // be #included instead.
51  return !Include.endswith(".inc");
52  });
53  if (I == Headers.end())
54  return Headers[0]; // Fallback to the declaring header.
55  StringRef Header = *I;
56  // If Header is not expected be included (e.g. .cc file), we fall back to
57  // the declaring header.
58  StringRef Ext = llvm::sys::path::extension(Header).trim('.');
59  // Include-able headers must have precompile type. Treat files with
60  // non-recognized extenstions (TY_INVALID) as headers.
61  auto ExtType = driver::types::lookupTypeForExtension(Ext);
62  if ((ExtType != driver::types::TY_INVALID) &&
63  !driver::types::onlyPrecompileType(ExtType))
64  return Headers[0];
65  for (auto &Entry : RegexHeaderMappingTable) {
66 #ifndef NDEBUG
67  std::string Dummy;
68  assert(Entry.first.isValid(Dummy) && "Regex should never be invalid!");
69 #endif
70  if (Entry.first.match(Header))
71  return Entry.second;
72  }
73  return Header;
74 }
75 
76 std::unique_ptr<CommentHandler>
78  class PragmaCommentHandler : public clang::CommentHandler {
79  public:
80  PragmaCommentHandler(CanonicalIncludes *Includes) : Includes(Includes) {}
81 
82  bool HandleComment(Preprocessor &PP, SourceRange Range) override {
83  StringRef Text =
84  Lexer::getSourceText(CharSourceRange::getCharRange(Range),
85  PP.getSourceManager(), PP.getLangOpts());
86  if (!Text.consume_front(IWYUPragma))
87  return false;
88  // FIXME(ioeric): resolve the header and store actual file path. For now,
89  // we simply assume the written header is suitable to be #included.
90  Includes->addMapping(PP.getSourceManager().getFilename(Range.getBegin()),
91  isLiteralInclude(Text) ? Text.str()
92  : ("\"" + Text + "\"").str());
93  return false;
94  }
95 
96  private:
97  CanonicalIncludes *const Includes;
98  };
99  return llvm::make_unique<PragmaCommentHandler>(Includes);
100 }
101 
103  static const std::vector<std::pair<const char *, const char *>> SymbolMap = {
104  {"std::addressof", "<memory>"},
105  // Map symbols in <iosfwd> to their preferred includes.
106  {"std::basic_filebuf", "<fstream>"},
107  {"std::basic_fstream", "<fstream>"},
108  {"std::basic_ifstream", "<fstream>"},
109  {"std::basic_ofstream", "<fstream>"},
110  {"std::filebuf", "<fstream>"},
111  {"std::fstream", "<fstream>"},
112  {"std::ifstream", "<fstream>"},
113  {"std::ofstream", "<fstream>"},
114  {"std::wfilebuf", "<fstream>"},
115  {"std::wfstream", "<fstream>"},
116  {"std::wifstream", "<fstream>"},
117  {"std::wofstream", "<fstream>"},
118  {"std::basic_ios", "<ios>"},
119  {"std::ios", "<ios>"},
120  {"std::wios", "<ios>"},
121  {"std::basic_iostream", "<iostream>"},
122  {"std::iostream", "<iostream>"},
123  {"std::wiostream", "<iostream>"},
124  {"std::basic_istream", "<istream>"},
125  {"std::istream", "<istream>"},
126  {"std::wistream", "<istream>"},
127  {"std::istreambuf_iterator", "<iterator>"},
128  {"std::ostreambuf_iterator", "<iterator>"},
129  {"std::basic_ostream", "<ostream>"},
130  {"std::ostream", "<ostream>"},
131  {"std::wostream", "<ostream>"},
132  {"std::basic_istringstream", "<sstream>"},
133  {"std::basic_ostringstream", "<sstream>"},
134  {"std::basic_stringbuf", "<sstream>"},
135  {"std::basic_stringstream", "<sstream>"},
136  {"std::istringstream", "<sstream>"},
137  {"std::ostringstream", "<sstream>"},
138  {"std::stringbuf", "<sstream>"},
139  {"std::stringstream", "<sstream>"},
140  {"std::wistringstream", "<sstream>"},
141  {"std::wostringstream", "<sstream>"},
142  {"std::wstringbuf", "<sstream>"},
143  {"std::wstringstream", "<sstream>"},
144  {"std::basic_streambuf", "<streambuf>"},
145  {"std::streambuf", "<streambuf>"},
146  {"std::wstreambuf", "<streambuf>"},
147  {"std::uint_least16_t", "<cstdint>"}, // <type_traits> redeclares these
148  {"std::uint_least32_t", "<cstdint>"},
149  {"std::declval", "<utility>"},
150  };
151  for (const auto &Pair : SymbolMap)
152  Includes->addSymbolMapping(Pair.first, Pair.second);
153 
154  static const std::vector<std::pair<const char *, const char *>>
155  SystemHeaderMap = {
156  {"include/__stddef_max_align_t.h$", "<cstddef>"},
157  {"include/__wmmintrin_aes.h$", "<wmmintrin.h>"},
158  {"include/__wmmintrin_pclmul.h$", "<wmmintrin.h>"},
159  {"include/adxintrin.h$", "<immintrin.h>"},
160  {"include/ammintrin.h$", "<ammintrin.h>"},
161  {"include/avx2intrin.h$", "<immintrin.h>"},
162  {"include/avx512bwintrin.h$", "<immintrin.h>"},
163  {"include/avx512cdintrin.h$", "<immintrin.h>"},
164  {"include/avx512dqintrin.h$", "<immintrin.h>"},
165  {"include/avx512erintrin.h$", "<immintrin.h>"},
166  {"include/avx512fintrin.h$", "<immintrin.h>"},
167  {"include/avx512ifmaintrin.h$", "<immintrin.h>"},
168  {"include/avx512ifmavlintrin.h$", "<immintrin.h>"},
169  {"include/avx512pfintrin.h$", "<immintrin.h>"},
170  {"include/avx512vbmiintrin.h$", "<immintrin.h>"},
171  {"include/avx512vbmivlintrin.h$", "<immintrin.h>"},
172  {"include/avx512vlbwintrin.h$", "<immintrin.h>"},
173  {"include/avx512vlcdintrin.h$", "<immintrin.h>"},
174  {"include/avx512vldqintrin.h$", "<immintrin.h>"},
175  {"include/avx512vlintrin.h$", "<immintrin.h>"},
176  {"include/avxintrin.h$", "<immintrin.h>"},
177  {"include/bmi2intrin.h$", "<x86intrin.h>"},
178  {"include/bmiintrin.h$", "<x86intrin.h>"},
179  {"include/emmintrin.h$", "<emmintrin.h>"},
180  {"include/f16cintrin.h$", "<emmintrin.h>"},
181  {"include/float.h$", "<cfloat>"},
182  {"include/fma4intrin.h$", "<x86intrin.h>"},
183  {"include/fmaintrin.h$", "<immintrin.h>"},
184  {"include/fxsrintrin.h$", "<immintrin.h>"},
185  {"include/ia32intrin.h$", "<x86intrin.h>"},
186  {"include/immintrin.h$", "<immintrin.h>"},
187  {"include/inttypes.h$", "<cinttypes>"},
188  {"include/limits.h$", "<climits>"},
189  {"include/lzcntintrin.h$", "<x86intrin.h>"},
190  {"include/mm3dnow.h$", "<mm3dnow.h>"},
191  {"include/mm_malloc.h$", "<mm_malloc.h>"},
192  {"include/mmintrin.h$", "<mmintrin>"},
193  {"include/mwaitxintrin.h$", "<x86intrin.h>"},
194  {"include/pkuintrin.h$", "<immintrin.h>"},
195  {"include/pmmintrin.h$", "<pmmintrin.h>"},
196  {"include/popcntintrin.h$", "<popcntintrin.h>"},
197  {"include/prfchwintrin.h$", "<x86intrin.h>"},
198  {"include/rdseedintrin.h$", "<x86intrin.h>"},
199  {"include/rtmintrin.h$", "<immintrin.h>"},
200  {"include/shaintrin.h$", "<immintrin.h>"},
201  {"include/smmintrin.h$", "<smmintrin.h>"},
202  {"include/stdalign.h$", "<cstdalign>"},
203  {"include/stdarg.h$", "<cstdarg>"},
204  {"include/stdbool.h$", "<cstdbool>"},
205  {"include/stddef.h$", "<cstddef>"},
206  {"include/stdint.h$", "<cstdint>"},
207  {"include/tbmintrin.h$", "<x86intrin.h>"},
208  {"include/tmmintrin.h$", "<tmmintrin.h>"},
209  {"include/wmmintrin.h$", "<wmmintrin.h>"},
210  {"include/x86intrin.h$", "<x86intrin.h>"},
211  {"include/xmmintrin.h$", "<xmmintrin.h>"},
212  {"include/xopintrin.h$", "<x86intrin.h>"},
213  {"include/xsavecintrin.h$", "<immintrin.h>"},
214  {"include/xsaveintrin.h$", "<immintrin.h>"},
215  {"include/xsaveoptintrin.h$", "<immintrin.h>"},
216  {"include/xsavesintrin.h$", "<immintrin.h>"},
217  {"include/xtestintrin.h$", "<immintrin.h>"},
218  {"include/_G_config.h$", "<cstdio>"},
219  {"include/assert.h$", "<cassert>"},
220  {"algorithm$", "<algorithm>"},
221  {"valarray$", "<valarray>"},
222  {"array$", "<array>"},
223  {"atomic$", "<atomic>"},
224  {"backward/auto_ptr.h$", "<memory>"},
225  {"backward/binders.h$", "<string>"},
226  {"bits/algorithmfwd.h$", "<algorithm>"},
227  {"bits/alloc_traits.h$", "<memory>"},
228  {"bits/allocated_ptr.h$", "<memory>"},
229  {"bits/allocator.h$", "<allocator>"},
230  {"bits/atomic_base.h$", "<atomic>"},
231  {"bits/atomic_lockfree_defines.h$", "<exception>"},
232  {"bits/atomic_futex.h$", "<atomic>"},
233  {"bits/basic_ios.h$", "<ios>"},
234  {"bits/basic_ios.tcc$", "<ios>"},
235  {"bits/basic_string.h$", "<string>"},
236  {"bits/basic_string.tcc$", "<string>"},
237  {"bits/char_traits.h$", "<string>"},
238  {"bits/codecvt.h$", "<locale>"},
239  {"bits/concept_check.h$", "<numeric>"},
240  {"bits/cpp_type_traits.h$", "<cmath>"},
241  {"bits/cxxabi_forced.h$", "<cxxabi.h>"},
242  {"bits/deque.tcc$", "<deque>"},
243  {"bits/exception.h$", "<exception>"},
244  {"bits/exception_defines.h$", "<exception>"},
245  {"bits/exception_ptr.h$", "<exception>"},
246  {"bits/forward_list.h$", "<forward_list>"},
247  {"bits/forward_list.tcc$", "<forward_list>"},
248  {"bits/fstream.tcc$", "<fstream>"},
249  {"bits/functexcept.h$", "<list>"},
250  {"bits/functional_hash.h$", "<functional>"},
251  {"bits/gslice.h$", "<valarray>"},
252  {"bits/gslice_array.h$", "<valarray>"},
253  {"bits/hash_bytes.h$", "<typeinfo>"},
254  {"bits/hashtable.h$", "<unordered_set>"},
255  {"bits/hashtable_policy.h$", "<unordered_set>"},
256  {"bits/indirect_array.h$", "<valarray>"},
257  {"bits/invoke.h$", "<functional>"},
258  {"bits/ios_base.h$", "<ios>"},
259  {"bits/istream.tcc$", "<istream>"},
260  {"bits/list.tcc$", "<list>"},
261  {"bits/locale_classes.h$", "<locale>"},
262  {"bits/locale_classes.tcc$", "<locale>"},
263  {"bits/locale_conv.h$", "<locale>"},
264  {"bits/locale_facets.h$", "<locale>"},
265  {"bits/locale_facets.tcc$", "<locale>"},
266  {"bits/locale_facets_nonio.h$", "<locale>"},
267  {"bits/locale_facets_nonio.tcc$", "<locale>"},
268  {"bits/localefwd.h$", "<locale>"},
269  {"bits/mask_array.h$", "<valarray>"},
270  {"bits/memoryfwd.h$", "<memory>"},
271  {"bits/move.h$", "<utility>"},
272  {"bits/nested_exception.h$", "<exception>"},
273  {"bits/ostream.tcc$", "<ostream>"},
274  {"bits/ostream_insert.h$", "<ostream>"},
275  {"bits/parse_numbers.h$", "<chrono>"},
276  {"bits/postypes.h$", "<ios>"},
277  {"bits/predefined_ops.h$", "<algorithm>"},
278  {"bits/ptr_traits.h$", "<memory>"},
279  {"bits/quoted_string.h$", "<iomanip>"},
280  {"bits/random.h$", "<random>"},
281  {"bits/random.tcc$", "<random>"},
282  {"bits/range_access.h$", "<iterator>"},
283  {"bits/refwrap.h$", "<functional>"},
284  {"bits/regex.h$", "<regex>"},
285  {"bits/regex_automaton.h$", "<regex>"},
286  {"bits/regex_compiler.h$", "<regex>"},
287  {"bits/regex_constants.h$", "<regex>"},
288  {"bits/regex_cursor.h$", "<regex>"},
289  {"bits/regex_error.h$", "<regex>"},
290  {"bits/regex_executor.h$", "<regex>"},
291  {"bits/regex_grep_matcher.h$", "<regex>"},
292  {"bits/regex_grep_matcher.tcc$", "<regex>"},
293  {"bits/regex_nfa.h$", "<regex>"},
294  {"bits/regex_scanner.h$", "<regex>"},
295  {"bits/shared_ptr.h$", "<memory>"},
296  {"bits/shared_ptr_base.h$", "<memory>"},
297  {"bits/shared_ptr_atomic.h$", "<atomic>"},
298  {"bits/slice_array.h$", "<valarray>"},
299  {"bits/sstream.tcc$", "<sstream>"},
300  {"bits/std_abs.h$", "<cmath>"},
301  {"bits/std_function.h$", "<functional>"},
302  {"bits/std_mutex.h$", "<mutex>"},
303  {"bits/stl_algo.h$", "<algorithm>"},
304  {"bits/stl_algobase.h$", "<algorithm>"},
305  {"bits/stl_bvector.h$", "<vector>"},
306  {"bits/stl_construct.h$", "<deque>"},
307  {"bits/stl_deque.h$", "<deque>"},
308  {"bits/stl_function.h$", "<functional>"},
309  {"bits/stl_heap.h$", "<heap>"},
310  {"bits/stl_iterator.h$", "<iterator>"},
311  {"bits/stl_iterator_base_funcs.h$", "<iterator>"},
312  {"bits/stl_iterator_base_types.h$", "<iterator>"},
313  {"bits/stl_list.h$", "<list>"},
314  {"bits/stl_map.h$", "<map>"},
315  {"bits/stl_multimap.h$", "<map>"},
316  {"bits/stl_multiset.h$", "<set>"},
317  {"bits/stl_numeric.h$", "<numeric>"},
318  {"bits/stl_pair.h$", "<utility>"},
319  {"bits/stl_queue.h$", "<queue>"},
320  {"bits/stl_raw_storage_iter.h$", "<memory>"},
321  {"bits/stl_relops.h$", "<utility>"},
322  {"bits/stl_set.h$", "<set>"},
323  {"bits/stl_stack.h$", "<stack>"},
324  {"bits/stl_tempbuf.h$", "<memory>"},
325  {"bits/stl_tree.h$", "<map>"},
326  {"bits/stl_uninitialized.h$", "<memory>"},
327  {"bits/stl_vector.h$", "<vector>"},
328  {"bits/stream_iterator.h$", "<iterator>"},
329  {"bits/streambuf.tcc$", "<streambuf>"},
330  {"bits/streambuf_iterator.h$", "<iterator>"},
331  {"bits/stringfwd.h$", "<string>"},
332  {"bits/uniform_int_dist.h$", "<random>"},
333  {"bits/unique_ptr.h$", "<memory>"},
334  {"bits/unordered_map.h$", "<unordered_map>"},
335  {"bits/unordered_set.h$", "<unordered_set>"},
336  {"bits/uses_allocator.h$", "<memory>"},
337  {"bits/valarray_after.h$", "<valarray>"},
338  {"bits/valarray_array.h$", "<valarray>"},
339  {"bits/valarray_array.tcc$", "<valarray>"},
340  {"bits/valarray_before.h$", "<valarray>"},
341  {"bits/vector.tcc$", "<vector>"},
342  {"bitset$", "<bitset>"},
343  {"ccomplex$", "<ccomplex>"},
344  {"cctype$", "<cctype>"},
345  {"cerrno$", "<cerrno>"},
346  {"cfenv$", "<cfenv>"},
347  {"cfloat$", "<cfloat>"},
348  {"chrono$", "<chrono>"},
349  {"cinttypes$", "<cinttypes>"},
350  {"climits$", "<climits>"},
351  {"clocale$", "<clocale>"},
352  {"cmath$", "<cmath>"},
353  {"complex$", "<complex>"},
354  {"complex.h$", "<complex.h>"},
355  {"condition_variable$", "<condition_variable>"},
356  {"csetjmp$", "<csetjmp>"},
357  {"csignal$", "<csignal>"},
358  {"cstdalign$", "<cstdalign>"},
359  {"cstdarg$", "<cstdarg>"},
360  {"cstdbool$", "<cstdbool>"},
361  {"cstdint$", "<cstdint>"},
362  {"cstdio$", "<cstdio>"},
363  {"cstdlib$", "<cstdlib>"},
364  {"cstring$", "<cstring>"},
365  {"ctgmath$", "<ctgmath>"},
366  {"ctime$", "<ctime>"},
367  {"cwchar$", "<cwchar>"},
368  {"cwctype$", "<cwctype>"},
369  {"cxxabi.h$", "<cxxabi.h>"},
370  {"debug/debug.h$", "<numeric>"},
371  {"debug/map.h$", "<map>"},
372  {"debug/multimap.h$", "<multimap>"},
373  {"debug/multiset.h$", "<multiset>"},
374  {"debug/set.h$", "<set>"},
375  {"deque$", "<deque>"},
376  {"exception$", "<exception>"},
377  {"ext/alloc_traits.h$", "<deque>"},
378  {"ext/atomicity.h$", "<memory>"},
379  {"ext/concurrence.h$", "<memory>"},
380  {"ext/new_allocator.h$", "<string>"},
381  {"ext/numeric_traits.h$", "<list>"},
382  {"ext/string_conversions.h$", "<string>"},
383  {"ext/type_traits.h$", "<cmath>"},
384  {"fenv.h$", "<fenv.h>"},
385  {"forward_list$", "<forward_list>"},
386  {"fstream$", "<fstream>"},
387  {"functional$", "<functional>"},
388  {"future$", "<future>"},
389  {"initializer_list$", "<initializer_list>"},
390  {"iomanip$", "<iomanip>"},
391  {"ios$", "<ios>"},
392  {"iosfwd$", "<iosfwd>"},
393  {"iostream$", "<iostream>"},
394  {"istream$", "<istream>"},
395  {"iterator$", "<iterator>"},
396  {"limits$", "<limits>"},
397  {"list$", "<list>"},
398  {"locale$", "<locale>"},
399  {"map$", "<map>"},
400  {"memory$", "<memory>"},
401  {"shared_mutex$", "<shared_mutex>"},
402  {"mutex$", "<mutex>"},
403  {"new$", "<new>"},
404  {"numeric$", "<numeric>"},
405  {"ostream$", "<ostream>"},
406  {"queue$", "<queue>"},
407  {"random$", "<random>"},
408  {"ratio$", "<ratio>"},
409  {"regex$", "<regex>"},
410  {"scoped_allocator$", "<scoped_allocator>"},
411  {"set$", "<set>"},
412  {"sstream$", "<sstream>"},
413  {"stack$", "<stack>"},
414  {"stdexcept$", "<stdexcept>"},
415  {"streambuf$", "<streambuf>"},
416  {"string$", "<string>"},
417  {"system_error$", "<system_error>"},
418  {"tgmath.h$", "<tgmath.h>"},
419  {"thread$", "<thread>"},
420  {"tuple$", "<tuple>"},
421  {"type_traits$", "<type_traits>"},
422  {"typeindex$", "<typeindex>"},
423  {"typeinfo$", "<typeinfo>"},
424  {"unordered_map$", "<unordered_map>"},
425  {"unordered_set$", "<unordered_set>"},
426  {"utility$", "<utility>"},
427  {"valarray$", "<valarray>"},
428  {"vector$", "<vector>"},
429  {"include/complex.h$", "<complex.h>"},
430  {"include/ctype.h$", "<cctype>"},
431  {"include/errno.h$", "<cerrno>"},
432  {"include/fenv.h$", "<fenv.h>"},
433  {"include/inttypes.h$", "<cinttypes>"},
434  {"include/libio.h$", "<cstdio>"},
435  {"include/limits.h$", "<climits>"},
436  {"include/locale.h$", "<clocale>"},
437  {"include/math.h$", "<cmath>"},
438  {"include/setjmp.h$", "<csetjmp>"},
439  {"include/signal.h$", "<csignal>"},
440  {"include/stdint.h$", "<cstdint>"},
441  {"include/stdio.h$", "<cstdio>"},
442  {"include/stdlib.h$", "<cstdlib>"},
443  {"include/string.h$", "<cstring>"},
444  {"include/time.h$", "<ctime>"},
445  {"include/wchar.h$", "<cwchar>"},
446  {"include/wctype.h$", "<cwctype>"},
447  {"bits/cmathcalls.h$", "<complex.h>"},
448  {"bits/errno.h$", "<cerrno>"},
449  {"bits/fenv.h$", "<fenv.h>"},
450  {"bits/huge_val.h$", "<cmath>"},
451  {"bits/huge_valf.h$", "<cmath>"},
452  {"bits/huge_vall.h$", "<cmath>"},
453  {"bits/inf.h$", "<cmath>"},
454  {"bits/local_lim.h$", "<climits>"},
455  {"bits/locale.h$", "<clocale>"},
456  {"bits/mathcalls.h$", "<math.h>"},
457  {"bits/mathdef.h$", "<cmath>"},
458  {"bits/nan.h$", "<cmath>"},
459  {"bits/posix1_lim.h$", "<climits>"},
460  {"bits/posix2_lim.h$", "<climits>"},
461  {"bits/setjmp.h$", "<csetjmp>"},
462  {"bits/sigaction.h$", "<csignal>"},
463  {"bits/sigcontext.h$", "<csignal>"},
464  {"bits/siginfo.h$", "<csignal>"},
465  {"bits/signum.h$", "<csignal>"},
466  {"bits/sigset.h$", "<csignal>"},
467  {"bits/sigstack.h$", "<csignal>"},
468  {"bits/stdio_lim.h$", "<cstdio>"},
469  {"bits/sys_errlist.h$", "<cstdio>"},
470  {"bits/time.h$", "<ctime>"},
471  {"bits/timex.h$", "<ctime>"},
472  {"bits/typesizes.h$", "<cstdio>"},
473  {"bits/wchar.h$", "<cwchar>"},
474  {"bits/wordsize.h$", "<csetjmp>"},
475  {"bits/xopen_lim.h$", "<climits>"},
476  {"include/xlocale.h$", "<cstring>"},
477  {"bits/atomic_word.h$", "<memory>"},
478  {"bits/basic_file.h$", "<fstream>"},
479  {"bits/c\\+\\+allocator.h$", "<string>"},
480  {"bits/c\\+\\+config.h$", "<cstddef>"},
481  {"bits/c\\+\\+io.h$", "<ios>"},
482  {"bits/c\\+\\+locale.h$", "<locale>"},
483  {"bits/cpu_defines.h$", "<iosfwd>"},
484  {"bits/ctype_base.h$", "<locale>"},
485  {"bits/cxxabi_tweaks.h$", "<cxxabi.h>"},
486  {"bits/error_constants.h$", "<system_error>"},
487  {"bits/gthr-default.h$", "<memory>"},
488  {"bits/gthr.h$", "<memory>"},
489  {"bits/opt_random.h$", "<random>"},
490  {"bits/os_defines.h$", "<iosfwd>"},
491  // GNU C headers
492  {"include/aio.h$", "<aio.h>"},
493  {"include/aliases.h$", "<aliases.h>"},
494  {"include/alloca.h$", "<alloca.h>"},
495  {"include/ar.h$", "<ar.h>"},
496  {"include/argp.h$", "<argp.h>"},
497  {"include/argz.h$", "<argz.h>"},
498  {"include/arpa/nameser.h$", "<resolv.h>"},
499  {"include/arpa/nameser_compat.h$", "<resolv.h>"},
500  {"include/byteswap.h$", "<byteswap.h>"},
501  {"include/cpio.h$", "<cpio.h>"},
502  {"include/crypt.h$", "<crypt.h>"},
503  {"include/dirent.h$", "<dirent.h>"},
504  {"include/dlfcn.h$", "<dlfcn.h>"},
505  {"include/elf.h$", "<elf.h>"},
506  {"include/endian.h$", "<endian.h>"},
507  {"include/envz.h$", "<envz.h>"},
508  {"include/err.h$", "<err.h>"},
509  {"include/error.h$", "<error.h>"},
510  {"include/execinfo.h$", "<execinfo.h>"},
511  {"include/fcntl.h$", "<fcntl.h>"},
512  {"include/features.h$", "<features.h>"},
513  {"include/fenv.h$", "<fenv.h>"},
514  {"include/fmtmsg.h$", "<fmtmsg.h>"},
515  {"include/fnmatch.h$", "<fnmatch.h>"},
516  {"include/fstab.h$", "<fstab.h>"},
517  {"include/fts.h$", "<fts.h>"},
518  {"include/ftw.h$", "<ftw.h>"},
519  {"include/gconv.h$", "<gconv.h>"},
520  {"include/getopt.h$", "<getopt.h>"},
521  {"include/glob.h$", "<glob.h>"},
522  {"include/grp.h$", "<grp.h>"},
523  {"include/gshadow.h$", "<gshadow.h>"},
524  {"include/iconv.h$", "<iconv.h>"},
525  {"include/ifaddrs.h$", "<ifaddrs.h>"},
526  {"include/kdb.h$", "<kdb.h>"},
527  {"include/langinfo.h$", "<langinfo.h>"},
528  {"include/libgen.h$", "<libgen.h>"},
529  {"include/libintl.h$", "<libintl.h>"},
530  {"include/link.h$", "<link.h>"},
531  {"include/malloc.h$", "<malloc.h>"},
532  {"include/mcheck.h$", "<mcheck.h>"},
533  {"include/memory.h$", "<memory.h>"},
534  {"include/mntent.h$", "<mntent.h>"},
535  {"include/monetary.h$", "<monetary.h>"},
536  {"include/mqueue.h$", "<mqueue.h>"},
537  {"include/netdb.h$", "<netdb.h>"},
538  {"include/netinet/in.h$", "<netinet/in.h>"},
539  {"include/nl_types.h$", "<nl_types.h>"},
540  {"include/nss.h$", "<nss.h>"},
541  {"include/obstack.h$", "<obstack.h>"},
542  {"include/panel.h$", "<panel.h>"},
543  {"include/paths.h$", "<paths.h>"},
544  {"include/printf.h$", "<printf.h>"},
545  {"include/profile.h$", "<profile.h>"},
546  {"include/pthread.h$", "<pthread.h>"},
547  {"include/pty.h$", "<pty.h>"},
548  {"include/pwd.h$", "<pwd.h>"},
549  {"include/re_comp.h$", "<re_comp.h>"},
550  {"include/regex.h$", "<regex.h>"},
551  {"include/regexp.h$", "<regexp.h>"},
552  {"include/resolv.h$", "<resolv.h>"},
553  {"include/rpc/netdb.h$", "<netdb.h>"},
554  {"include/sched.h$", "<sched.h>"},
555  {"include/search.h$", "<search.h>"},
556  {"include/semaphore.h$", "<semaphore.h>"},
557  {"include/sgtty.h$", "<sgtty.h>"},
558  {"include/shadow.h$", "<shadow.h>"},
559  {"include/spawn.h$", "<spawn.h>"},
560  {"include/stab.h$", "<stab.h>"},
561  {"include/stdc-predef.h$", "<stdc-predef.h>"},
562  {"include/stdio_ext.h$", "<stdio_ext.h>"},
563  {"include/strings.h$", "<strings.h>"},
564  {"include/stropts.h$", "<stropts.h>"},
565  {"include/sudo_plugin.h$", "<sudo_plugin.h>"},
566  {"include/sysexits.h$", "<sysexits.h>"},
567  {"include/tar.h$", "<tar.h>"},
568  {"include/tcpd.h$", "<tcpd.h>"},
569  {"include/term.h$", "<term.h>"},
570  {"include/term_entry.h$", "<term_entry.h>"},
571  {"include/termcap.h$", "<termcap.h>"},
572  {"include/termios.h$", "<termios.h>"},
573  {"include/thread_db.h$", "<thread_db.h>"},
574  {"include/tic.h$", "<tic.h>"},
575  {"include/ttyent.h$", "<ttyent.h>"},
576  {"include/uchar.h$", "<uchar.h>"},
577  {"include/ucontext.h$", "<ucontext.h>"},
578  {"include/ulimit.h$", "<ulimit.h>"},
579  {"include/unctrl.h$", "<unctrl.h>"},
580  {"include/unistd.h$", "<unistd.h>"},
581  {"include/utime.h$", "<utime.h>"},
582  {"include/utmp.h$", "<utmp.h>"},
583  {"include/utmpx.h$", "<utmpx.h>"},
584  {"include/values.h$", "<values.h>"},
585  {"include/wordexp.h$", "<wordexp.h>"},
586  {"fpu_control.h$", "<fpu_control.h>"},
587  {"ieee754.h$", "<ieee754.h>"},
588  {"include/xlocale.h$", "<xlocale.h>"},
589  {"gnu/lib-names.h$", "<gnu/lib-names.h>"},
590  {"gnu/libc-version.h$", "<gnu/libc-version.h>"},
591  {"gnu/option-groups.h$", "<gnu/option-groups.h>"},
592  {"gnu/stubs-32.h$", "<gnu/stubs-32.h>"},
593  {"gnu/stubs-64.h$", "<gnu/stubs-64.h>"},
594  {"gnu/stubs-x32.h$", "<gnu/stubs-x32.h>"},
595  {"include/rpc/auth_des.h$", "<rpc/auth_des.h>"},
596  {"include/rpc/rpc_msg.h$", "<rpc/rpc_msg.h>"},
597  {"include/rpc/pmap_clnt.h$", "<rpc/pmap_clnt.h>"},
598  {"include/rpc/rpc.h$", "<rpc/rpc.h>"},
599  {"include/rpc/types.h$", "<rpc/types.h>"},
600  {"include/rpc/auth_unix.h$", "<rpc/auth_unix.h>"},
601  {"include/rpc/key_prot.h$", "<rpc/key_prot.h>"},
602  {"include/rpc/pmap_prot.h$", "<rpc/pmap_prot.h>"},
603  {"include/rpc/auth.h$", "<rpc/auth.h>"},
604  {"include/rpc/svc_auth.h$", "<rpc/svc_auth.h>"},
605  {"include/rpc/xdr.h$", "<rpc/xdr.h>"},
606  {"include/rpc/pmap_rmt.h$", "<rpc/pmap_rmt.h>"},
607  {"include/rpc/des_crypt.h$", "<rpc/des_crypt.h>"},
608  {"include/rpc/svc.h$", "<rpc/svc.h>"},
609  {"include/rpc/rpc_des.h$", "<rpc/rpc_des.h>"},
610  {"include/rpc/clnt.h$", "<rpc/clnt.h>"},
611  {"include/scsi/scsi.h$", "<scsi/scsi.h>"},
612  {"include/scsi/sg.h$", "<scsi/sg.h>"},
613  {"include/scsi/scsi_ioctl.h$", "<scsi/scsi_ioctl>"},
614  {"include/netrose/rose.h$", "<netrose/rose.h>"},
615  {"include/nfs/nfs.h$", "<nfs/nfs.h>"},
616  {"include/netatalk/at.h$", "<netatalk/at.h>"},
617  {"include/netinet/ether.h$", "<netinet/ether.h>"},
618  {"include/netinet/icmp6.h$", "<netinet/icmp6.h>"},
619  {"include/netinet/if_ether.h$", "<netinet/if_ether.h>"},
620  {"include/netinet/if_fddi.h$", "<netinet/if_fddi.h>"},
621  {"include/netinet/if_tr.h$", "<netinet/if_tr.h>"},
622  {"include/netinet/igmp.h$", "<netinet/igmp.h>"},
623  {"include/netinet/in.h$", "<netinet/in.h>"},
624  {"include/netinet/in_systm.h$", "<netinet/in_systm.h>"},
625  {"include/netinet/ip.h$", "<netinet/ip.h>"},
626  {"include/netinet/ip6.h$", "<netinet/ip6.h>"},
627  {"include/netinet/ip_icmp.h$", "<netinet/ip_icmp.h>"},
628  {"include/netinet/tcp.h$", "<netinet/tcp.h>"},
629  {"include/netinet/udp.h$", "<netinet/udp.h>"},
630  {"include/netrom/netrom.h$", "<netrom/netrom.h>"},
631  {"include/protocols/routed.h$", "<protocols/routed.h>"},
632  {"include/protocols/rwhod.h$", "<protocols/rwhod.h>"},
633  {"include/protocols/talkd.h$", "<protocols/talkd.h>"},
634  {"include/protocols/timed.h$", "<protocols/timed.h>"},
635  {"include/rpcsvc/klm_prot.x$", "<rpcsvc/klm_prot.x>"},
636  {"include/rpcsvc/rstat.h$", "<rpcsvc/rstat.h>"},
637  {"include/rpcsvc/spray.x$", "<rpcsvc/spray.x>"},
638  {"include/rpcsvc/nlm_prot.x$", "<rpcsvc/nlm_prot.x>"},
639  {"include/rpcsvc/nis_callback.x$", "<rpcsvc/nis_callback.x>"},
640  {"include/rpcsvc/yp.h$", "<rpcsvc/yp.h>"},
641  {"include/rpcsvc/yp.x$", "<rpcsvc/yp.x>"},
642  {"include/rpcsvc/nfs_prot.h$", "<rpcsvc/nfs_prot.h>"},
643  {"include/rpcsvc/rex.h$", "<rpcsvc/rex.h>"},
644  {"include/rpcsvc/yppasswd.h$", "<rpcsvc/yppasswd.h>"},
645  {"include/rpcsvc/rex.x$", "<rpcsvc/rex.x>"},
646  {"include/rpcsvc/nis_tags.h$", "<rpcsvc/nis_tags.h>"},
647  {"include/rpcsvc/nis_callback.h$", "<rpcsvc/nis_callback.h>"},
648  {"include/rpcsvc/nfs_prot.x$", "<rpcsvc/nfs_prot.x>"},
649  {"include/rpcsvc/bootparam_prot.x$", "<rpcsvc/bootparam_prot.x>"},
650  {"include/rpcsvc/rusers.x$", "<rpcsvc/rusers.x>"},
651  {"include/rpcsvc/rquota.x$", "<rpcsvc/rquota.x>"},
652  {"include/rpcsvc/nis.h$", "<rpcsvc/nis.h>"},
653  {"include/rpcsvc/nislib.h$", "<rpcsvc/nislib.h>"},
654  {"include/rpcsvc/ypupd.h$", "<rpcsvc/ypupd.h>"},
655  {"include/rpcsvc/bootparam.h$", "<rpcsvc/bootparam.h>"},
656  {"include/rpcsvc/spray.h$", "<rpcsvc/spray.h>"},
657  {"include/rpcsvc/key_prot.h$", "<rpcsvc/key_prot.h>"},
658  {"include/rpcsvc/klm_prot.h$", "<rpcsvc/klm_prot.h>"},
659  {"include/rpcsvc/sm_inter.h$", "<rpcsvc/sm_inter.h>"},
660  {"include/rpcsvc/nlm_prot.h$", "<rpcsvc/nlm_prot.h>"},
661  {"include/rpcsvc/yp_prot.h$", "<rpcsvc/yp_prot.h>"},
662  {"include/rpcsvc/ypclnt.h$", "<rpcsvc/ypclnt.h>"},
663  {"include/rpcsvc/rstat.x$", "<rpcsvc/rstat.x>"},
664  {"include/rpcsvc/rusers.h$", "<rpcsvc/rusers.h>"},
665  {"include/rpcsvc/key_prot.x$", "<rpcsvc/key_prot.x>"},
666  {"include/rpcsvc/sm_inter.x$", "<rpcsvc/sm_inter.x>"},
667  {"include/rpcsvc/rquota.h$", "<rpcsvc/rquota.h>"},
668  {"include/rpcsvc/nis.x$", "<rpcsvc/nis.x>"},
669  {"include/rpcsvc/bootparam_prot.h$", "<rpcsvc/bootparam_prot.h>"},
670  {"include/rpcsvc/mount.h$", "<rpcsvc/mount.h>"},
671  {"include/rpcsvc/mount.x$", "<rpcsvc/mount.x>"},
672  {"include/rpcsvc/nis_object.x$", "<rpcsvc/nis_object.x>"},
673  {"include/rpcsvc/yppasswd.x$", "<rpcsvc/yppasswd.x>"},
674  {"sys/acct.h$", "<sys/acct.h>"},
675  {"sys/auxv.h$", "<sys/auxv.h>"},
676  {"sys/cdefs.h$", "<sys/cdefs.h>"},
677  {"sys/debugreg.h$", "<sys/debugreg.h>"},
678  {"sys/dir.h$", "<sys/dir.h>"},
679  {"sys/elf.h$", "<sys/elf.h>"},
680  {"sys/epoll.h$", "<sys/epoll.h>"},
681  {"sys/eventfd.h$", "<sys/eventfd.h>"},
682  {"sys/fanotify.h$", "<sys/fanotify.h>"},
683  {"sys/file.h$", "<sys/file.h>"},
684  {"sys/fsuid.h$", "<sys/fsuid.h>"},
685  {"sys/gmon.h$", "<sys/gmon.h>"},
686  {"sys/gmon_out.h$", "<sys/gmon_out.h>"},
687  {"sys/inotify.h$", "<sys/inotify.h>"},
688  {"sys/io.h$", "<sys/io.h>"},
689  {"sys/ioctl.h$", "<sys/ioctl.h>"},
690  {"sys/ipc.h$", "<sys/ipc.h>"},
691  {"sys/kd.h$", "<sys/kd.h>"},
692  {"sys/kdaemon.h$", "<sys/kdaemon.h>"},
693  {"sys/klog.h$", "<sys/klog.h>"},
694  {"sys/mman.h$", "<sys/mman.h>"},
695  {"sys/mount.h$", "<sys/mount.h>"},
696  {"sys/msg.h$", "<sys/msg.h>"},
697  {"sys/mtio.h$", "<sys/mtio.h>"},
698  {"sys/param.h$", "<sys/param.h>"},
699  {"sys/pci.h$", "<sys/pci.h>"},
700  {"sys/perm.h$", "<sys/perm.h>"},
701  {"sys/personality.h$", "<sys/personality.h>"},
702  {"sys/poll.h$", "<sys/poll.h>"},
703  {"sys/prctl.h$", "<sys/prctl.h>"},
704  {"sys/procfs.h$", "<sys/procfs.h>"},
705  {"sys/profil.h$", "<sys/profil.h>"},
706  {"sys/ptrace.h$", "<sys/ptrace.h>"},
707  {"sys/queue.h$", "<sys/queue.h>"},
708  {"sys/quota.h$", "<sys/quota.h>"},
709  {"sys/raw.h$", "<sys/raw.h>"},
710  {"sys/reboot.h$", "<sys/reboot.h>"},
711  {"sys/reg.h$", "<sys/reg.h>"},
712  {"sys/resource.h$", "<sys/resource.h>"},
713  {"sys/select.h$", "<sys/select.h>"},
714  {"sys/sem.h$", "<sys/sem.h>"},
715  {"sys/sendfile.h$", "<sys/sendfile.h>"},
716  {"sys/shm.h$", "<sys/shm.h>"},
717  {"sys/signalfd.h$", "<sys/signalfd.h>"},
718  {"sys/socket.h$", "<sys/socket.h>"},
719  {"sys/stat.h$", "<sys/stat.h>"},
720  {"sys/statfs.h$", "<sys/statfs.h>"},
721  {"sys/statvfs.h$", "<sys/statvfs.h>"},
722  {"sys/swap.h$", "<sys/swap.h>"},
723  {"sys/syscall.h$", "<sys/syscall.h>"},
724  {"sys/sysctl.h$", "<sys/sysctl.h>"},
725  {"sys/sysinfo.h$", "<sys/sysinfo.h>"},
726  {"sys/syslog.h$", "<sys/syslog.h>"},
727  {"sys/sysmacros.h$", "<sys/sysmacros.h>"},
728  {"sys/termios.h$", "<sys/termios.h>"},
729  {"sys/time.h$", "<sys/select.h>"},
730  {"sys/timeb.h$", "<sys/timeb.h>"},
731  {"sys/timerfd.h$", "<sys/timerfd.h>"},
732  {"sys/times.h$", "<sys/times.h>"},
733  {"sys/timex.h$", "<sys/timex.h>"},
734  {"sys/ttychars.h$", "<sys/ttychars.h>"},
735  {"sys/ttydefaults.h$", "<sys/ttydefaults.h>"},
736  {"sys/types.h$", "<sys/types.h>"},
737  {"sys/ucontext.h$", "<sys/ucontext.h>"},
738  {"sys/uio.h$", "<sys/uio.h>"},
739  {"sys/un.h$", "<sys/un.h>"},
740  {"sys/user.h$", "<sys/user.h>"},
741  {"sys/ustat.h$", "<sys/ustat.h>"},
742  {"sys/utsname.h$", "<sys/utsname.h>"},
743  {"sys/vlimit.h$", "<sys/vlimit.h>"},
744  {"sys/vm86.h$", "<sys/vm86.h>"},
745  {"sys/vtimes.h$", "<sys/vtimes.h>"},
746  {"sys/wait.h$", "<sys/wait.h>"},
747  {"sys/xattr.h$", "<sys/xattr.h>"},
748  {"bits/epoll.h$", "<sys/epoll.h>"},
749  {"bits/eventfd.h$", "<sys/eventfd.h>"},
750  {"bits/inotify.h$", "<sys/inotify.h>"},
751  {"bits/ipc.h$", "<sys/ipc.h>"},
752  {"bits/ipctypes.h$", "<sys/ipc.h>"},
753  {"bits/mman-linux.h$", "<sys/mman.h>"},
754  {"bits/mman.h$", "<sys/mman.h>"},
755  {"bits/msq.h$", "<sys/msg.h>"},
756  {"bits/resource.h$", "<sys/resource.h>"},
757  {"bits/sem.h$", "<sys/sem.h>"},
758  {"bits/shm.h$", "<sys/shm.h>"},
759  {"bits/signalfd.h$", "<sys/signalfd.h>"},
760  {"bits/statfs.h$", "<sys/statfs.h>"},
761  {"bits/statvfs.h$", "<sys/statvfs.h>"},
762  {"bits/timerfd.h$", "<sys/timerfd.h>"},
763  {"bits/utsname.h$", "<sys/utsname.h>"},
764  {"bits/auxv.h$", "<sys/auxv.h>"},
765  {"bits/byteswap-16.h$", "<byteswap.h>"},
766  {"bits/byteswap.h$", "<byteswap.h>"},
767  {"bits/confname.h$", "<unistd.h>"},
768  {"bits/dirent.h$", "<dirent.h>"},
769  {"bits/dlfcn.h$", "<dlfcn.h>"},
770  {"bits/elfclass.h$", "<link.h>"},
771  {"bits/endian.h$", "<endian.h>"},
772  {"bits/environments.h$", "<unistd.h>"},
773  {"bits/fcntl-linux.h$", "<fcntl.h>"},
774  {"bits/fcntl.h$", "<fcntl.h>"},
775  {"bits/in.h$", "<netinet/in.h>"},
776  {"bits/ioctl-types.h$", "<sys/ioctl.h>"},
777  {"bits/ioctls.h$", "<sys/ioctl.h>"},
778  {"bits/link.h$", "<link.h>"},
779  {"bits/mqueue.h$", "<mqueue.h>"},
780  {"bits/netdb.h$", "<netdb.h>"},
781  {"bits/param.h$", "<sys/param.h>"},
782  {"bits/poll.h$", "<sys/poll.h>"},
783  {"bits/posix_opt.h$", "<bits/posix_opt.h>"},
784  {"bits/pthreadtypes.h$", "<pthread.h>"},
785  {"bits/sched.h$", "<sched.h>"},
786  {"bits/select.h$", "<sys/select.h>"},
787  {"bits/semaphore.h$", "<semaphore.h>"},
788  {"bits/sigthread.h$", "<pthread.h>"},
789  {"bits/sockaddr.h$", "<sys/socket.h>"},
790  {"bits/socket.h$", "<sys/socket.h>"},
791  {"bits/socket_type.h$", "<sys/socket.h>"},
792  {"bits/stab.def$", "<stab.h>"},
793  {"bits/stat.h$", "<sys/stat.h>"},
794  {"bits/stropts.h$", "<stropts.h>"},
795  {"bits/syscall.h$", "<sys/syscall.h>"},
796  {"bits/syslog-path.h$", "<sys/syslog.h>"},
797  {"bits/termios.h$", "<termios.h>"},
798  {"bits/types.h$", "<sys/types.h>"},
799  {"bits/typesizes.h$", "<sys/types.h>"},
800  {"bits/uio.h$", "<sys/uio.h>"},
801  {"bits/ustat.h$", "<sys/ustat.h>"},
802  {"bits/utmp.h$", "<utmp.h>"},
803  {"bits/utmpx.h$", "<utmpx.h>"},
804  {"bits/waitflags.h$", "<sys/wait.h>"},
805  {"bits/waitstatus.h$", "<sys/wait.h>"},
806  {"bits/xtitypes.h$", "<stropts.h>"},
807  };
808  for (const auto &Pair : SystemHeaderMap)
809  Includes->addRegexMapping(Pair.first, Pair.second);
810 }
811 
812 } // namespace clangd
813 } // namespace clang
std::unique_ptr< CommentHandler > collectIWYUHeaderMaps(CanonicalIncludes *Includes)
Returns a CommentHandler that parses pragma comment on include files to determine when we should incl...
void addSymbolMapping(llvm::StringRef QualifiedName, llvm::StringRef CanonicalPath)
Sets the canonical include for any symbol with QualifiedName.
Maps a definition location onto an #include file, based on a set of filename rules.
void addMapping(llvm::StringRef Path, llvm::StringRef CanonicalPath)
Adds a string-to-string mapping from Path to CanonicalPath.
void addRegexMapping(llvm::StringRef RE, llvm::StringRef CanonicalPath)
Maps all files matching RE to CanonicalPath.
std::string Path
A typedef to represent a file path.
Definition: Path.h:21
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
llvm::StringRef mapHeader(llvm::ArrayRef< std::string > Headers, llvm::StringRef QualifiedName) const
Returns the canonical include for symbol with QualifiedName.
void addSystemHeadersMapping(CanonicalIncludes *Includes)
Adds mapping for system headers and some special symbols (e.g.
bool isLiteralInclude(llvm::StringRef Include)
Returns true if Include is literal include like "path" or <path>.
Definition: Headers.cpp:64