Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:37:11

0001 //===--- Lookup.h - Framework for clang refactoring tools --*- C++ -*------===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 //  This file defines helper methods for clang tools performing name lookup.
0010 //
0011 //===----------------------------------------------------------------------===//
0012 
0013 #ifndef LLVM_CLANG_TOOLING_REFACTORING_LOOKUP_H
0014 #define LLVM_CLANG_TOOLING_REFACTORING_LOOKUP_H
0015 
0016 #include "clang/Basic/LLVM.h"
0017 #include "clang/Basic/SourceLocation.h"
0018 #include <string>
0019 
0020 namespace clang {
0021 
0022 class DeclContext;
0023 class NamedDecl;
0024 class NestedNameSpecifier;
0025 
0026 namespace tooling {
0027 
0028 /// Emulate a lookup to replace one nested name specifier with another using as
0029 /// few additional namespace qualifications as possible.
0030 ///
0031 /// This does not perform a full C++ lookup so ADL will not work.
0032 ///
0033 /// \param Use The nested name to be replaced.
0034 /// \param UseLoc The location of name to be replaced.
0035 /// \param UseContext The context in which the nested name is contained. This
0036 ///                   will be used to minimize namespace qualifications.
0037 /// \param FromDecl The declaration to which the nested name points.
0038 /// \param ReplacementString The replacement nested name. Must be fully
0039 ///                          qualified including a leading "::".
0040 /// \returns The new name to be inserted in place of the current nested name.
0041 std::string replaceNestedName(const NestedNameSpecifier *Use,
0042                               SourceLocation UseLoc,
0043                               const DeclContext *UseContext,
0044                               const NamedDecl *FromDecl,
0045                               StringRef ReplacementString);
0046 
0047 } // end namespace tooling
0048 } // end namespace clang
0049 
0050 #endif // LLVM_CLANG_TOOLING_REFACTORING_LOOKUP_H