Fix more -Wcast-qual warnings.
authorDan Gohman <gohman@apple.com>
Sat, 17 Apr 2010 17:44:03 +0000 (17:44 +0000)
committerDan Gohman <gohman@apple.com>
Sat, 17 Apr 2010 17:44:03 +0000 (17:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101656 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-ld/llvm-ld.cpp
tools/lto/LTOCodeGenerator.cpp

index 29b74b8a72bf9595d9bb32dd46046019956d19dd..ce52b59f0d26742a669db4d6a2acdbfbec200fee 100644 (file)
@@ -399,7 +399,7 @@ static int GenerateNative(const std::string &OutputFilename,
 
   // Run the compiler to assembly and link together the program.
   int R = sys::Program::ExecuteAndWait(
-    gcc, &Args[0], (const char**)clean_env, 0, 0, 0, &ErrMsg);
+    gcc, &Args[0], const_cast<const char **>(clean_env), 0, 0, 0, &ErrMsg);
   delete [] clean_env;
   return R;
 }
index bc65b3afc28a369044542f0f40e4637dac845955..3ce22e5de41111c0673d2268161bf5945f64aadd 100644 (file)
@@ -370,7 +370,7 @@ bool LTOCodeGenerator::generateAssemblyCode(formatted_raw_ostream& out,
     // if options were requested, set them
     if ( !_codegenOptions.empty() )
         cl::ParseCommandLineOptions(_codegenOptions.size(), 
-                                                (char**)&_codegenOptions[0]);
+                                    const_cast<char **>(&_codegenOptions[0]));
 
     // Instantiate the pass manager to organize the passes.
     PassManager passes;