Delete PHI nodes that are not dead but are locked in a cycle of single
[oota-llvm.git] / lib / Debugger / ProgramInfo.cpp
index d6a4532b4f5997be72219b0b809fcf36f171b118..17175c4e4cf1beafc5de4076d365dcb7992695d8 100644 (file)
@@ -20,7 +20,6 @@
 #include "llvm/Module.h"
 #include "llvm/Debugger/SourceFile.h"
 #include "llvm/Debugger/SourceLanguage.h"
-#include "llvm/Support/FileUtilities.h"
 #include "llvm/Support/SlowOperationInformer.h"
 #include "llvm/ADT/STLExtras.h"
 #include <iostream>
@@ -170,11 +169,16 @@ SourceFileInfo::~SourceFileInfo() {
 
 SourceFile &SourceFileInfo::getSourceText() const {
   // FIXME: this should take into account the source search directories!
-  if (SourceText == 0)  // Read the file in if we haven't already.
-    if (!Directory.empty() && FileOpenable(Directory+"/"+BaseName))
-      SourceText = new SourceFile(Directory+"/"+BaseName, Descriptor);
+  if (SourceText == 0) { // Read the file in if we haven't already.
+    sys::Path tmpPath;
+    if (!Directory.empty())
+      tmpPath.setDirectory(Directory);
+    tmpPath.appendFile(BaseName);
+    if (tmpPath.readable())
+      SourceText = new SourceFile(tmpPath.toString(), Descriptor);
     else
       SourceText = new SourceFile(BaseName, Descriptor);
+  }
   return *SourceText;
 }
 
@@ -231,9 +235,10 @@ void SourceFunctionInfo::getSourceLocation(unsigned &RetLineNo,
 // ProgramInfo implementation
 //
 
-ProgramInfo::ProgramInfo(Module *m) : M(m) {
+ProgramInfo::ProgramInfo(Module *m) : M(m), ProgramTimeStamp(0,0) {
   assert(M && "Cannot create program information with a null module!");
-  ProgramTimeStamp = getFileTimestamp(M->getModuleIdentifier());
+  sys::Path modulePath(M->getModuleIdentifier());
+  ProgramTimeStamp = modulePath.getTimestamp();
 
   SourceFilesIsComplete = false;
   SourceFunctionsIsComplete = false;