diff options
author | Devang Patel <dpatel@apple.com> | 2009-04-15 20:11:08 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-04-15 20:11:08 +0000 |
commit | 8818b8f4437a56fc8f75a134f015c3b807e61f10 (patch) | |
tree | 720cd0ed4cb624685c88e971307d318273daf336 /lib/CodeGen/SelectionDAG | |
parent | c23e4968790395053f3f52aeb3342637fcaafdbf (diff) | |
download | external_llvm-8818b8f4437a56fc8f75a134f015c3b807e61f10.zip external_llvm-8818b8f4437a56fc8f75a134f015c3b807e61f10.tar.gz external_llvm-8818b8f4437a56fc8f75a134f015c3b807e61f10.tar.bz2 |
Add DISubprogram is not null check.
This fixes test/CodeGen//2009-01-21-invalid-debug-info.m test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69210 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG')
-rw-r--r-- | lib/CodeGen/SelectionDAG/FastISel.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index e9cc391..71092c1 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/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())); |