Recommit r251680 (also need to update clang test)
authorDehao Chen <dehao@google.com>
Fri, 30 Oct 2015 05:07:15 +0000 (05:07 +0000)
committerDehao Chen <dehao@google.com>
Fri, 30 Oct 2015 05:07:15 +0000 (05:07 +0000)
commit7ef85b4579dae5ddf5e318d7d5ae201131401483
tree3e6e8d09e4d79e513f1e6d5c1c89ebce61a2616f
parente185d0a214092ba8b9f7426f74dd81fe5e170e88
Recommit r251680 (also need to update clang test)

Update the discriminator assignment algorithm

* If a scope has already been assigned a discriminator, do not reassign a nested discriminator for it.
* If the file and line both match, even if the column does not match, we should assign a new discriminator for the stmt.

original code:
; #1 int foo(int i) {
; #2 if (i == 3 || i == 5) return 100; else return 99;
; #3 }

; i == 3: discriminator 0
; i == 5: discriminator 2
; return 100: discriminator 1
; return 99: discriminator 3

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251689 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/AddDiscriminators.cpp
test/Transforms/AddDiscriminators/oneline.ll [new file with mode: 0644]