diff options
author | Eduardo Caldas <ecaldas@google.com> | 2020-08-06 12:13:36 +0000 |
---|---|---|
committer | Eduardo Caldas <ecaldas@google.com> | 2020-08-07 08:45:29 +0000 |
commit | ba41a0f7339c8cbd065f032cc5f8c1d87a74e124 (patch) | |
tree | 0e03c9df692a68538e42ab3052893781dcf784c1 /clang/unittests/Tooling/Syntax/TreeTest.cpp | |
parent | c575ba28de2f24cb2fd602780029bdaa8e0ce4a5 (diff) | |
download | llvm-ba41a0f7339c8cbd065f032cc5f8c1d87a74e124.zip llvm-ba41a0f7339c8cbd065f032cc5f8c1d87a74e124.tar.gz llvm-ba41a0f7339c8cbd065f032cc5f8c1d87a74e124.tar.bz2 |
[SyntaxTree][NFC] remove redundant namespace-specifiers
Differential Revision: https://reviews.llvm.org/D85427
Diffstat (limited to 'clang/unittests/Tooling/Syntax/TreeTest.cpp')
-rw-r--r-- | clang/unittests/Tooling/Syntax/TreeTest.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/clang/unittests/Tooling/Syntax/TreeTest.cpp b/clang/unittests/Tooling/Syntax/TreeTest.cpp index e696be3..f818959 100644 --- a/clang/unittests/Tooling/Syntax/TreeTest.cpp +++ b/clang/unittests/Tooling/Syntax/TreeTest.cpp @@ -40,7 +40,7 @@ using namespace clang; namespace { -static llvm::ArrayRef<syntax::Token> tokens(syntax::Node *N) { +static ArrayRef<syntax::Token> tokens(syntax::Node *N) { assert(N->isOriginal() && "tokens of modified nodes are not well-defined"); if (auto *L = dyn_cast<syntax::Leaf>(N)) return llvm::makeArrayRef(L->token(), 1); @@ -53,7 +53,7 @@ class SyntaxTreeTest : public ::testing::Test, public ::testing::WithParamInterface<TestClangConfig> { protected: // Build a syntax tree for the code. - syntax::TranslationUnit *buildTree(llvm::StringRef Code, + syntax::TranslationUnit *buildTree(StringRef Code, const TestClangConfig &ClangConfig) { // FIXME: this code is almost the identical to the one in TokensTest. Share // it. @@ -169,7 +169,7 @@ protected: } // Adds a file to the test VFS. - void addFile(llvm::StringRef Path, llvm::StringRef Contents) { + void addFile(StringRef Path, StringRef Contents) { if (!FS->addFile(Path, time_t(), llvm::MemoryBuffer::getMemBufferCopy(Contents))) { ADD_FAILURE() << "could not add a file to VFS: " << Path; @@ -179,7 +179,7 @@ protected: /// Finds the deepest node in the tree that covers exactly \p R. /// FIXME: implement this efficiently and move to public syntax tree API. syntax::Node *nodeByRange(llvm::Annotations::Range R, syntax::Node *Root) { - llvm::ArrayRef<syntax::Token> Toks = tokens(Root); + ArrayRef<syntax::Token> Toks = tokens(Root); if (Toks.front().location().isFileID() && Toks.back().location().isFileID() && @@ -198,15 +198,14 @@ protected: } // Data fields. - llvm::IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = - new DiagnosticOptions(); - llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags = + IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions(); + IntrusiveRefCntPtr<DiagnosticsEngine> Diags = new DiagnosticsEngine(new DiagnosticIDs, DiagOpts.get()); IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> FS = new llvm::vfs::InMemoryFileSystem; - llvm::IntrusiveRefCntPtr<FileManager> FileMgr = + IntrusiveRefCntPtr<FileManager> FileMgr = new FileManager(FileSystemOptions(), FS); - llvm::IntrusiveRefCntPtr<SourceManager> SourceMgr = + IntrusiveRefCntPtr<SourceManager> SourceMgr = new SourceManager(*Diags, *FileMgr); std::shared_ptr<CompilerInvocation> Invocation; // Set after calling buildTree(). |