summaryrefslogtreecommitdiff
path: root/lib/Analysis/DbgInfoPrinter.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-03-13 04:37:11 +0000
committerBill Wendling <isanbard@gmail.com>2009-03-13 04:37:11 +0000
commitc7a09ab3110b9462ad9646cb60c22c8527491ad9 (patch)
treedb612124a57fb8f23dfadbf625ea75d22512bc18 /lib/Analysis/DbgInfoPrinter.cpp
parent77502c93442c5953c05e39fcd4c17d9e2aca766f (diff)
downloadllvm-c7a09ab3110b9462ad9646cb60c22c8527491ad9.tar.gz
llvm-c7a09ab3110b9462ad9646cb60c22c8527491ad9.tar.bz2
llvm-c7a09ab3110b9462ad9646cb60c22c8527491ad9.tar.xz
Temporarily XFAIL this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66866 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DbgInfoPrinter.cpp')
-rw-r--r--lib/Analysis/DbgInfoPrinter.cpp48
1 files changed, 22 insertions, 26 deletions
diff --git a/lib/Analysis/DbgInfoPrinter.cpp b/lib/Analysis/DbgInfoPrinter.cpp
index e43bc81ffa..6346a90a68 100644
--- a/lib/Analysis/DbgInfoPrinter.cpp
+++ b/lib/Analysis/DbgInfoPrinter.cpp
@@ -33,31 +33,29 @@ static cl::opt<bool>
PrintDirectory("print-fullpath", cl::desc("Print fullpath when printing debug info"), cl::Hidden);
namespace {
- struct VISIBILITY_HIDDEN PrintDbgInfo : public FunctionPass {
+ struct VISIBILITY_HIDDEN PrintDbgInfo : public FunctionPass {
private:
raw_ostream &Out;
void printStopPoint(const DbgStopPointInst *DSI);
void printFuncStart(const DbgFuncStartInst *FS);
void printVariableDeclaration(const Value *V);
- public:
- static char ID; // Pass identification
- PrintDbgInfo() : FunctionPass(&ID), Out(outs()) {}
+ public:
+ static char ID; // Pass identification
+ PrintDbgInfo() : FunctionPass(&ID), Out(outs()) {}
- virtual bool runOnFunction(Function &F);
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
-
- };
- char PrintDbgInfo::ID = 0;
- static RegisterPass<PrintDbgInfo> X("print-dbginfo",
- "Print debug info in human readable form");
+ virtual bool runOnFunction(Function &F);
+ virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ AU.setPreservesAll();
+ }
+ };
+ char PrintDbgInfo::ID = 0;
+ static RegisterPass<PrintDbgInfo> X("print-dbginfo",
+ "Print debug info in human readable form");
}
FunctionPass *llvm::createDbgInfoPrinterPass() { return new PrintDbgInfo(); }
-void PrintDbgInfo::printVariableDeclaration(const Value *V)
-{
+void PrintDbgInfo::printVariableDeclaration(const Value *V) {
std::string DisplayName, File, Directory, Type;
unsigned LineNo;
if (getLocationInfo(V, DisplayName, Type, LineNo, File, Directory)) {
@@ -75,24 +73,22 @@ void PrintDbgInfo::printVariableDeclaration(const Value *V)
void PrintDbgInfo::printStopPoint(const DbgStopPointInst *DSI)
{
if (PrintDirectory) {
- std::string dir;
- GetConstantStringInfo(DSI->getDirectory(), dir);
- Out << dir << "/";
+ const char *Dir = GetConstantStringInfo(DSI->getDirectory());
+ Out << (Dir ? Dir : "") << "/";
}
- std::string file;
- GetConstantStringInfo(DSI->getFileName(), file);
- Out << file << ":" << DSI->getLine();
- if (unsigned Col = DSI->getColumn()) {
+
+ const char *FN = GetConstantStringInfo(DSI->getFileName());
+ Out << (FN ? FN : "") << ":" << DSI->getLine();
+
+ if (unsigned Col = DSI->getColumn())
Out << ":" << Col;
- }
}
void PrintDbgInfo::printFuncStart(const DbgFuncStartInst *FS)
{
DISubprogram Subprogram(cast<GlobalVariable>(FS->getSubprogram()));
- std::string Res1, Res2;
- Out << ";fully qualified function name: " << Subprogram.getDisplayName(Res1)
- << " return type: " << Subprogram.getType().getName(Res2)
+ Out << ";fully qualified function name: " << Subprogram.getDisplayName()
+ << " return type: " << Subprogram.getType().getName()
<< " at line " << Subprogram.getLineNumber()
<< "\n\n";
}