[analyzer] Refactor: make PathDiagnosticLocation responsible for validation of SourceLocations (commit 4 of ?):

- The closing brace is always a single location, not a range.
 - The test case previously had a location key 57:1 followed by a range [57:1 - 57:1]. 

llvm-svn: 139832
This commit is contained in:
Anna Zaks 2011-09-15 20:06:34 +00:00
parent 82dd698575
commit 207c68012a
2 changed files with 1 additions and 16 deletions

View File

@ -132,7 +132,7 @@ void PathDiagnosticClient::HandlePathDiagnostic(const PathDiagnostic *D) {
PathDiagnosticLocation::PathDiagnosticLocation(const LocationContext *lc, PathDiagnosticLocation::PathDiagnosticLocation(const LocationContext *lc,
const SourceManager &sm) const SourceManager &sm)
: K(RangeK), S(0), D(0), SM(&sm), LC(lc) { : K(SingleLocK), S(0), D(0), SM(&sm), LC(lc) {
SourceLocation L = LC->getDecl()->getBodyRBrace(); SourceLocation L = LC->getDecl()->getBodyRBrace();
R = SourceRange(L, L); R = SourceRange(L, L);
} }

View File

@ -984,21 +984,6 @@ void rdar8331641(int x) {
// CHECK: <key>col</key><integer>1</integer> // CHECK: <key>col</key><integer>1</integer>
// CHECK: <key>file</key><integer>0</integer> // CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict> // CHECK: </dict>
// CHECK: <key>ranges</key>
// CHECK: <array>
// CHECK: <array>
// CHECK: <dict>
// CHECK: <key>line</key><integer>57</integer>
// CHECK: <key>col</key><integer>1</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: <dict>
// CHECK: <key>line</key><integer>57</integer>
// CHECK: <key>col</key><integer>1</integer>
// CHECK: <key>file</key><integer>0</integer>
// CHECK: </dict>
// CHECK: </array>
// CHECK: </array>
// CHECK: <key>extended_message</key> // CHECK: <key>extended_message</key>
// CHECK: <string>Object leaked: object allocated and stored into &apos;value&apos; is not referenced later in this execution path and has a retain count of +1</string> // CHECK: <string>Object leaked: object allocated and stored into &apos;value&apos; is not referenced later in this execution path and has a retain count of +1</string>
// CHECK: <key>message</key> // CHECK: <key>message</key>