]> granicus.if.org Git - clang/commitdiff
Improve const-ness
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 17 Apr 2015 00:19:34 +0000 (00:19 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 17 Apr 2015 00:19:34 +0000 (00:19 +0000)
This allows callers to pass a char ** (such as the one coming from the
standard decreed main declaration - even though everyone usually puts
const on that themselves).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235150 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Tooling/CompilationDatabase.h
lib/Tooling/CompilationDatabase.cpp

index 27c16524e62ee6fc39f86f73b1bb6cf921d3fb15..e5b95af3aef4167e65719da97bccd28039d4477b 100644 (file)
@@ -178,7 +178,7 @@ public:
   /// \param Argv Points to the command line arguments.
   /// \param Directory The base directory used in the FixedCompilationDatabase.
   static FixedCompilationDatabase *loadFromCommandLine(int &Argc,
-                                                       const char **Argv,
+                                                       const char *const *Argv,
                                                        Twine Directory = ".");
 
   /// \brief Constructs a compilation data base from a specified directory
index 73564376a5854be99538ea07d45ee3a21d832f8c..2514f027f4727ca07a19384640229d343561d9d2 100644 (file)
@@ -283,11 +283,9 @@ static bool stripPositionalArgs(std::vector<const char *> Args,
   return true;
 }
 
-FixedCompilationDatabase *
-FixedCompilationDatabase::loadFromCommandLine(int &Argc,
-                                              const char **Argv,
-                                              Twine Directory) {
-  const char **DoubleDash = std::find(Argv, Argv + Argc, StringRef("--"));
+FixedCompilationDatabase *FixedCompilationDatabase::loadFromCommandLine(
+    int &Argc, const char *const *Argv, Twine Directory) {
+  const char *const *DoubleDash = std::find(Argv, Argv + Argc, StringRef("--"));
   if (DoubleDash == Argv + Argc)
     return nullptr;
   std::vector<const char *> CommandLine(DoubleDash + 1, Argv + Argc);