aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorManman Ren <mren@apple.com>2013-03-13 18:41:27 +0000
committerManman Ren <mren@apple.com>2013-03-13 18:41:27 +0000
commit4c6f895205993b2e724a6025a34d0601135e8b18 (patch)
treee8b1654a2135f82b4b7fc83262abf52102e0f798 /lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parentb1e052aa1b9e52d12831f86a1ee0fcf0c4030f1b (diff)
No functionality change. Use unreachable in getCUOffset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176963 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 2da0bb3364..b169602b0e 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1889,13 +1889,15 @@ void DwarfUnits::emitUnits(DwarfDebug *DD,
/// For a given compile unit DIE, returns offset from beginning of debug info.
unsigned DwarfUnits::getCUOffset(DIE *Die) {
+ assert(Die->getTag() == dwarf::DW_TAG_compile_unit &&
+ "Input DIE should be compile unit in getCUOffset.");
for (SmallVector<CompileUnit *, 1>::iterator I = CUs.begin(),
E = CUs.end(); I != E; ++I) {
CompileUnit *TheCU = *I;
if (TheCU->getCUDie() == Die)
return TheCU->getDebugInfoOffset();
}
- return 0;
+ llvm_unreachable("The compile unit DIE should belong to CUs in DwarfUnits.");
}
// Emit the debug info section.