diff options
author | Devang Patel <dpatel@apple.com> | 2009-01-15 23:41:32 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-01-15 23:41:32 +0000 |
commit | cf3a4487c0627d15d03fb6fedc10b58f6e2c9ebe (patch) | |
tree | b99fd06b4586d9db5e2df2549e1d6f9ec64707bd /lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | fa9c5eac33bef67e2faef166c902e3bb16efa30f (diff) |
Validate dbg_* intrinsics before lowering them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62286 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/FastISel.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index 5dd0afbae6..d797d909c8 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -317,7 +317,7 @@ bool FastISel::SelectCall(User *I) { default: break; case Intrinsic::dbg_stoppoint: { DbgStopPointInst *SPI = cast<DbgStopPointInst>(I); - if (DW && SPI->getContext()) { + if (DW && SPI->getContext() && DW->ValidDebugInfo(SPI->getContext())) { DICompileUnit CU(cast<GlobalVariable>(SPI->getContext())); unsigned SrcFile = DW->RecordSource(CU.getDirectory(), CU.getFilename()); @@ -331,7 +331,7 @@ bool FastISel::SelectCall(User *I) { } case Intrinsic::dbg_region_start: { DbgRegionStartInst *RSI = cast<DbgRegionStartInst>(I); - if (DW && RSI->getContext()) { + if (DW && RSI->getContext() && DW->ValidDebugInfo(RSI->getContext())) { unsigned ID = DW->RecordRegionStart(cast<GlobalVariable>(RSI->getContext())); const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); @@ -341,7 +341,7 @@ bool FastISel::SelectCall(User *I) { } case Intrinsic::dbg_region_end: { DbgRegionEndInst *REI = cast<DbgRegionEndInst>(I); - if (DW && REI->getContext()) { + if (DW && REI->getContext() && DW->ValidDebugInfo(REI->getContext())) { unsigned ID = DW->RecordRegionEnd(cast<GlobalVariable>(REI->getContext())); const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); @@ -353,7 +353,7 @@ bool FastISel::SelectCall(User *I) { if (!DW) return true; DbgFuncStartInst *FSI = cast<DbgFuncStartInst>(I); Value *SP = FSI->getSubprogram(); - if (SP) { + if (SP && DW->ValidDebugInfo(SP)) { // llvm.dbg.func.start implicitly defines a dbg_stoppoint which is // what (most?) gdb expects. DISubprogram Subprogram(cast<GlobalVariable>(SP)); @@ -375,7 +375,7 @@ bool FastISel::SelectCall(User *I) { case Intrinsic::dbg_declare: { DbgDeclareInst *DI = cast<DbgDeclareInst>(I); Value *Variable = DI->getVariable(); - if (DW && Variable) { + if (DW && Variable && DW->ValidDebugInfo(Variable)) { // Determine the address of the declared object. Value *Address = DI->getAddress(); if (BitCastInst *BCI = dyn_cast<BitCastInst>(Address)) |