Repository: kythe/kythe
Pull request #5397 (2022-10-18 19:43:37)

chore: migrate to std::make_unique
TIL, `bazel query "let files = set(${FILES[@]}) in same_pkg_direct_rdeps(\$files)"` for quickly finding build targets that need to be updated ;-)



Patch:
diff --git a/kythe/cxx/common/BUILD b/kythe/cxx/common/BUILD
index 7906ecc5d..ce7e62485 100644
--- a/kythe/cxx/common/BUILD
+++ b/kythe/cxx/common/BUILD
@@ -82,7 +82,6 @@ cc_library(
         ":common_status",
         "@com_github_google_glog//:glog",
         "@com_google_absl//absl/container:flat_hash_map",
-        "@com_google_absl//absl/memory",
         "@com_google_absl//absl/status",
         "@com_google_absl//absl/status:statusor",
         "@com_google_absl//absl/strings",
@@ -149,7 +148,6 @@ cc_library(
         "@com_github_google_glog//:glog",
         "@com_github_tencent_rapidjson//:rapidjson",
         "@com_google_absl//absl/base",
-        "@com_google_absl//absl/memory",
         "@com_google_absl//absl/strings",
         "@com_google_absl//absl/types:optional",
         "@com_google_protobuf//:cc_wkt_protos",
@@ -265,7 +263,6 @@ cc_library(
         "@com_github_google_glog//:glog",
         "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/flags:parse",
-        "@com_google_absl//absl/memory",
         "@com_google_protobuf//:protobuf",
     ],
 )
diff --git a/kythe/cxx/common/kythe_metadata_file.h b/kythe/cxx/common/kythe_metadata_file.h
index a43d5ff19..d30b44157 100644
--- a/kythe/cxx/common/kythe_metadata_file.h
+++ b/kythe/cxx/common/kythe_metadata_file.h
@@ -20,7 +20,6 @@
 #include <map>
 #include <memory>
 
-#include "absl/memory/memory.h"
 #include "absl/strings/string_view.h"
 #include "absl/types/optional.h"
 #include "kythe/proto/metadata.pb.h"
@@ -61,7 +60,7 @@ class MetadataFile {
   static std::unique_ptr<MetadataFile> LoadFromRules(absl::string_view id,
                                                      InputIterator begin,
                                                      InputIterator end) {
-    std::unique_ptr<MetadataFile> meta_file = absl::make_unique<MetadataFile>();
+    std::unique_ptr<MetadataFile> meta_file = std::make_unique<MetadataFile>();
     meta_file->id_ = std::string(id);
     for (auto rule = begin; rule != end; ++rule) {
       if (rule->whole_file) {
diff --git a/kythe/cxx/common/path_utils.cc b/kythe/cxx/common/path_utils.cc
index 7c1ff12f3..de74ccd67 100644
--- a/kythe/cxx/common/path_utils.cc
+++ b/kythe/cxx/common/path_utils.cc
@@ -19,9 +19,9 @@
 #include <stdlib.h>
 #include <unistd.h>
 
+#include <memory>
 #include <vector>
 
-#include "absl/memory/memory.h"
 #include "absl/status/status.h"
 #include "absl/status/statusor.h"
 #include "absl/strings/match.h"
diff --git a/kythe/cxx/doc/BUILD b/kythe/cxx/doc/BUILD
index 12f874b11..e4ed22b9e 100644
--- a/kythe/cxx/doc/BUILD
+++ b/kythe/cxx/doc/BUILD
@@ -106,7 +106,6 @@ cc_binary(
         "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/flags:parse",
         "@com_google_absl//absl/flags:usage",
-        "@com_google_absl//absl/memory",
         "@com_google_absl//absl/strings:str_format",
         "@com_google_protobuf//:protobuf",
     ],
diff --git a/kythe/cxx/doc/doc.cc b/kythe/cxx/doc/doc.cc
index 3a7239f73..4f94f8bb7 100644
--- a/kythe/cxx/doc/doc.cc
+++ b/kythe/cxx/doc/doc.cc
@@ -20,12 +20,12 @@
 #include <fcntl.h>
 #include <sys/stat.h>
 
+#include <memory>
 #include <string>
 
 #include "absl/flags/flag.h"
 #include "absl/flags/parse.h"
 #include "absl/flags/usage.h"
-#include "absl/memory/memory.h"
 #include "absl/strings/str_format.h"
 #include "glog/logging.h"
 #include "google/protobuf/io/zero_copy_stream_impl.h"
@@ -194,7 +194,7 @@ doc -common_signatures
     return kythe::DocumentNodesFromStdin();
   } else {
     kythe::JsonClient::InitNetwork();
-    kythe::XrefsJsonClient client(absl::make_unique<kythe::JsonClient>(),
+    kythe::XrefsJsonClient client(std::make_unique<kythe::JsonClient>(),
                                   absl::GetFlag(FLAGS_xrefs));
     auto ticket = kythe::URI::FromString(absl::GetFlag(FLAGS_path));
     if (!ticket.first) {
diff --git a/kythe/cxx/extractor/BUILD b/kythe/cxx/extractor/BUILD
index acc9ba600..3c9534d40 100644
--- a/kythe/cxx/extractor/BUILD
+++ b/kythe/cxx/extractor/BUILD
@@ -122,7 +122,6 @@ cc_library(
         "@com_github_google_glog//:glog",
         "@com_google_absl//absl/container:flat_hash_map",
         "@com_google_absl//absl/container:flat_hash_set",
-        "@com_google_absl//absl/memory",
         "@com_google_absl//absl/status:statusor",
         "@com_google_absl//absl/strings",
         "@com_google_absl//absl/strings:str_format",
@@ -244,7 +243,6 @@ cc_test(
         "//kythe/proto:analysis_cc_proto",
         "//third_party:gtest",
         "@com_github_google_glog//:glog",
-        "@com_google_absl//absl/memory",
         "@com_google_protobuf//:protobuf",
         "@com_googlesource_code_re2//:re2",
         "@llvm-project//clang:frontend",
diff --git a/kythe/cxx/extractor/cxx_extractor.cc b/kythe/cxx/extractor/cxx_extractor.cc
index aff6837b4..174fe2a65 100644
--- a/kythe/cxx/extractor/cxx_extractor.cc
+++ b/kythe/cxx/extractor/cxx_extractor.cc
@@ -21,6 +21,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
+#include <memory>
 #include <tuple>
 #include <type_traits>
 #include <unordered_map>
@@ -28,7 +29,6 @@
 
 #include "absl/container/flat_hash_map.h"
 #include "absl/container/flat_hash_set.h"
-#include "absl/memory/memory.h"
 #include "absl/status/statusor.h"
 #include "absl/strings/match.h"
 #include "absl/strings/str_cat.h"
@@ -958,7 +958,7 @@ class ExtractorAction : public clang::PreprocessorFrontendAction {
     main_source_file_ = std::string(inputs[0].getFile());
     auto* preprocessor = &getCompilerInstance().getPreprocessor();
     preprocessor->addPPCallbacks(
-        absl::make_unique<ExtractorPPCallbacks>(ExtractorState{
+        std::make_unique<ExtractorPPCallbacks>(ExtractorState{
             index_writer_, &getCompilerInstance().getSourceManager(),
             preprocessor, &main_source_file_, &main_source_file_transcript_,
             &source_files_, &main_source_file_stdin_alternate_}));
@@ -1311,7 +1311,7 @@ void CompilationWriter::WriteIndex(
 
 std::unique_ptr<clang::FrontendAction> NewExtractor(
     CompilationWriter* index_writer, ExtractorCallback callback) {
-  return absl::make_unique<ExtractorAction>(index_writer, std::move(callback));
+  return std::make_unique<ExtractorAction>(index_writer, std::move(callback));
 }
 
 llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> MapCompilerResources(
@@ -1517,10 +1517,10 @@ bool ExtractorConfiguration::Extract(supported_language::Language lang) {
   if (!output_file_.empty()) {
     CHECK(absl::EndsWith(output_file_, ".kzip"))
         << "Output file must have '.kzip' extension";
-    sink = absl::make_unique<KzipWriterSink>(
+    sink = std::make_unique<KzipWriterSink>(
         output_file_, KzipWriterSink::OutputPathType::SingleFile);
   } else {
-    sink = absl::make_unique<KzipWriterSink>(
+    sink = std::make_unique<KzipWriterSink>(
         output_directory_, KzipWriterSink::OutputPathType::Directory);
   }
 
diff --git a/kythe/cxx/indexer/cxx/BUILD b/kythe/cxx/indexer/cxx/BUILD
index cf383ceb5..316dbc888 100644
--- a/kythe/cxx/indexer/cxx/BUILD
+++ b/kythe/cxx/indexer/cxx/BUILD
@@ -57,7 +57,6 @@ cc_library(
         "//kythe/proto:buildinfo_cc_proto",
         "//kythe/proto:claim_cc_proto",
         "@com_google_absl//absl/flags:flag",
-        "@com_google_absl//absl/memory",
         "@com_google_absl//absl/status:statusor",
         "@com_google_absl//absl/strings:str_format",
         "@com_google_protobuf//:protobuf",
@@ -210,7 +209,6 @@ cc_library(
         "@com_github_google_glog//:glog",
         "@com_google_absl//absl/container:flat_hash_set",
         "@com_google_absl//absl/flags:flag",
-        "@com_google_absl//absl/memory",
         "@com_google_absl//absl/strings",
         "@com_google_absl//absl/types:optional",
         "@com_googlesource_code_re2//:re2",
@@ -420,7 +418,6 @@ cc_library(
         "@com_github_google_glog//:glog",
         "@com_google_absl//absl/base:core_headers",
         "@com_google_absl//absl/container:flat_hash_map",
-        "@com_google_absl//absl/memory",
         "@com_google_absl//absl/strings",
         "@com_google_absl//absl/strings:str_format",
         "@com_google_absl//absl/types:optional",
@@ -481,7 +478,6 @@ cc_library(
         "//kythe/proto:storage_cc_proto",
         "//third_party/llvm/src:clang_builtin_headers",
         "@com_github_google_glog//:glog",
-        "@com_google_absl//absl/memory",
         "@com_google_absl//absl/strings",
         "@com_google_absl//absl/strings:str_format",
         "@com_googlesource_code_re2//:re2",
@@ -518,7 +514,6 @@ cc_binary(
         "@com_google_absl//absl/flags:flag",
         "@com_google_absl//absl/flags:parse",
         "@com_google_absl//absl/flags:usage",
-        "@com_google_absl//absl/memory",
         "@com_google_absl//absl/strings:str_format",
         "@com_google_protobuf//:protobuf",
     ],
@@ -554,7 +549,6 @@ cc_test(
         "//kythe/cxx/common/indexing:output",
         "//kythe/cxx/common/indexing:testlib",
         "//third_party:gtest",
-        "@com_google_absl//absl/memory",
         "@com_google_protobuf//:protobuf",
         "@llvm-project//clang:ast",
         "@llvm-project//clang:frontend",
diff --git a/kythe/cxx/indexer/cxx/IndexerASTHooks.h b/kythe/cxx/indexer/cxx/IndexerASTHooks.h
index 8b0dd6028..baad34915 100644
--- a/kythe/cxx/indexer/cxx/IndexerASTHooks.h
+++ b/kythe/cxx/indexer/cxx/IndexerASTHooks.h
@@ -28,7 +28,6 @@
 #include "IndexerLibrarySupport.h"
 #include "absl/base/attributes.h"
 #include "absl/container/flat_hash_map.h"
-#include "absl/memory/memory.h"
 #include "absl/strings/string_view.h"
 #include "absl/types/optional.h"
 #include "clang/AST/ASTContext.h"
@@ -711,13 +710,13 @@ class IndexerASTVisitor : public RecursiveTypeVisitor<IndexerASTVisitor> {
   void Work(clang::Decl* InitialDecl,
             std::unique_ptr<IndexerWorklist> NewWorklist) {
     Worklist = std::move(NewWorklist);
-    Worklist->EnqueueJob(absl::make_unique<IndexJob>(InitialDecl));
+    Worklist->EnqueueJob(std::make_unique<IndexJob>(InitialDecl));
     while (!options_.ShouldStopIndexing() && Worklist->DoWork())
       ;
     Observer.iterateOverClaimedFiles(
         [this, InitialDecl](clang::FileID Id,
                             const GraphObserver::NodeId& FileNode) {
-          RunJob(absl::make_unique<IndexJob>(InitialDecl, Id, FileNode));
+          RunJob(std::make_unique<IndexJob>(InitialDecl, Id, FileNode));
           return !options_.ShouldStopIndexing();
         });
     Worklist.reset();
diff --git a/kythe/cxx/indexer/cxx/IndexerFrontendAction.cc b/kythe/cxx/indexer/cxx/IndexerFrontendAction.cc
index 0f1b73b71..f30d10d0e 100644
--- a/kythe/cxx/indexer/cxx/IndexerFrontendAction.cc
+++ b/kythe/cxx/indexer/cxx/IndexerFrontendAction.cc
@@ -22,7 +22,6 @@
 
 #include "KytheGraphObserver.h"
 #include "KytheVFS.h"
-#include "absl/memory/memory.h"
 #include "absl/strings/str_cat.h"
 #include "absl/strings/str_format.h"
 #include "absl/strings/str_join.h"
@@ -254,7 +253,7 @@ std::string IndexCompilationUnit(
         });
   }
   std::unique_ptr<IndexerFrontendAction> Action =
-      absl::make_unique<IndexerFrontendAction>(
+      std::make_unique<IndexerFrontendAction>(
           &Observer, HSIValid ? &HSI : nullptr, LibrarySupports, Options);
   llvm::IntrusiveRefCntPtr<clang::FileManager> FileManager(
       new clang::FileManager(FSO, Options.AllowFSAccess ? nullptr : VFS));
@@ -266,7 +265,7 @@ std::string IndexCompilationUnit(
 
   // StdinAdjustSingleFrontendActionFactory takes ownership of its action.
   std::unique_ptr<StdinAdjustSingleFrontendActionFactory> Tool =
-      absl::make_unique<StdinAdjustSingleFrontendActionFactory>(
+      std::make_unique<StdinAdjustSingleFrontendActionFactory>(
           std::move(Action));
   // ToolInvocation doesn't take ownership of ToolActions.
   clang::tooling::ToolInvocation Invocation(
diff --git a/kythe/cxx/indexer/cxx/IndexerFrontendAction.h b/kythe/cxx/indexer/cxx/IndexerFrontendAction.h
index 10a55a4b7..33861cf96 100644
--- a/kythe/cxx/indexer/cxx/IndexerFrontendAction.h
+++ b/kythe/cxx/indexer/cxx/IndexerFrontendAction.h
@@ -33,7 +33,6 @@
 #include "GraphObserver.h"
 #include "IndexerASTHooks.h"
 #include "IndexerPPCallbacks.h"
-#include "absl/memory/memory.h"
 #include "clang/Frontend/CompilerInstance.h"
 #include "clang/Frontend/FrontendAction.h"
 #include "clang/Lex/HeaderSearch.h"
@@ -118,12 +117,12 @@ class IndexerFrontendAction : public clang::ASTFrontendAction {
       Observer->setLangOptions(&CI.getLangOpts());
       Observer->setPreprocessor(&CI.getPreprocessor());
     }
-    return absl::make_unique<IndexerASTConsumer>(Observer, Supports, options_);
+    return std::make_unique<IndexerASTConsumer>(Observer, Supports, options_);
   }
 
   bool BeginSourceFileAction(clang::CompilerInstance& CI) override {
     if (Observer) {
-      CI.getPreprocessor().addPPCallbacks(absl::make_unique<IndexerPPCallbacks>(
+      CI.getPreprocessor().addPPCallbacks(std::make_unique<IndexerPPCallbacks>(
           CI.getPreprocessor(), *Observer, options_.Verbosity,
           options_.UsrByteSize));
     }
diff --git a/kythe/cxx/indexer/cxx/KytheIndexerMain.cc b/kythe/cxx/indexer/cxx/KytheIndexerMain.cc
index 12a333411..4480a5dbc 100644
--- a/kythe/cxx/indexer/cxx/KytheIndexerMain.cc
+++ b/kythe/cxx/indexer/cxx/KytheIndexerMain.cc
@@ -23,10 +23,11 @@
 //       indexer -i foo.cc | verifier foo.cc
 //       indexer some/index.kzip
 
+#include <memory>
+
 #include "absl/flags/flag.h"
 #include "absl/flags/parse.h"
 #include "absl/flags/usage.h"
-#include "absl/memory/memory.h"
 #include "absl/strings/str_format.h"
 #include "google/protobuf/stubs/common.h"
 #include "kythe/cxx/common/init.h"
@@ -136,17 +137,17 @@ int main(int argc, char* argv[]) {
     options.EffectiveWorkingDirectory = job.unit.working_directory();
 
     kythe::MetadataSupports meta_supports;
-    auto proto = absl::make_unique<ProtobufMetadataSupport>();
+    auto proto = std::make_unique<ProtobufMetadataSupport>();
     if (absl::GetFlag(FLAGS_experimental_guess_proto_semantics)) {
       proto->GuessSemantics(true);
     }
     meta_supports.Add(std::move(proto));
-    meta_supports.Add(absl::make_unique<KytheMetadataSupport>());
+    meta_supports.Add(std::make_unique<KytheMetadataSupport>());
 
     kythe::LibrarySupports library_supports;
-    library_supports.push_back(absl::make_unique<GoogleFlagsLibrarySupport>());
-    library_supports.push_back(absl::make_unique<GoogleProtoLibrarySupport>());
-    library_supports.push_back(absl::make_unique<ImputedConstructorSupport>());
+    library_supports.push_back(std::make_unique<GoogleFlagsLibrarySupport>());
+    library_supports.push_back(std::make_unique<GoogleProtoLibrarySupport>());
+    library_supports.push_back(std::make_unique<ImputedConstructorSupport>());
 
     std::string result = IndexCompilationUnit(
         job.unit, job.virtual_files, *context.claim_client(),
diff --git a/kythe/cxx/indexer/cxx/KytheVFS.cc b/kythe/cxx/indexer/cxx/KytheVFS.cc
index c3fa10965..6f1538570 100644
--- a/kythe/cxx/indexer/cxx/KytheVFS.cc
+++ b/kythe/cxx/indexer/cxx/KytheVFS.cc
@@ -16,9 +16,9 @@
 
 #include "KytheVFS.h"
 
+#include <memory>
 #include <system_error>
 
-#include "absl/memory/memory.h"
 #include "absl/strings/str_cat.h"
 #include "absl/strings/str_format.h"
 #include "glog/logging.h"
@@ -111,7 +111,7 @@ llvm::ErrorOr<std::unique_ptr<llvm::vfs::File>> IndexVFS::openFileForRead(
   if (FileRecord* record =
           FileRecordForPath(path.str(), BehaviorOnMissing::kReturnError, 0)) {
     if (record->status.getType() == llvm::sys::fs::file_type::regular_file) {
-      return absl::make_unique<File>(record);
+      return std::make_unique<File>(record);
     }
   }
   return make_error_code(llvm::errc::no_such_file_or_directory);
diff --git a/kythe/cxx/indexer/cxx/frontend.cc b/kythe/cxx/indexer/cxx/frontend.cc
index 061b914d6..21363f65c 100644
--- a/kythe/cxx/indexer/cxx/frontend.cc
+++ b/kythe/cxx/indexer/cxx/frontend.cc
@@ -21,10 +21,10 @@
 #include <unistd.h>
 
 #include <cstdint>
+#include <memory>
 #include <string>
 
 #include "absl/flags/flag.h"
-#include "absl/memory/memory.h"
 #include "absl/status/statusor.h"
 #include "absl/strings/str_format.h"
 #include "google/protobuf/io/coded_stream.h"
@@ -269,7 +269,7 @@ void IndexerContext::LoadDataFromUnpackedFile(
 
 void IndexerContext::InitializeClaimClient() {
   if (!absl::GetFlag(FLAGS_experimental_dynamic_claim_cache).empty()) {
-    auto dynamic_claims = absl::make_unique<kythe::DynamicClaimClient>();
+    auto dynamic_claims = std::make_unique<kythe::DynamicClaimClient>();
     dynamic_claims->set_max_redundant_claims(
         absl::GetFlag(FLAGS_experimental_dynamic_overclaim));
     CHECK(dynamic_claims->OpenMemcache(
@@ -277,7 +277,7 @@ void IndexerContext::InitializeClaimClient() {
         << "Can't open memcached";
     claim_client_ = std::move(dynamic_claims);
   } else {
-    auto static_claims = absl::make_unique<kythe::StaticClaimClient>();
+    auto static_claims = std::make_unique<kythe::StaticClaimClient>();
     if (!absl::GetFlag(FLAGS_static_claim).empty()) {
       DecodeStaticClaimTable(absl::GetFlag(FLAGS_static_claim),
                              static_claims.get());
@@ -300,8 +300,8 @@ void IndexerContext::OpenOutputStreams() {
     }
   }
   raw_output_ =
-      absl::make_unique<google::protobuf::io::FileOutputStream>(write_fd_);
-  kythe_output_ = absl::make_unique<kythe::FileOutputStream>(raw_output_.get());
+      std::make_unique<google::protobuf::io::FileOutputStream>(write_fd_);
+  kythe_output_ = std::make_unique<kythe::FileOutputStream>(raw_output_.get());
   kythe_output_->set_show_stats(absl::GetFlag(FLAGS_cache_stats));
   kythe_output_->set_flush_after_each_entry(
       absl::GetFlag(FLAGS_flush_after_each_entry));
@@ -320,7 +320,7 @@ void IndexerContext::CloseOutputStreams() {
 
 void IndexerContext::OpenHashCache() {
   if (!absl::GetFlag(FLAGS_cache).empty()) {
-    auto memcache_hash_cache = absl::make_unique<MemcachedHashCache>();
+    auto memcache_hash_cache = std::make_unique<MemcachedHashCache>();
     CHECK(memcache_hash_cache->OpenMemcache(absl::GetFlag(FLAGS_cache)));
     memcache_hash_cache->SetSizeLimits(absl::GetFlag(FLAGS_min_size),
                                        absl::GetFlag(FLAGS_max_size));
diff --git a/kythe/cxx/indexer/cxx/indexer_worklist.cc b/kythe/cxx/indexer/cxx/indexer_worklist.cc
index bfa4dfda3..0ce569dd8 100644
--- a/kythe/cxx/indexer/cxx/indexer_worklist.cc
+++ b/kythe/cxx/indexer/cxx/indexer_worklist.cc
@@ -16,7 +16,8 @@
 
 #include "kythe/cxx/indexer/cxx/indexer_worklist.h"
 
-#include "absl/memory/memory.h"
+#include <memory>
+
 #include "kythe/cxx/indexer/cxx/IndexerASTHooks.h"
 
 namespace kythe {
@@ -29,7 +30,7 @@ class IndexerWorklistImpl : public IndexerWorklist {
   void EnqueueJobForImplicitDecl(clang::Decl* decl,
                                  bool set_prune_incomplete_functions,
                                  const std::string& id) override {
-    worklist_.emplace_back(absl::make_unique<IndexJob>(
+    worklist_.emplace_back(std::make_unique<IndexJob>(
         indexer_->getCurrentJob(), decl, set_prune_incomplete_functions, id));
   }
 
@@ -56,6 +57,6 @@ class IndexerWorklistImpl : public IndexerWorklist {
 
 std::unique_ptr<IndexerWorklist> IndexerWorklist::CreateDefaultWorklist(
     IndexerASTVisitor* indexer) {
-  return absl::make_unique<IndexerWorklistImpl>(indexer);
+  return std::make_unique<IndexerWorklistImpl>(indexer);
 }
 }  // namespace kythe
diff --git a/kythe/cxx/tools/fyi/BUILD b/kythe/cxx/tools/fyi/BUILD
index 2634e6d35..a64481e30 100644
--- a/kythe/cxx/tools/fyi/BUILD
+++ b/kythe/cxx/tools/fyi/BUILD
@@ -26,7 +26,6 @@ cc_binary(
         "//third_party/llvm/src:clang_builtin_headers",
         "@com_github_google_glog//:glog",
         "@com_google_absl//absl/flags:usage",
-        "@com_google_absl//absl/memory",
         "@com_google_absl//absl/strings",
         "@com_google_absl//absl/strings:str_format",
         "@com_google_protobuf//:protobuf",
diff --git a/kythe/cxx/tools/fyi/fyi.cc b/kythe/cxx/tools/fyi/fyi.cc
index 088e0544b..e44e5ac77 100644
--- a/kythe/cxx/tools/fyi/fyi.cc
+++ b/kythe/cxx/tools/fyi/fyi.cc
@@ -16,7 +16,8 @@
 
 #include "kythe/cxx/tools/fyi/fyi.h"
 
-#include "absl/memory/memory.h"
+#include <memory>
+
 #include "absl/strings/str_cat.h"
 #include "absl/strings/str_format.h"
 #include "clang/Frontend/ASTUnit.h"
@@ -321,9 +322,9 @@ class Action : public clang::ASTFrontendAction,
     if (tracker_->state() == FileTracker::State::kBusy) {
       tracker_->BeginPass();
       compiler.getPreprocessor().addPPCallbacks(
-          absl::make_unique<PreprocessorHooks>(this));
+          std::make_unique<PreprocessorHooks>(this));
     }
-    return absl::make_unique<clang::ASTConsumer>();
+    return std::make_unique<clang::ASTConsumer>();
   }
 
   /// \copydoc ASTFrontendAction::ExecuteAction
diff --git a/kythe/cxx/tools/fyi/fyi_main.cc b/kythe/cxx/tools/fyi/fyi_main.cc
index d7d91bf95..cd895ee91 100644
--- a/kythe/cxx/tools/fyi/fyi_main.cc
+++ b/kythe/cxx/tools/fyi/fyi_main.cc
@@ -14,8 +14,9 @@
  * limitations under the License.
  */
 
+#include <memory>
+
 #include "absl/flags/usage.h"
-#include "absl/memory/memory.h"
 #include "clang/Tooling/CommonOptionsParser.h"
 #include "clang/Tooling/Tooling.h"
 #include "glog/logging.h"
@@ -45,8 +46,8 @@ int main(int argc, const char** argv) {
     return 1;
   }
   kythe::JsonClient::InitNetwork();
-  auto xrefs_db = absl::make_unique<kythe::XrefsJsonClient>(
-      absl::make_unique<kythe::JsonClient>(), xrefs);
+  auto xrefs_db = std::make_unique<kythe::XrefsJsonClient>(
+      std::make_unique<kythe::JsonClient>(), xrefs);
   clang::tooling::ClangTool tool(options->getCompilations(),
                                  options->getSourcePathList());
   kythe::fyi::ActionFactory factory(std::move(xrefs_db), 5);
diff --git a/kythe/cxx/verifier/BUILD b/kythe/cxx/verifier/BUILD
index 6c6661730..54856d0f8 100644
--- a/kythe/cxx/verifier/BUILD
+++ b/kythe/cxx/verifier/BUILD
@@ -160,7 +160,6 @@ cc_library(
         "//kythe/proto:storage_cc_proto",
         "@com_github_google_glog//:glog",
         "@com_google_absl//absl/container:flat_hash_map",
-        "@com_google_absl//absl/memory",
         "@com_google_absl//absl/strings",
         "@com_google_absl//absl/strings:str_format",
         "@com_google_absl//absl/types:span",
diff --git a/kythe/cxx/verifier/verifier.cc b/kythe/cxx/verifier/verifier.cc
index e006c47ff..9a27fd500 100644
--- a/kythe/cxx/verifier/verifier.cc
+++ b/kythe/cxx/verifier/verifier.cc
@@ -21,7 +21,8 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include "absl/memory/memory.h"
+#include <memory>
+
 #include "absl/strings/strip.h"
 #include "assertions.h"
 #include "glog/logging.h"
@@ -695,7 +696,7 @@ void Verifier::SetGoalCommentPrefix(const std::string& it) {
 
 bool Verifier::SetGoalCommentRegex(const std::string& regex,
                                    std::string* error) {
-  auto re2 = absl::make_unique<RE2>(regex);
+  auto re2 = std::make_unique<RE2>(regex);
   if (re2->error_code() != RE2::NoError) {
     if (error) {
       *error = re2->error();


Test patch:
diff --git a/kythe/cxx/common/net_client_test.cc b/kythe/cxx/common/net_client_test.cc
index c450e1c42..409402c9d 100644
--- a/kythe/cxx/common/net_client_test.cc
+++ b/kythe/cxx/common/net_client_test.cc
@@ -16,11 +16,11 @@
 
 #include "kythe/cxx/common/net_client.h"
 
+#include <memory>
 #include <string>
 
 #include "absl/flags/flag.h"
 #include "absl/flags/parse.h"
-#include "absl/memory/memory.h"
 #include "glog/logging.h"
 #include "kythe/cxx/common/json_proto.h"
 #include "kythe/proto/common.pb.h"
@@ -31,7 +31,7 @@ ABSL_FLAG(std::string, xrefs, "http://localhost:8080",
 
 namespace {
 void TestNodeRequest() {
-  kythe::XrefsJsonClient client(absl::make_unique<kythe::JsonClient>(),
+  kythe::XrefsJsonClient client(std::make_unique<kythe::JsonClient>(),
                                 absl::GetFlag(FLAGS_xrefs));
   kythe::proto::NodesRequest request;
   kythe::proto::NodesReply response;
diff --git a/kythe/cxx/extractor/cxx_extractor_test.cc b/kythe/cxx/extractor/cxx_extractor_test.cc
index e1d9b2bb7..398273481 100644
--- a/kythe/cxx/extractor/cxx_extractor_test.cc
+++ b/kythe/cxx/extractor/cxx_extractor_test.cc
@@ -17,8 +17,8 @@
 #include "cxx_extractor.h"
 
 #include <map>
+#include <memory>
 
-#include "absl/memory/memory.h"
 #include "clang/Frontend/FrontendActions.h"
 #include "clang/Tooling/Tooling.h"
 #include "glog/logging.h"
@@ -211,7 +211,7 @@ class CxxExtractorTest : public testing::Test {
             const HeaderSearchInfo* header_search_info, bool had_errors) {
           index_writer.WriteIndex(
               supported_language::Language::kCpp,
-              absl::make_unique<ForwardingCompilationWriterSink>(sink),
+              std::make_unique<ForwardingCompilationWriterSink>(sink),
               main_source_file, transcript, source_files, header_search_info,
               had_errors, ".");
         });
diff --git a/kythe/cxx/extractor/testdata/BUILD b/kythe/cxx/extractor/testdata/BUILD
index fbe549f67..82ffd7f7b 100644
--- a/kythe/cxx/extractor/testdata/BUILD
+++ b/kythe/cxx/extractor/testdata/BUILD
@@ -101,7 +101,6 @@ cc_test(
         "//kythe/cxx/extractor:supported_language",
         "//third_party:gmock_main",
         "//third_party:gtest",
-        "@com_google_absl//absl/memory",
         "@com_google_protobuf//:protobuf",
     ],
 )
diff --git a/kythe/cxx/extractor/testdata/claim_pragma_test.cc b/kythe/cxx/extractor/testdata/claim_pragma_test.cc
index 077ec4f55..660c64a1a 100644
--- a/kythe/cxx/extractor/testdata/claim_pragma_test.cc
+++ b/kythe/cxx/extractor/testdata/claim_pragma_test.cc
@@ -3,7 +3,7 @@
 #include <unordered_set>
 #include <vector>
 
-#include "absl/memory/memory.h"
+#include <memory> 
 #include "gmock/gmock.h"
 #include "google/protobuf/text_format.h"
 #include "google/protobuf/util/field_comparator.h"
@@ -260,7 +260,7 @@ TEST(ClaimPragmaTest, ClaimPragmaIsSupported) {
   int call_count = 0;
   EXPECT_TRUE(extractor.Extract(
       supported_language::Language::kCpp,
-      absl::make_unique<FakeCompilationWriterSink>(&call_count)));
+      std::make_unique<FakeCompilationWriterSink>(&call_count)));
   EXPECT_EQ(call_count, 1);
 }
 
diff --git a/kythe/cxx/indexer/cxx/KytheIndexerUnitTest.cc b/kythe/cxx/indexer/cxx/KytheIndexerUnitTest.cc
index de6ef184a..2c27dacbd 100644
--- a/kythe/cxx/indexer/cxx/KytheIndexerUnitTest.cc
+++ b/kythe/cxx/indexer/cxx/KytheIndexerUnitTest.cc
@@ -26,7 +26,6 @@
 #include <utility>
 
 #include "IndexerFrontendAction.h"
-#include "absl/memory/memory.h"
 #include "clang/AST/ASTConsumer.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/RecursiveASTVisitor.h"
@@ -382,8 +381,8 @@ TEST(KytheIndexerUnitTest, TrivialHappyCase) {
   LibrarySupports no_supports;
   IndexerOptions options{};
   std::unique_ptr<clang::FrontendAction> Action =
-      absl::make_unique<IndexerFrontendAction>(&observer, nullptr, &no_supports,
-                                               options);
+      std::make_unique<IndexerFrontendAction>(&observer, nullptr, &no_supports,
+                                              options);
   ASSERT_TRUE(
       RunToolOnCode(std::move(Action), "int main() {}", "valid_main.cc"));
 }
@@ -441,8 +440,8 @@ TEST(KytheIndexerUnitTest, PushFilePopFileTracking) {
   LibrarySupports no_supports;
   IndexerOptions options{};
   std::unique_ptr<clang::FrontendAction> Action =
-      absl::make_unique<IndexerFrontendAction>(&Observer, nullptr, &no_supports,
-                                               options);
+      std::make_unique<IndexerFrontendAction>(&Observer, nullptr, &no_supports,
+                                              options);
   ASSERT_TRUE(RunToolOnCode(std::move(Action), "int i;", "main.cc"));
   ASSERT_FALSE(Observer.hadUnderrun());
   ASSERT_EQ(0, Observer.getFileNameStackSize());