#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Intrinsics.h"
-#include "llvm/iOther.h"
+#include "llvm/Instructions.h"
#include "llvm/Module.h"
#include "llvm/Debugger/SourceFile.h"
#include "llvm/Debugger/SourceLanguage.h"
-#include "Support/FileUtilities.h"
-#include "Support/SlowOperationInformer.h"
-#include "Support/STLExtras.h"
+#include "llvm/Support/SlowOperationInformer.h"
+#include "llvm/ADT/STLExtras.h"
#include <iostream>
using namespace llvm;
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;
}
// 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;