SelectionDAG: Remove arbitrary and bug-prone complexity from SDLoc
authorJustin Bogner <mail@justinbogner.com>
Fri, 25 Mar 2016 22:12:41 +0000 (22:12 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 25 Mar 2016 22:12:41 +0000 (22:12 +0000)
commit27fa77e102ae716869f0daa0c96c5f3c71772f7b
treea10f43907a32067c12a2f809fe6eb0cc8490437e
parent82627648692657751d762e702f78a7901725cd24
SelectionDAG: Remove arbitrary and bug-prone complexity from SDLoc

The implementation of SDLoc has an extra layer of indirection here for
no particular reason, and was leading to problems where we were
dereferencing pointers to SDNodes that had already been deleted so
that we could get at the DebugLoc for a new SDNode. This is one of the
errors that came up often in PR26808.

Instead, we can just track the DebugLoc and IROrder directly. This
makes the code both easier to understand and more correct. It's also
basically NFC other than fixing a large number of places where we were
reading the memory of deleted SDNodes.

llvm-svn: 264470
llvm/include/llvm/CodeGen/SelectionDAGNodes.h