clang-tools 20.0.0git
PathConfig.h
Go to the documentation of this file.
1//===-- PathConfig.h - Process paths of symbols -----------------*- C++ -*-===//
2//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLVM_CLANG_TOOLS_EXTRA_FIND_ALL_SYMBOLS_PATH_CONFIG_H
11#define LLVM_CLANG_TOOLS_EXTRA_FIND_ALL_SYMBOLS_PATH_CONFIG_H
12
13#include "HeaderMapCollector.h"
14#include "clang/Basic/SourceManager.h"
15#include <string>
16
17namespace clang {
18namespace find_all_symbols {
19
20/// This calculates the include path for \p Loc.
21///
22/// \param SM SourceManager.
23/// \param Loc A SourceLocation.
24/// \param Collector An optional header mapping collector.
25///
26/// \return The file path (or mapped file path if Collector is provided) of the
27/// header that includes \p Loc. If \p Loc comes from .inc header file, \p Loc
28/// is set to the location from which the .inc header file is included. If \p
29/// Loc is invalid or comes from a main file, this returns an empty string.
30std::string getIncludePath(const SourceManager &SM, SourceLocation Loc,
31 const HeaderMapCollector *Collector = nullptr);
32
33} // namespace find_all_symbols
34} // namespace clang
35
36#endif // LLVM_CLANG_TOOLS_EXTRA_FIND_ALL_SYMBOLS_PATH_CONFIG_H
SourceLocation Loc
std::string getIncludePath(const SourceManager &SM, SourceLocation Loc, const HeaderMapCollector *Collector)
This calculates the include path for Loc.
Definition: PathConfig.cpp:17
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//