[clang] 79dca25 - [InstallAPI] Replace std::string -> StringRef

Cyndy Ishida via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 12 22:08:10 PDT 2024


Author: Cyndy Ishida
Date: 2024-04-12T22:05:12-07:00
New Revision: 79dca25f4a0fefd47e9e37d9ce47d84dc0b3bedb

URL: https://github.com/llvm/llvm-project/commit/79dca25f4a0fefd47e9e37d9ce47d84dc0b3bedb
DIFF: https://github.com/llvm/llvm-project/commit/79dca25f4a0fefd47e9e37d9ce47d84dc0b3bedb.diff

LOG: [InstallAPI] Replace std::string -> StringRef

Added: 
    

Modified: 
    clang/tools/clang-installapi/Options.cpp

Removed: 
    


################################################################################
diff  --git a/clang/tools/clang-installapi/Options.cpp b/clang/tools/clang-installapi/Options.cpp
index 120ff3da899868..3dc61476ce09d9 100644
--- a/clang/tools/clang-installapi/Options.cpp
+++ b/clang/tools/clang-installapi/Options.cpp
@@ -372,7 +372,7 @@ bool Options::addFilePaths(InputArgList &Args, PathSeq &Headers,
       }
       // Sort headers to ensure deterministic behavior.
       sort(*InputHeadersOrErr);
-      for (std::string &H : *InputHeadersOrErr)
+      for (StringRef H : *InputHeadersOrErr)
         Headers.emplace_back(std::move(H));
     } else
       Headers.emplace_back(Path);
@@ -690,7 +690,7 @@ InstallAPIContext Options::createContext() {
     FrameworkName = getFrameworkNameFromInstallName(LinkerOpts.InstallName);
 
   // Process inputs.
-  for (const std::string &ListPath : DriverOpts.FileLists) {
+  for (const StringRef ListPath : DriverOpts.FileLists) {
     auto Buffer = FM->getBufferForFile(ListPath);
     if (auto Err = Buffer.getError()) {
       Diags->Report(diag::err_cannot_open_file) << ListPath << Err.message();


        


More information about the cfe-commits mailing list