clang
22.0.0git
include
clang
Tooling
Refactoring
Lookup.h
Go to the documentation of this file.
1
//===--- Lookup.h - Framework for clang refactoring tools --*- C++ -*------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file defines helper methods for clang tools performing name lookup.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_CLANG_TOOLING_REFACTORING_LOOKUP_H
14
#define LLVM_CLANG_TOOLING_REFACTORING_LOOKUP_H
15
16
#include "
clang/Basic/LLVM.h
"
17
#include "
clang/Basic/SourceLocation.h
"
18
#include <string>
19
20
namespace
clang
{
21
22
class
DeclContext
;
23
class
NamedDecl
;
24
class
NestedNameSpecifier
;
25
26
namespace
tooling
{
27
28
/// Emulate a lookup to replace one nested name specifier with another using as
29
/// few additional namespace qualifications as possible.
30
///
31
/// This does not perform a full C++ lookup so ADL will not work.
32
///
33
/// \param Use The nested name to be replaced.
34
/// \param UseLoc The location of name to be replaced.
35
/// \param UseContext The context in which the nested name is contained. This
36
/// will be used to minimize namespace qualifications.
37
/// \param FromDecl The declaration to which the nested name points.
38
/// \param ReplacementString The replacement nested name. Must be fully
39
/// qualified including a leading "::".
40
/// \returns The new name to be inserted in place of the current nested name.
41
std::string
replaceNestedName
(NestedNameSpecifier Use, SourceLocation UseLoc,
42
const
DeclContext *UseContext,
43
const
NamedDecl *FromDecl,
44
StringRef ReplacementString);
45
46
}
// end namespace tooling
47
}
// end namespace clang
48
49
#endif
// LLVM_CLANG_TOOLING_REFACTORING_LOOKUP_H
LLVM.h
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
SourceLocation.h
Defines the clang::SourceLocation class and associated facilities.
clang::DeclContext
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition
DeclBase.h:1449
clang::NamedDecl
This represents a decl that may have a name.
Definition
Decl.h:273
clang::NestedNameSpecifier
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
Definition
NestedNameSpecifierBase.h:51
clang::tooling
Definition
AllTUsExecution.h:22
clang::tooling::replaceNestedName
std::string replaceNestedName(NestedNameSpecifier Use, SourceLocation UseLoc, const DeclContext *UseContext, const NamedDecl *FromDecl, StringRef ReplacementString)
Emulate a lookup to replace one nested name specifier with another using as few additional namespace ...
Definition
Lookup.cpp:175
clang
The JSON file list parser is used to communicate input to InstallAPI.
Definition
CalledOnceCheck.h:17
Generated on
for clang by
1.14.0