diff options
| author | Reid Kleckner <rnk@google.com> | 2017-05-12 17:02:40 +0000 |
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2017-05-12 17:02:40 +0000 |
| commit | 5bc8543a365d4ffa8ae5eef037b9e39163a93f08 (patch) | |
| tree | d9dc596280f7af9b24729e646ae7821b11d12d52 /llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp | |
| parent | 4f5771d71b95e284df478217b80b7251c49fbcbb (diff) | |
| download | bcm5719-llvm-5bc8543a365d4ffa8ae5eef037b9e39163a93f08.tar.gz bcm5719-llvm-5bc8543a365d4ffa8ae5eef037b9e39163a93f08.zip | |
[codeview] Fix assertion failure introduced in r295354 refactoring
CodeViewDebug sets Asm to nullptr to disable debug info generation. You
can get a .ll file like no-cus.ll from 'clang -gcodeview -g0', which
happens in the ubsan test suite.
llvm-svn: 302923
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp index 1d63e33a4d3..826162ad47c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp @@ -129,10 +129,9 @@ bool hasDebugInfo(const MachineModuleInfo *MMI, const MachineFunction *MF) { } void DebugHandlerBase::beginFunction(const MachineFunction *MF) { - assert(Asm); PrevInstBB = nullptr; - if (!hasDebugInfo(MMI, MF)) { + if (!Asm || !hasDebugInfo(MMI, MF)) { skippedNonDebugFunction(); return; } |

