summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-06-15 21:45:50 +0000
committerDevang Patel <dpatel@apple.com>2009-06-15 21:45:50 +0000
commit56e6fe16424016f64a0682fd5f092f405d085997 (patch)
treefffa5daef68caceb30d63ba1f93808e6c261460d /llvm/lib/CodeGen
parentb9bff5880a34c105f643fb7660c26a07c4257bf3 (diff)
downloadbcm5719-llvm-56e6fe16424016f64a0682fd5f092f405d085997.tar.gz
bcm5719-llvm-56e6fe16424016f64a0682fd5f092f405d085997.zip
Gracefully handle imbalanced inline function begin and end markers.
llvm-svn: 73426
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp9
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp2
2 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index c773378bb01..1e04e2a67d6 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1850,7 +1850,14 @@ unsigned DwarfDebug::RecordInlinedFnEnd(DISubprogram &SP) {
}
SmallVector<DbgScope *, 8> &Scopes = I->second;
- assert(!Scopes.empty() && "We should have at least one debug scope!");
+ if (Scopes.empty()) {
+ // Returned ID is 0 if this is unbalanced "end of inlined
+ // scope". This could happen if optimizer eats dbg intrinsics
+ // or "beginning of inlined scope" is not recoginized due to
+ // missing location info. In such cases, ignore this region.end.
+ return 0;
+ }
+
DbgScope *Scope = Scopes.back(); Scopes.pop_back();
unsigned ID = MMI->NextLabelID();
MMI->RecordUsedDbgLabel(ID);
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 4a7dbebe2de..26e33b80087 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -361,7 +361,7 @@ bool FastISel::SelectCall(User *I) {
// Returned ID is 0 if this is unbalanced "end of inlined
// scope". This could happen if optimizer eats dbg intrinsics
// or "beginning of inlined scope" is not recoginized due to
- // missing location info. In such cases, do ignore this region.end.
+ // missing location info. In such cases, ignore this region.end.
BuildMI(MBB, DL, II).addImm(ID);
} else {
const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
OpenPOWER on IntegriCloud