Make CanFallThrough more intelligent (so it can handle blocks with (e.g.) no
[oota-llvm.git] / lib / Debugger / ProgramInfo.cpp
index 66d38f73ca853c6bd816a76012dd969063528882..7e12cf80d6d7cb60cadffa64678ecaee2a724c4f 100644 (file)
@@ -114,8 +114,8 @@ SourceFileInfo::SourceFileInfo(const GlobalVariable *Desc,
   if (Desc && Desc->hasInitializer())
     if (ConstantStruct *CS = dyn_cast<ConstantStruct>(Desc->getInitializer()))
       if (CS->getNumOperands() > 4) {
-        if (ConstantUInt *CUI = dyn_cast<ConstantUInt>(CS->getOperand(1)))
-          Version = CUI->getValue();
+        if (ConstantInt *CUI = dyn_cast<ConstantInt>(CS->getOperand(1)))
+          Version = CUI->getZExtValue();
 
         BaseName  = CS->getOperand(3)->getStringValue();
         Directory = CS->getOperand(4)->getStringValue();
@@ -196,8 +196,9 @@ void SourceFunctionInfo::getSourceLocation(unsigned &RetLineNo,
 
 ProgramInfo::ProgramInfo(Module *m) : M(m), ProgramTimeStamp(0,0) {
   assert(M && "Cannot create program information with a null module!");
-  sys::Path modulePath(M->getModuleIdentifier());
-  ProgramTimeStamp = modulePath.getTimestamp();
+  sys::FileStatus Stat;
+  if (!sys::Path(M->getModuleIdentifier()).getFileStatus(Stat))
+    ProgramTimeStamp = Stat.getTimestamp();
 
   SourceFilesIsComplete = false;
   SourceFunctionsIsComplete = false;
@@ -236,8 +237,8 @@ ProgramInfo::getSourceFile(const GlobalVariable *Desc) {
   if (Desc && Desc->hasInitializer())
     if (ConstantStruct *CS = dyn_cast<ConstantStruct>(Desc->getInitializer()))
       if (CS->getNumOperands() > 2)
-        if (ConstantUInt *CUI = dyn_cast<ConstantUInt>(CS->getOperand(2)))
-          LangID = CUI->getValue();
+        if (ConstantInt *CUI = dyn_cast<ConstantInt>(CS->getOperand(2)))
+          LangID = CUI->getZExtValue();
 
   const SourceLanguage &Lang = SourceLanguage::get(LangID);
   SourceFileInfo *New = Lang.createSourceFileInfo(Desc, *this);