[cfe-commits] r139832 - in /cfe/trunk: lib/StaticAnalyzer/Core/PathDiagnostic.cpp test/Analysis/plist-output-alternate.m

Anna Zaks ganna at apple.com
Thu Sep 15 13:06:34 PDT 2011


Author: zaks
Date: Thu Sep 15 15:06:34 2011
New Revision: 139832

URL: http://llvm.org/viewvc/llvm-project?rev=139832&view=rev
Log:
[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]. 

Modified:
    cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
    cfe/trunk/test/Analysis/plist-output-alternate.m

Modified: cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp?rev=139832&r1=139831&r2=139832&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp Thu Sep 15 15:06:34 2011
@@ -132,7 +132,7 @@
 
 PathDiagnosticLocation::PathDiagnosticLocation(const LocationContext *lc,
                                                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();
   R = SourceRange(L, L);
 }

Modified: cfe/trunk/test/Analysis/plist-output-alternate.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/plist-output-alternate.m?rev=139832&r1=139831&r2=139832&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/plist-output-alternate.m (original)
+++ cfe/trunk/test/Analysis/plist-output-alternate.m Thu Sep 15 15:06:34 2011
@@ -984,21 +984,6 @@
 // CHECK:       <key>col</key><integer>1</integer>
 // CHECK:       <key>file</key><integer>0</integer>
 // 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:      <string>Object leaked: object allocated and stored into 'value' is not referenced later in this execution path and has a retain count of +1</string>
 // CHECK:      <key>message</key>





More information about the cfe-commits mailing list