summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-04-15 20:11:08 +0000
committerDevang Patel <dpatel@apple.com>2009-04-15 20:11:08 +0000
commit2738d7312acc0115aee9b60d97237551b5c0d123 (patch)
treee190953d4f5ff34cb3254b83d80bc30fd8bd5f62 /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
parent8aa28b9c34f38f85b17ea1486682ec8fc7dd7b3b (diff)
downloadbcm5719-llvm-2738d7312acc0115aee9b60d97237551b5c0d123.tar.gz
bcm5719-llvm-2738d7312acc0115aee9b60d97237551b5c0d123.zip
Add DISubprogram is not null check.
This fixes test/CodeGen//2009-01-21-invalid-debug-info.m test case. llvm-svn: 69210
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index e9cc391778b..71092c1d612 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -357,11 +357,13 @@ bool FastISel::SelectCall(User *I) {
if (DW && DW->ValidDebugInfo(REI->getContext(), true)) {
unsigned ID = 0;
DISubprogram Subprogram(cast<GlobalVariable>(REI->getContext()));
- if (!Subprogram.describes(MF.getFunction())) {
+ if (!Subprogram.isNull() && !Subprogram.describes(MF.getFunction())) {
// This is end of an inlined function.
const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
ID = DW->RecordInlinedFnEnd(Subprogram);
- BuildMI(MBB, DL, II).addImm(ID);
+ if (ID)
+ // If ID is 0 then this was not an end of inlined region.
+ BuildMI(MBB, DL, II).addImm(ID);
} else {
const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
ID = DW->RecordRegionEnd(cast<GlobalVariable>(REI->getContext()));
OpenPOWER on IntegriCloud