From 4e16b29c135a2b405d12d69f6b1f38ded2ceaa6f Mon Sep 17 00:00:00 2001 From: Anna Zaks Date: Tue, 23 Apr 2013 23:57:43 +0000 Subject: [analyzer] Refactor BugReport::getLocation and PathDiagnosticLocation::createEndOfPath for greater code reuse The 2 functions were computing the same location using different logic (each one had edge case bugs that the other one did not). Refactor them to rely on the same logic. The location of the warning reported in text/command line output format will now match that of the plist file. There is one change in the plist output as well. When reporting an error on a BinaryOperator, we use the location of the operator instead of the beginning of the BinaryOperator expression. This matches our output on command line and looks better in most cases. llvm-svn: 180165 --- clang/test/Analysis/conditional-operator-path-notes.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'clang/test/Analysis/conditional-operator-path-notes.c') diff --git a/clang/test/Analysis/conditional-operator-path-notes.c b/clang/test/Analysis/conditional-operator-path-notes.c index c781ddf8330..a8af394a26d 100644 --- a/clang/test/Analysis/conditional-operator-path-notes.c +++ b/clang/test/Analysis/conditional-operator-path-notes.c @@ -242,12 +242,12 @@ void testBinaryLHSProblem(int *p) { // CHECK-NEXT: // CHECK-NEXT: // CHECK-NEXT: line10 -// CHECK-NEXT: col3 +// CHECK-NEXT: col6 // CHECK-NEXT: file0 // CHECK-NEXT: // CHECK-NEXT: // CHECK-NEXT: line10 -// CHECK-NEXT: col3 +// CHECK-NEXT: col6 // CHECK-NEXT: file0 // CHECK-NEXT: // CHECK-NEXT: @@ -259,7 +259,7 @@ void testBinaryLHSProblem(int *p) { // CHECK-NEXT: location // CHECK-NEXT: // CHECK-NEXT: line10 -// CHECK-NEXT: col3 +// CHECK-NEXT: col6 // CHECK-NEXT: file0 // CHECK-NEXT: // CHECK-NEXT: ranges @@ -293,7 +293,7 @@ void testBinaryLHSProblem(int *p) { // CHECK-NEXT: location // CHECK-NEXT: // CHECK-NEXT: line10 -// CHECK-NEXT: col3 +// CHECK-NEXT: col6 // CHECK-NEXT: file0 // CHECK-NEXT: // CHECK-NEXT: @@ -882,12 +882,12 @@ void testBinaryLHSProblem(int *p) { // CHECK-NEXT: // CHECK-NEXT: // CHECK-NEXT: line44 -// CHECK-NEXT: col3 +// CHECK-NEXT: col6 // CHECK-NEXT: file0 // CHECK-NEXT: // CHECK-NEXT: // CHECK-NEXT: line44 -// CHECK-NEXT: col3 +// CHECK-NEXT: col6 // CHECK-NEXT: file0 // CHECK-NEXT: // CHECK-NEXT: @@ -899,7 +899,7 @@ void testBinaryLHSProblem(int *p) { // CHECK-NEXT: location // CHECK-NEXT: // CHECK-NEXT: line44 -// CHECK-NEXT: col3 +// CHECK-NEXT: col6 // CHECK-NEXT: file0 // CHECK-NEXT: // CHECK-NEXT: ranges @@ -933,7 +933,7 @@ void testBinaryLHSProblem(int *p) { // CHECK-NEXT: location // CHECK-NEXT: // CHECK-NEXT: line44 -// CHECK-NEXT: col3 +// CHECK-NEXT: col6 // CHECK-NEXT: file0 // CHECK-NEXT: // CHECK-NEXT: -- cgit v1.2.3