[PATCH] D28521: [DebugInfo] Handle same locations in DILocation::getMergedLocation
Robert Lougher via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 10 11:25:57 PST 2017
rob.lougher created this revision.
rob.lougher added reviewers: aprantl, dblaikie.
rob.lougher added subscribers: llvm-commits, andreadb, gbedwell.
Revision 289661 introduced the function DILocation::getMergedLocation for merging of debug locations. At the time is was simply a stub which always returned no location. This patch modifies getMergedLocation to handle the case where the two locations are the same or can't be discriminated.
The patch:
- Changes getMergedLocation to use DILocation::canDiscriminate.
- Fixes DILocation::canDiscriminate to add checks for directory, column and discriminator.
- Updates SimplifyCFG HoistThenElseCodeToIf to remove redundant check.
The patch also adds an additional test to simplifycfg_sink_last_inst.ll - when the debug locations of the sunk instructions are the same we should now use that location for the common instruction.
OK to commit?
Thanks,
Rob.
https://reviews.llvm.org/D28521
Files:
include/llvm/IR/DebugInfoMetadata.h
lib/Transforms/InstCombine/InstCombinePHI.cpp
lib/Transforms/Utils/SimplifyCFG.cpp
test/DebugInfo/Generic/simplifycfg_sink_last_inst.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28521.83826.patch
Type: text/x-patch
Size: 5985 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170110/26f2d6c5/attachment.bin>
More information about the llvm-commits
mailing list