summaryrefslogtreecommitdiff
path: root/lib/Debugger/ProgramInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Debugger/ProgramInfo.cpp')
-rw-r--r--lib/Debugger/ProgramInfo.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Debugger/ProgramInfo.cpp b/lib/Debugger/ProgramInfo.cpp
index 2bf993ce5a..125ff556dd 100644
--- a/lib/Debugger/ProgramInfo.cpp
+++ b/lib/Debugger/ProgramInfo.cpp
@@ -117,10 +117,10 @@ SourceFileInfo::SourceFileInfo(const GlobalVariable *Desc,
if (ConstantInt *CUI = dyn_cast<ConstantInt>(CS->getOperand(1)))
Version = CUI->getZExtValue();
- const char *SI = GetConstantStringInfo(CS->getOperand(3));
- BaseName = (SI ? SI : "");
- SI = GetConstantStringInfo(CS->getOperand(4));
- Directory = (SI ? SI : "");
+ if (!GetConstantStringInfo(CS->getOperand(3), BaseName))
+ BaseName = "";
+ if (!GetConstantStringInfo(CS->getOperand(4), Directory))
+ Directory = "";
}
}
@@ -160,8 +160,8 @@ SourceFunctionInfo::SourceFunctionInfo(ProgramInfo &PI,
SourceFile = &PI.getSourceFile(GV);
// Entry #2 is the function name.
- const char *SI = GetConstantStringInfo(CS->getOperand(2));
- Name = (SI ? SI : "");
+ if (!GetConstantStringInfo(CS->getOperand(2), Name))
+ Name = "";
}
}