Need to throw std::string not const char* if we want error messages to be
authorReid Spencer <rspencer@reidspencer.com>
Mon, 30 Aug 2004 00:06:52 +0000 (00:06 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Mon, 30 Aug 2004 00:06:52 +0000 (00:06 +0000)
caught.

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

tools/llvmc/llvmc.cpp

index ad0d2187aaea18d2e0172ac4b8d90698fe06b6b6..0f8662382ca853321639f75d99ad917dafabc76d 100644 (file)
@@ -216,13 +216,13 @@ int main(int argc, char **argv) {
 
     // Deal with unimplemented options.
     if (PipeCommands)
-      throw "Not implemented yet: -pipe";
+      throw std::string("Not implemented yet: -pipe");
 
     if (OutputFilename.empty())
       if (OptLevel == CompilerDriver::LINKING)
         OutputFilename = "a.out";
       else
-        throw "An output file must be specified. Please use the -o option";
+        throw std::string("An output file must be specified. Please use the -o option");
 
     // Construct the ConfigDataProvider object
     LLVMC_ConfigDataProvider Provider;
@@ -300,7 +300,7 @@ int main(int argc, char **argv) {
     // Tell the driver to do its thing
     int result = CD->execute(InpList,sys::Path(OutputFilename));
     if (result != 0) {
-      throw "Error executing actions. Terminated.\n";
+      throw std::string("Error executing actions. Terminated.");
       return result;
     }