2018-03-09 22:00:34 +08:00
|
|
|
//===--- AST.h - Utility AST functions -------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// Various code that examines C++ source code using AST.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_AST_H_
|
|
|
|
#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_AST_H_
|
|
|
|
|
2018-06-22 18:46:59 +08:00
|
|
|
#include "clang/AST/Decl.h"
|
2018-03-09 22:00:34 +08:00
|
|
|
#include "clang/Basic/SourceLocation.h"
|
2018-08-07 16:57:52 +08:00
|
|
|
#include "index/Index.h"
|
2018-03-09 22:00:34 +08:00
|
|
|
|
|
|
|
namespace clang {
|
|
|
|
class SourceManager;
|
|
|
|
class Decl;
|
|
|
|
|
|
|
|
namespace clangd {
|
|
|
|
|
|
|
|
/// Find the identifier source location of the given D.
|
|
|
|
///
|
|
|
|
/// The returned location is usually the spelling location where the name of the
|
|
|
|
/// decl occurs in the code.
|
2018-05-30 20:41:19 +08:00
|
|
|
SourceLocation findNameLoc(const clang::Decl *D);
|
2018-03-09 22:00:34 +08:00
|
|
|
|
2018-06-22 18:46:59 +08:00
|
|
|
/// Returns the qualified name of ND. The scope doesn't contain unwritten scopes
|
|
|
|
/// like inline namespaces.
|
|
|
|
std::string printQualifiedName(const NamedDecl &ND);
|
|
|
|
|
2018-08-07 16:57:52 +08:00
|
|
|
/// Gets the symbol ID for a declaration, if possible.
|
|
|
|
llvm::Optional<SymbolID> getSymbolID(const Decl *D);
|
|
|
|
|
2018-03-09 22:00:34 +08:00
|
|
|
} // namespace clangd
|
|
|
|
} // namespace clang
|
|
|
|
|
|
|
|
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_AST_H_
|