summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-06-05 23:10:19 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-06-05 23:10:19 +0000
commit45d638a3fdb2f6de8b5c8c7d59f476c00d60bd2e (patch)
tree92de84f7c76a2acade07b22a37605731fe6f4cf6 /llvm/lib/CodeGen
parent942f4bc488e26b0f3c17b66c69c1eac049661e76 (diff)
downloadbcm5719-llvm-45d638a3fdb2f6de8b5c8c7d59f476c00d60bd2e.tar.gz
bcm5719-llvm-45d638a3fdb2f6de8b5c8c7d59f476c00d60bd2e.zip
Fix null dereference with -debug-only=dwarfdebug
llvm-svn: 210299
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 46640f85f42..39bff0d1f7d 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1220,6 +1220,11 @@ DwarfDebug::collectVariableInfo(SmallPtrSet<const MDNode *, 16> &Processed) {
if (Begin->getNumOperands() > 1 && Begin->getOperand(0).isReg() &&
!Begin->getOperand(0).getReg())
continue;
+ DEBUG(dbgs() << "DotDebugLoc Pair:\n" << "\t" << *Begin);
+ if (End != nullptr)
+ DEBUG(dbgs() << "\t" << *End);
+ else
+ DEBUG(dbgs() << "\tNULL\n");
const MCSymbol *StartLabel = getLabelBeforeInsn(Begin);
assert(StartLabel && "Forgot label before DBG_VALUE starting a range!");
@@ -1233,8 +1238,6 @@ DwarfDebug::collectVariableInfo(SmallPtrSet<const MDNode *, 16> &Processed) {
EndLabel = getLabelBeforeInsn(std::next(I)->first);
assert(EndLabel && "Forgot label after instruction ending a range!");
- DEBUG(dbgs() << "DotDebugLoc Pair:\n"
- << "\t" << *Begin << "\t" << *End << "\n");
DebugLocEntry Loc(StartLabel, EndLabel, getDebugLocValue(Begin), TheCU);
if (DebugLoc.empty() || !DebugLoc.back().Merge(Loc))
DebugLoc.push_back(std::move(Loc));
OpenPOWER on IntegriCloud