clang  14.0.0git
Lookup.cpp File Reference
#include "clang/Tooling/Refactoring/Lookup.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclarationName.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "llvm/ADT/SmallVector.h"
Include dependency graph for Lookup.cpp:

Go to the source code of this file.


static llvm::SmallVector< const NamespaceDecl *, 4 > getAllNamedNamespaces (const DeclContext *Context)
static bool usingFromDifferentCanonicalNamespace (const DeclContext *FromContext, const DeclContext *UseContext)
static StringRef getBestNamespaceSubstr (const DeclContext *DeclA, StringRef NewName, bool HadLeadingColonColon)
static bool isFullyQualified (const NestedNameSpecifier *NNS)
 Check if the name specifier begins with a written "::". More...
static std::string disambiguateSpellingInScope (StringRef Spelling, StringRef QName, const DeclContext &UseContext, SourceLocation UseLoc)

Function Documentation

◆ disambiguateSpellingInScope()

static std::string disambiguateSpellingInScope ( StringRef  Spelling,
StringRef  QName,
const DeclContext UseContext,
SourceLocation  UseLoc 

◆ getAllNamedNamespaces()

static llvm::SmallVector<const NamespaceDecl *, 4> getAllNamedNamespaces ( const DeclContext Context)

Definition at line 30 of file Lookup.cpp.

Referenced by disambiguateSpellingInScope(), and usingFromDifferentCanonicalNamespace().

◆ getBestNamespaceSubstr()

static StringRef getBestNamespaceSubstr ( const DeclContext DeclA,
StringRef  NewName,
bool  HadLeadingColonColon 

Definition at line 85 of file Lookup.cpp.

References clang::DeclContext::getParent(), and string().

Referenced by clang::tooling::replaceNestedName().

◆ isFullyQualified()

static bool isFullyQualified ( const NestedNameSpecifier NNS)

Check if the name specifier begins with a written "::".

Definition at line 112 of file Lookup.cpp.

References clang::NestedNameSpecifier::getKind(), clang::NestedNameSpecifier::getPrefix(), and clang::NestedNameSpecifier::Global.

Referenced by clang::tooling::replaceNestedName().

◆ usingFromDifferentCanonicalNamespace()

static bool usingFromDifferentCanonicalNamespace ( const DeclContext FromContext,
const DeclContext UseContext 

Definition at line 49 of file Lookup.cpp.

References getAllNamedNamespaces().

Referenced by clang::tooling::replaceNestedName().