r271262 - [CommonOptionsParser] Return source paths as const ref.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Tue May 31 03:17:47 PDT 2016


Author: d0k
Date: Tue May 31 05:17:46 2016
New Revision: 271262

URL: http://llvm.org/viewvc/llvm-project?rev=271262&view=rev
Log:
[CommonOptionsParser] Return source paths as const ref.

This saves a superfluous copy and makes managing the lifetime of the
returned strings a bit easier.

Modified:
    cfe/trunk/include/clang/Tooling/CommonOptionsParser.h

Modified: cfe/trunk/include/clang/Tooling/CommonOptionsParser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Tooling/CommonOptionsParser.h?rev=271262&r1=271261&r2=271262&view=diff
==============================================================================
--- cfe/trunk/include/clang/Tooling/CommonOptionsParser.h (original)
+++ cfe/trunk/include/clang/Tooling/CommonOptionsParser.h Tue May 31 05:17:46 2016
@@ -98,7 +98,7 @@ public:
   }
 
   /// Returns a list of source file paths to process.
-  std::vector<std::string> getSourcePathList() {
+  const std::vector<std::string> &getSourcePathList() const {
     return SourcePathList;
   }
 




More information about the cfe-commits mailing list