[llvm-commits] [llvm] r79872 - /llvm/trunk/lib/Support/GraphWriter.cpp

Chris Lattner sabre at nondot.org
Sun Aug 23 15:53:53 PDT 2009


Author: lattner
Date: Sun Aug 23 17:53:53 2009
New Revision: 79872

URL: http://llvm.org/viewvc/llvm-project?rev=79872&view=rev
Log:
fix some problems with my last patch which happen when one of
(HAVE_GV && (HAVE_DOT || HAVE_FDP || HAVE_NEATO || \
                   HAVE_TWOPI || HAVE_CIRCO))
are true.

Modified:
    llvm/trunk/lib/Support/GraphWriter.cpp

Modified: llvm/trunk/lib/Support/GraphWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/GraphWriter.cpp?rev=79872&r1=79871&r2=79872&view=diff

==============================================================================
--- llvm/trunk/lib/Support/GraphWriter.cpp (original)
+++ llvm/trunk/lib/Support/GraphWriter.cpp Sun Aug 23 17:53:53 2009
@@ -95,29 +95,24 @@
 
   // Find which program the user wants
 #if HAVE_DOT
-  if (program == GraphProgram::DOT) {
+  if (program == GraphProgram::DOT)
     prog = sys::Path(LLVM_PATH_DOT);
-  }
 #endif
 #if (HAVE_FDP)
-  if (program == GraphProgram::FDP) {
+  if (program == GraphProgram::FDP)
     prog = sys::Path(LLVM_PATH_FDP);
-  }
 #endif
 #if (HAVE_NEATO)
-  if (program == GraphProgram::NEATO) {
+  if (program == GraphProgram::NEATO)
     prog = sys::Path(LLVM_PATH_NEATO);
-    }
 #endif
 #if (HAVE_TWOPI)
-  if (program == GraphProgram::TWOPI) {
+  if (program == GraphProgram::TWOPI)
     prog = sys::Path(LLVM_PATH_TWOPI);
-  }
 #endif
 #if (HAVE_CIRCO)
-  if (program == GraphProgram::CIRCO) {
+  if (program == GraphProgram::CIRCO)
     prog = sys::Path(LLVM_PATH_CIRCO);
-  }
 #endif
 
   std::vector<const char*> args;
@@ -132,8 +127,9 @@
   
   errs() << "Running '" << prog << "' program... ";
 
-  if (sys::Program::ExecuteAndWait(prog, &args[0],0,0,0,0,&ErrMsg)) {
-     errs() << "Error viewing graph " << Filename << ": '" << ErrMsg << "\n";
+  if (sys::Program::ExecuteAndWait(prog, &args[0], 0, 0, 0, 0, &ErrMsg)) {
+     errs() << "Error viewing graph " << Filename.str() << ": '"
+            << ErrMsg << "\n";
   } else {
     errs() << " done. \n";
 
@@ -153,7 +149,7 @@
     }
     else {
        sys::Program::ExecuteNoWait(gv, &args[0],0,0,0,&ErrMsg);
-       errs() << "Remember to erase graph files: " << Filename << " "
+       errs() << "Remember to erase graph files: " << Filename.str() << " "
               << PSFilename << "\n";
     }
   }
@@ -167,7 +163,8 @@
   
   errs() << "Running 'dotty' program... ";
   if (sys::Program::ExecuteAndWait(dotty, &args[0],0,0,0,0,&ErrMsg)) {
-     errs() << "Error viewing graph " << Filename << ": " << ErrMsg << "\n";
+     errs() << "Error viewing graph " << Filename.str() << ": "
+            << ErrMsg << "\n";
   } else {
 #ifdef __MINGW32__ // Dotty spawns another app and doesn't wait until it returns
     return;





More information about the llvm-commits mailing list