diff options
Diffstat (limited to 'clang-tools-extra/unittests/clangd/TestTU.cpp')
| -rw-r--r-- | clang-tools-extra/unittests/clangd/TestTU.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/clang-tools-extra/unittests/clangd/TestTU.cpp b/clang-tools-extra/unittests/clangd/TestTU.cpp index 4e14262e727..6706c44927d 100644 --- a/clang-tools-extra/unittests/clangd/TestTU.cpp +++ b/clang-tools-extra/unittests/clangd/TestTU.cpp @@ -16,7 +16,6 @@ #include "clang/Frontend/PCHContainerOperations.h" #include "clang/Frontend/Utils.h" -using namespace llvm; namespace clang { namespace clangd { @@ -67,7 +66,7 @@ std::unique_ptr<SymbolIndex> TestTU::index() const { return std::move(Idx); } -const Symbol &findSymbol(const SymbolSlab &Slab, StringRef QName) { +const Symbol &findSymbol(const SymbolSlab &Slab, llvm::StringRef QName) { const Symbol *Result = nullptr; for (const Symbol &S : Slab) { if (QName != (S.Scope + S.Name).str()) @@ -88,13 +87,13 @@ const Symbol &findSymbol(const SymbolSlab &Slab, StringRef QName) { return *Result; } -const NamedDecl &findDecl(ParsedAST &AST, StringRef QName) { - SmallVector<StringRef, 4> Components; +const NamedDecl &findDecl(ParsedAST &AST, llvm::StringRef QName) { + llvm::SmallVector<llvm::StringRef, 4> Components; QName.split(Components, "::"); auto &Ctx = AST.getASTContext(); auto LookupDecl = [&Ctx](const DeclContext &Scope, - StringRef Name) -> const NamedDecl & { + llvm::StringRef Name) -> const NamedDecl & { auto LookupRes = Scope.lookup(DeclarationName(&Ctx.Idents.get(Name))); assert(!LookupRes.empty() && "Lookup failed"); assert(LookupRes.size() == 1 && "Lookup returned multiple results"); @@ -113,7 +112,7 @@ const NamedDecl &findDecl(ParsedAST &AST, std::function<bool(const NamedDecl &)> Filter) { struct Visitor : RecursiveASTVisitor<Visitor> { decltype(Filter) F; - SmallVector<const NamedDecl *, 1> Decls; + llvm::SmallVector<const NamedDecl *, 1> Decls; bool VisitNamedDecl(const NamedDecl *ND) { if (F(*ND)) Decls.push_back(ND); @@ -129,7 +128,7 @@ const NamedDecl &findDecl(ParsedAST &AST, return *Visitor.Decls.front(); } -const NamedDecl &findUnqualifiedDecl(ParsedAST &AST, StringRef Name) { +const NamedDecl &findUnqualifiedDecl(ParsedAST &AST, llvm::StringRef Name) { return findDecl(AST, [Name](const NamedDecl &ND) { if (auto *ID = ND.getIdentifier()) if (ID->getName() == Name) |

