[cfe-commits] r116199 - in /cfe/trunk: include/clang/Frontend/CompilerInstance.h lib/Frontend/CompilerInstance.cpp

Axel Naumann Axel.Naumann at cern.ch
Mon Oct 11 02:13:46 PDT 2010


Author: axel
Date: Mon Oct 11 04:13:46 2010
New Revision: 116199

URL: http://llvm.org/viewvc/llvm-project?rev=116199&view=rev
Log:
Tighten up constness of argv parameters to allow for string literals as argumants and to reflect actual (non-modifying) use.

Modified:
    cfe/trunk/include/clang/Frontend/CompilerInstance.h
    cfe/trunk/lib/Frontend/CompilerInstance.cpp

Modified: cfe/trunk/include/clang/Frontend/CompilerInstance.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/CompilerInstance.h?rev=116199&r1=116198&r2=116199&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/CompilerInstance.h (original)
+++ cfe/trunk/include/clang/Frontend/CompilerInstance.h Mon Oct 11 04:13:46 2010
@@ -474,7 +474,7 @@
   /// and replace any existing one with it.
   ///
   /// Note that this routine also replaces the diagnostic client.
-  void createDiagnostics(int Argc, char **Argv);
+  void createDiagnostics(int Argc, const char* const *Argv);
 
   /// Create a Diagnostic object with a the TextDiagnosticPrinter.
   ///
@@ -492,7 +492,8 @@
   ///
   /// \return The new object on success, or null on failure.
   static llvm::IntrusiveRefCntPtr<Diagnostic> 
-  createDiagnostics(const DiagnosticOptions &Opts, int Argc, char **Argv);
+  createDiagnostics(const DiagnosticOptions &Opts, int Argc,
+                    const char* const *Argv);
 
   /// Create the file manager and replace any existing one with it.
   void createFileManager();

Modified: cfe/trunk/lib/Frontend/CompilerInstance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=116199&r1=116198&r2=116199&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInstance.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInstance.cpp Mon Oct 11 04:13:46 2010
@@ -109,7 +109,7 @@
 }
 
 static void SetUpBuildDumpLog(const DiagnosticOptions &DiagOpts,
-                              unsigned argc, char **argv,
+                              unsigned argc, const char* const *argv,
                               Diagnostic &Diags) {
   std::string ErrorInfo;
   llvm::OwningPtr<llvm::raw_ostream> OS(
@@ -131,13 +131,13 @@
   Diags.setClient(new ChainedDiagnosticClient(Diags.takeClient(), Logger));
 }
 
-void CompilerInstance::createDiagnostics(int Argc, char **Argv) {
+void CompilerInstance::createDiagnostics(int Argc, const char* const *Argv) {
   Diagnostics = createDiagnostics(getDiagnosticOpts(), Argc, Argv);
 }
 
 llvm::IntrusiveRefCntPtr<Diagnostic> 
 CompilerInstance::createDiagnostics(const DiagnosticOptions &Opts,
-                                    int Argc, char **Argv) {
+                                    int Argc, const char* const *Argv) {
   llvm::IntrusiveRefCntPtr<Diagnostic> Diags(new Diagnostic());
 
   // Create the diagnostic client for reporting errors or for





More information about the cfe-commits mailing list