[PATCH] [InstCombine] Fix a crash while generating debug output for replacements with debug info

Bjorn Steinbrink bsteinbr at gmail.com
Mon Jul 27 16:02:50 PDT 2015


Add() tries to produce debug output for the new instruction but is
currently called before the instruction is inserted into the function,
so it doesn't get a Module reference and goes on to dereference a null
pointer. Moving the call to Add() to a slightly later point avoid this
problem.

While at it, also adjust the other debug output that prints the new
value so that the value is fully setup and has a name instead of being
output as <badref>.
---
 .../InstCombine/InstructionCombining.cpp           | 13 +++++++------
 test/Transforms/InstCombine/debug-debuginfo.ll     | 22 ++++++++++++++++++++++
 2 files changed, 29 insertions(+), 6 deletions(-)
 create mode 100644 test/Transforms/InstCombine/debug-debuginfo.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-InstCombine-Fix-a-crash-while-generating-debug-outpu.patch
Type: text/x-patch
Size: 2643 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150728/b7ea5bef/attachment.bin>


More information about the llvm-commits mailing list