Revert "Use const DebugLoc&"
authorChandler Carruth <chandlerc@gmail.com>
Tue, 23 Apr 2019 01:42:07 +0000 (01:42 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 23 Apr 2019 01:42:07 +0000 (01:42 +0000)
commitbbddf21f900a868072710fbc8b424cc387a390aa
treefccff7971b03a544965ca2247a71db5c5066fddf
parent759805fd8a6c301b43a89a74700b750d19ba5f9a
Revert "Use const DebugLoc&"

This reverts r358910 (git commit 2b744665308fc8d30a3baecb4947f2bd81aa7d30)

While this patch *seems* trivial and safe and correct, it is not. The
copies are actually load bearing copies. You can observe this with MSan
or other ways of checking for use-after-destroy, but otherwise this may
result in ... difficult to debug inexplicable behavior.

I suspect the issue is that the debug location is used after the
original reference to it is removed. The metadata backing it gets
destroyed as its last references goes away, and then we reference it
later through these const references.

llvm-svn: 358940
llvm/lib/CodeGen/BranchRelaxation.cpp