r176115 - [analyzer] Use 'MemRegion::printPretty()' instead of assuming the region is a VarRegion.
Ted Kremenek
kremenek at apple.com
Tue Feb 26 11:44:39 PST 2013
Author: kremenek
Date: Tue Feb 26 13:44:38 2013
New Revision: 176115
URL: http://llvm.org/viewvc/llvm-project?rev=176115&view=rev
Log:
[analyzer] Use 'MemRegion::printPretty()' instead of assuming the region is a VarRegion.
Fixes PR15358 and <rdar://problem/13295437>.
Along the way, shorten path diagnostics that say "Variable 'x'" to just
be "'x'". By the context, it is obvious that we have a variable,
and so this just consumes text space.
Modified:
cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
cfe/trunk/test/Analysis/conditional-operator-path-notes.c
cfe/trunk/test/Analysis/default-diagnostic-visitors.c
cfe/trunk/test/Analysis/diagnostics/deref-track-symbolic-region.cpp
cfe/trunk/test/Analysis/diagnostics/undef-value-caller.c
cfe/trunk/test/Analysis/diagnostics/undef-value-param.c
cfe/trunk/test/Analysis/diagnostics/undef-value-param.m
cfe/trunk/test/Analysis/inline-plist.c
cfe/trunk/test/Analysis/inlining/eager-reclamation-path-notes.c
cfe/trunk/test/Analysis/inlining/path-notes.c
cfe/trunk/test/Analysis/inlining/path-notes.m
cfe/trunk/test/Analysis/method-call-path-notes.cpp
cfe/trunk/test/Analysis/null-deref-path-notes.m
cfe/trunk/test/Analysis/plist-output-alternate.m
cfe/trunk/test/Analysis/plist-output.m
cfe/trunk/test/Analysis/unix-fns.c
Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp?rev=176115&r1=176114&r2=176115&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp Tue Feb 26 13:44:38 2013
@@ -462,7 +462,9 @@ PathDiagnosticPiece *FindLastStoreBRVisi
if (!R)
return 0;
- os << "Variable '" << *VR->getDecl() << "' ";
+ os << '\'';
+ R->printPretty(os);
+ os << "' ";
if (V.getAs<loc::ConcreteInt>()) {
bool b = false;
Modified: cfe/trunk/test/Analysis/conditional-operator-path-notes.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/conditional-operator-path-notes.c?rev=176115&r1=176114&r2=176115&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/conditional-operator-path-notes.c (original)
+++ cfe/trunk/test/Analysis/conditional-operator-path-notes.c Tue Feb 26 13:44:38 2013
@@ -6,7 +6,7 @@ void testCondOp(int *p) {
int *x = p ? p : p;
// expected-note at -1 {{Assuming 'p' is null}}
// expected-note at -2 {{'?' condition is false}}
- // expected-note at -3 {{Variable 'x' initialized to a null pointer value}}
+ // expected-note at -3 {{'x' initialized to a null pointer value}}
*x = 1; // expected-warning{{Dereference of null pointer (loaded from variable 'x')}}
// expected-note at -1 {{Dereference of null pointer (loaded from variable 'x')}}
}
@@ -40,7 +40,7 @@ void testRHSProblem(int *p) {
void testBinaryCondOp(int *p) {
int *x = p ?: p;
// expected-note at -1 {{'?' condition is false}}
- // expected-note at -2 {{Variable 'x' initialized to a null pointer value}}
+ // expected-note at -2 {{'x' initialized to a null pointer value}}
*x = 1; // expected-warning{{Dereference of null pointer (loaded from variable 'x')}}
// expected-note at -1 {{Dereference of null pointer (loaded from variable 'x')}}
}
@@ -216,9 +216,9 @@ void testBinaryLHSProblem(int *p) {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'x' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'x' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'x' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'x' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -856,9 +856,9 @@ void testBinaryLHSProblem(int *p) {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'x' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'x' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'x' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'x' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
Modified: cfe/trunk/test/Analysis/default-diagnostic-visitors.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/default-diagnostic-visitors.c?rev=176115&r1=176114&r2=176115&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/default-diagnostic-visitors.c (original)
+++ cfe/trunk/test/Analysis/default-diagnostic-visitors.c Tue Feb 26 13:44:38 2013
@@ -5,7 +5,7 @@
int getPasswordAndItem()
{
int err = 0;
- int *password; // expected-note {{Variable 'password' declared without an initial value}}
+ int *password; // expected-note {{'password' declared without an initial value}}
if (password == 0) { // expected-warning {{The left operand of '==' is a garbage value}} // expected-note {{The left operand of '==' is a garbage value}}
err = *password;
}
Modified: cfe/trunk/test/Analysis/diagnostics/deref-track-symbolic-region.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/diagnostics/deref-track-symbolic-region.cpp?rev=176115&r1=176114&r2=176115&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/diagnostics/deref-track-symbolic-region.cpp (original)
+++ cfe/trunk/test/Analysis/diagnostics/deref-track-symbolic-region.cpp Tue Feb 26 13:44:38 2013
@@ -7,7 +7,7 @@ struct S {
S &getSomeReference();
void test(S *p) {
- S &r = *p; //expected-note {{Variable 'r' initialized here}}
+ S &r = *p; //expected-note {{'r' initialized here}}
if (p) return;
//expected-note at -1{{Taking false branch}}
//expected-note at -2{{Assuming 'p' is null}}
Modified: cfe/trunk/test/Analysis/diagnostics/undef-value-caller.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/diagnostics/undef-value-caller.c?rev=176115&r1=176114&r2=176115&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/diagnostics/undef-value-caller.c (original)
+++ cfe/trunk/test/Analysis/diagnostics/undef-value-caller.c Tue Feb 26 13:44:38 2013
@@ -11,155 +11,149 @@ int test_calling_unimportant_callee(int
return x; // expected-warning {{Undefined or garbage value returned to caller}}
}
-//CHECK: <dict>
-//CHECK: <key>files</key>
-//CHECK: <array>
-//CHECK: </array>
-//CHECK: <key>diagnostics</key>
-//CHECK: <array>
-//CHECK: <dict>
-//CHECK: <key>path</key>
-//CHECK: <array>
-//CHECK: <dict>
-//CHECK: <key>kind</key><string>event</string>
-//CHECK: <key>location</key>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>9</integer>
-//CHECK: <key>col</key><integer>3</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>9</integer>
-//CHECK: <key>col</key><integer>3</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>9</integer>
-//CHECK: <key>col</key><integer>7</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: </array>
-//CHECK: <key>depth</key><integer>0</integer>
-//CHECK: <key>extended_message</key>
-//CHECK: <string>Variable 'x' declared without an initial value</string>
-//CHECK: <key>message</key>
-//CHECK: <string>Variable 'x' declared without an initial value</string>
-//CHECK: </dict>
-//CHECK: <dict>
-//CHECK: <key>kind</key><string>control</string>
-//CHECK: <key>edges</key>
-//CHECK: <array>
-//CHECK: <dict>
-//CHECK: <key>start</key>
-//CHECK: <array>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>9</integer>
-//CHECK: <key>col</key><integer>3</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>9</integer>
-//CHECK: <key>col</key><integer>5</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: <key>end</key>
-//CHECK: <array>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>10</integer>
-//CHECK: <key>col</key><integer>3</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>10</integer>
-//CHECK: <key>col</key><integer>8</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: </dict>
-//CHECK: <dict>
-//CHECK: <key>kind</key><string>control</string>
-//CHECK: <key>edges</key>
-//CHECK: <array>
-//CHECK: <dict>
-//CHECK: <key>start</key>
-//CHECK: <array>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>10</integer>
-//CHECK: <key>col</key><integer>3</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>10</integer>
-//CHECK: <key>col</key><integer>8</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: <key>end</key>
-//CHECK: <array>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>11</integer>
-//CHECK: <key>col</key><integer>3</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>11</integer>
-//CHECK: <key>col</key><integer>8</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: </dict>
-//CHECK: <dict>
-//CHECK: <key>kind</key><string>event</string>
-//CHECK: <key>location</key>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>11</integer>
-//CHECK: <key>col</key><integer>3</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>11</integer>
-//CHECK: <key>col</key><integer>10</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>11</integer>
-//CHECK: <key>col</key><integer>10</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: </array>
-//CHECK: <key>depth</key><integer>0</integer>
-//CHECK: <key>extended_message</key>
-//CHECK: <string>Undefined or garbage value returned to caller</string>
-//CHECK: <key>message</key>
-//CHECK: <string>Undefined or garbage value returned to caller</string>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: <key>description</key><string>Undefined or garbage value returned to caller</string>
-//CHECK: <key>category</key><string>Logic error</string>
-//CHECK: <key>type</key><string>Garbage return value</string>
-//CHECK: <key>issue_context_kind</key><string>function</string>
-//CHECK: <key>issue_context</key><string>test_calling_unimportant_callee</string>
-//CHECK: <key>issue_hash</key><string>3</string>
-//CHECK: <key>location</key>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>11</integer>
-//CHECK: <key>col</key><integer>3</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: </dict>
-//CHECK: </plist>
+// CHECK: <key>diagnostics</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>9</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>9</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>9</integer>
+// CHECK-NEXT: <key>col</key><integer>7</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>'x' declared without an initial value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>'x' declared without an initial value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>9</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>9</integer>
+// CHECK-NEXT: <key>col</key><integer>5</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>10</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>10</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>10</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>10</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>10</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Undefined or garbage value returned to caller</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Undefined or garbage value returned to caller</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Undefined or garbage value returned to caller</string>
+// CHECK-NEXT: <key>category</key><string>Logic error</string>
+// CHECK-NEXT: <key>type</key><string>Garbage return value</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>test_calling_unimportant_callee</string>
+// CHECK-NEXT: <key>issue_hash</key><string>3</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>11</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
Modified: cfe/trunk/test/Analysis/diagnostics/undef-value-param.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/diagnostics/undef-value-param.c?rev=176115&r1=176114&r2=176115&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/diagnostics/undef-value-param.c (original)
+++ cfe/trunk/test/Analysis/diagnostics/undef-value-param.c Tue Feb 26 13:44:38 2013
@@ -17,7 +17,7 @@ void foo(int c, int *x) {
}
int use(int c) {
- int xx; //expected-note{{Variable 'xx' declared without an initial value}}
+ int xx; //expected-note {{'xx' declared without an initial value}}
int *y = &xx;
foo (c, y);
//expected-note at -1{{Calling 'foo'}}
@@ -93,9 +93,9 @@ double testPassingParentRegionStruct(int
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'xx' declared without an initial value</string>
+// CHECK-NEXT: <string>'xx' declared without an initial value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'xx' declared without an initial value</string>
+// CHECK-NEXT: <string>'xx' declared without an initial value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
Modified: cfe/trunk/test/Analysis/diagnostics/undef-value-param.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/diagnostics/undef-value-param.m?rev=176115&r1=176114&r2=176115&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/diagnostics/undef-value-param.m (original)
+++ cfe/trunk/test/Analysis/diagnostics/undef-value-param.m Tue Feb 26 13:44:38 2013
@@ -30,7 +30,7 @@ SCDynamicStoreRef anotherCreateRef(unsig
@implementation Cell
- (void) test {
- SCDynamicStoreRef storeRef = 0; //expected-note{{Variable 'storeRef' initialized to nil}}
+ SCDynamicStoreRef storeRef = 0; //expected-note{{'storeRef' initialized to nil}}
CreateRef(&storeRef, 4);
//expected-note at -1{{Calling 'CreateRef'}}
//expected-note at -2{{Returning from 'CreateRef'}}
@@ -85,9 +85,9 @@ static void CreateRef(SCDynamicStoreRef
//CHECK: </array>
//CHECK: <key>depth</key><integer>0</integer>
//CHECK: <key>extended_message</key>
-//CHECK: <string>Variable 'storeRef' initialized to nil</string>
+//CHECK: <string>'storeRef' initialized to nil</string>
//CHECK: <key>message</key>
-//CHECK: <string>Variable 'storeRef' initialized to nil</string>
+//CHECK: <string>'storeRef' initialized to nil</string>
//CHECK: </dict>
//CHECK: <dict>
//CHECK: <key>kind</key><string>control</string>
Modified: cfe/trunk/test/Analysis/inline-plist.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/inline-plist.c?rev=176115&r1=176114&r2=176115&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/inline-plist.c (original)
+++ cfe/trunk/test/Analysis/inline-plist.c Tue Feb 26 13:44:38 2013
@@ -55,7 +55,7 @@ void bar(int *p) {
// ========================================================================== //
void test_block__capture_null() {
- int *p = 0; // expected-note{{Variable 'p' initialized to a null pointer value}}
+ int *p = 0; // expected-note{{'p' initialized to a null pointer value}}
^(){ // expected-note {{Calling anonymous block}}
*p = 1; // expected-warning{{Dereference of null pointer (loaded from variable 'p')}} expected-note{{Dereference of null pointer (loaded from variable 'p')}}
}();
@@ -63,8 +63,8 @@ void test_block__capture_null() {
}
void test_block_ret() {
- int *p = ^(){ // expected-note {{Calling anonymous block}} expected-note{{Returning to caller}} expected-note {{Variable 'p' initialized to a null pointer value}}
- int *q = 0; // expected-note {{Variable 'q' initialized to a null pointer value}}
+ int *p = ^(){ // expected-note {{Calling anonymous block}} expected-note{{Returning to caller}} expected-note {{'p' initialized to a null pointer value}}
+ int *q = 0; // expected-note {{'q' initialized to a null pointer value}}
return q; // expected-note {{Returning null pointer (loaded from 'q')}}
}();
*p = 1; // expected-warning{{Dereference of null pointer (loaded from variable 'p')}} expected-note{{Dereference of null pointer (loaded from variable 'p')}}
@@ -830,9 +830,9 @@ void test_block_arg() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -1124,9 +1124,9 @@ void test_block_arg() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>1</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'q' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'q' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'q' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'q' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -1313,9 +1313,9 @@ void test_block_arg() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
Modified: cfe/trunk/test/Analysis/inlining/eager-reclamation-path-notes.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/inlining/eager-reclamation-path-notes.c?rev=176115&r1=176114&r2=176115&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/inlining/eager-reclamation-path-notes.c (original)
+++ cfe/trunk/test/Analysis/inlining/eager-reclamation-path-notes.c Tue Feb 26 13:44:38 2013
@@ -17,7 +17,7 @@ int compute() {
void testSimple() {
int *p = 0;
- // expected-note at -1 {{Variable 'p' initialized to a null pointer value}}
+ // expected-note at -1 {{'p' initialized to a null pointer value}}
use(p, compute());
// expected-note at -1 {{Passing null pointer value via 1st parameter 'ptr'}}
// expected-note at -2 {{Calling 'use'}}
@@ -37,7 +37,7 @@ void passThrough(int *p) {
void testChainedCalls() {
int *ptr = 0;
- // expected-note at -1 {{Variable 'ptr' initialized to a null pointer value}}
+ // expected-note at -1 {{'ptr' initialized to a null pointer value}}
passThrough(ptr);
// expected-note at -1 {{Passing null pointer value via 1st parameter 'p'}}
// expected-note at -2 {{Calling 'passThrough'}}
@@ -73,9 +73,9 @@ void testChainedCalls() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -356,9 +356,9 @@ void testChainedCalls() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'ptr' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'ptr' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'ptr' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'ptr' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
Modified: cfe/trunk/test/Analysis/inlining/path-notes.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/inlining/path-notes.c?rev=176115&r1=176114&r2=176115&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/inlining/path-notes.c (original)
+++ cfe/trunk/test/Analysis/inlining/path-notes.c Tue Feb 26 13:44:38 2013
@@ -38,7 +38,7 @@ int *getPointer();
void testInitCheck() {
int *a = getPointer();
- // expected-note at -1 {{Variable 'a' initialized here}}
+ // expected-note at -1 {{'a' initialized here}}
check(a);
// expected-note at -1 {{Calling 'check'}}
// expected-note at -2 {{Returning from 'check'}}
@@ -59,7 +59,7 @@ void testStoreCheck(int *a) {
int *getZero() {
int *p = 0;
- // expected-note at -1 + {{Variable 'p' initialized to a null pointer value}}
+ // expected-note at -1 + {{'p' initialized to a null pointer value}}
// ^ This note checks that we add a second visitor for the return value.
return p;
// expected-note at -1 + {{Returning null pointer (loaded from 'p')}}
@@ -83,7 +83,7 @@ void testInitZero() {
int *a = getZero();
// expected-note at -1 {{Calling 'getZero'}}
// expected-note at -2 {{Returning from 'getZero'}}
- // expected-note at -3 {{Variable 'a' initialized to a null pointer value}}
+ // expected-note at -3 {{'a' initialized to a null pointer value}}
*a = 1; // expected-warning{{Dereference of null pointer}}
// expected-note at -1 {{Dereference of null pointer (loaded from variable 'a')}}
}
@@ -639,9 +639,9 @@ void testUseOfNullPointer() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'a' initialized here</string>
+// CHECK-NEXT: <string>'a' initialized here</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'a' initialized here</string>
+// CHECK-NEXT: <string>'a' initialized here</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -1442,9 +1442,9 @@ void testUseOfNullPointer() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>1</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -1788,9 +1788,9 @@ void testUseOfNullPointer() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>1</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -2134,9 +2134,9 @@ void testUseOfNullPointer() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>1</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -2323,9 +2323,9 @@ void testUseOfNullPointer() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'a' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'a' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'a' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'a' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -2543,9 +2543,9 @@ void testUseOfNullPointer() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>1</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -2952,9 +2952,9 @@ void testUseOfNullPointer() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>1</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
Modified: cfe/trunk/test/Analysis/inlining/path-notes.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/inlining/path-notes.m?rev=176115&r1=176114&r2=176115&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/inlining/path-notes.m (original)
+++ cfe/trunk/test/Analysis/inlining/path-notes.m Tue Feb 26 13:44:38 2013
@@ -56,9 +56,9 @@ int testDispatchSyncInliningNoPruning(in
dispatch_sync(globalQueue, ^{
// expected-note at 7 {{Calling anonymous block}}
int x;
- // expected-note at -1 {{Variable 'x' declared without an initial value}}
+ // expected-note at -1 {{'x' declared without an initial value}}
^{ y = x; }(); // expected-warning{{Variable 'x' is uninitialized when captured by block}}
- // expected-note at -1 {{Variable 'x' is uninitialized when captured by block}}
+ // expected-note at -1 {{'x' is uninitialized when captured by block}}
});
return y;
@@ -1002,9 +1002,9 @@ int testDispatchSyncInliningNoPruning(in
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>2</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'x' declared without an initial value</string>
+// CHECK-NEXT: <string>'x' declared without an initial value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'x' declared without an initial value</string>
+// CHECK-NEXT: <string>'x' declared without an initial value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
Modified: cfe/trunk/test/Analysis/method-call-path-notes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/method-call-path-notes.cpp?rev=176115&r1=176114&r2=176115&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/method-call-path-notes.cpp (original)
+++ cfe/trunk/test/Analysis/method-call-path-notes.cpp Tue Feb 26 13:44:38 2013
@@ -10,12 +10,12 @@ public:
};
void test_ic() {
- TestInstanceCall *p; // expected-note {{Variable 'p' declared without an initial value}}
+ TestInstanceCall *p; // expected-note {{'p' declared without an initial value}}
p->foo(); // expected-warning {{Called C++ object pointer is uninitialized}} expected-note {{Called C++ object pointer is uninitialized}}
}
void test_ic_null() {
- TestInstanceCall *p = 0; // expected-note {{Variable 'p' initialized to a null pointer value}}
+ TestInstanceCall *p = 0; // expected-note {{'p' initialized to a null pointer value}}
p->foo(); // expected-warning {{Called C++ object pointer is null}} expected-note {{Called C++ object pointer is null}}
}
@@ -31,7 +31,7 @@ void test_ic_null(TestInstanceCall *p) {
}
void test_ic_member_ptr() {
- TestInstanceCall *p = 0; // expected-note {{Variable 'p' initialized to a null pointer value}}
+ TestInstanceCall *p = 0; // expected-note {{'p' initialized to a null pointer value}}
typedef void (TestInstanceCall::*IC_Ptr)();
IC_Ptr bar = &TestInstanceCall::foo;
(p->*bar)(); // expected-warning {{Called C++ object pointer is null}} expected-note{{Called C++ object pointer is null}}
@@ -72,9 +72,9 @@ void test_cast(const TestInstanceCall *p
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' declared without an initial value</string>
+// CHECK-NEXT: <string>'p' declared without an initial value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' declared without an initial value</string>
+// CHECK-NEXT: <string>'p' declared without an initial value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -181,9 +181,9 @@ void test_cast(const TestInstanceCall *p
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -576,9 +576,9 @@ void test_cast(const TestInstanceCall *p
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
Modified: cfe/trunk/test/Analysis/null-deref-path-notes.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/null-deref-path-notes.m?rev=176115&r1=176114&r2=176115&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/null-deref-path-notes.m (original)
+++ cfe/trunk/test/Analysis/null-deref-path-notes.m Tue Feb 26 13:44:38 2013
@@ -15,7 +15,7 @@ int testNull(Root *obj) {
// expected-note at -1 {{Assuming 'obj' is nil}}
// expected-note at -2 {{Taking false branch}}
- int *x = &obj->uniqueID; // expected-note{{Variable 'x' initialized to a null pointer value}}
+ int *x = &obj->uniqueID; // expected-note{{'x' initialized to a null pointer value}}
return *x; // expected-warning{{Dereference of null pointer (loaded from variable 'x')}} expected-note{{Dereference of null pointer (loaded from variable 'x')}}
}
@@ -164,9 +164,9 @@ int testNull(Root *obj) {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'x' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'x' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'x' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'x' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
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=176115&r1=176114&r2=176115&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/plist-output-alternate.m (original)
+++ cfe/trunk/test/Analysis/plist-output-alternate.m Tue Feb 26 13:44:38 2013
@@ -87,9 +87,9 @@ void rdar8331641(int x) {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -436,9 +436,9 @@ void rdar8331641(int x) {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'q' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'q' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'q' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'q' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -785,9 +785,9 @@ void rdar8331641(int x) {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
Modified: cfe/trunk/test/Analysis/plist-output.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/plist-output.m?rev=176115&r1=176114&r2=176115&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/plist-output.m (original)
+++ cfe/trunk/test/Analysis/plist-output.m Tue Feb 26 13:44:38 2013
@@ -165,6 +165,17 @@ void test_loop_diagnostics_3() {
}
@end
+// Test diagnostics for initialization of structs.
+void RDar13295437_f(void *i) __attribute__((__nonnull__));
+
+struct RDar13295437_S { int *i; };
+
+int RDar13295437() {
+ struct RDar13295437_S s = {0};
+ struct RDar13295437_S *sp = &s;
+ RDar13295437_f(sp->i);
+}
+
// CHECK: <key>diagnostics</key>
// CHECK-NEXT: <array>
// CHECK-NEXT: <dict>
@@ -195,9 +206,9 @@ void test_loop_diagnostics_3() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -544,9 +555,9 @@ void test_loop_diagnostics_3() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'q' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'q' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'q' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'q' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -893,9 +904,9 @@ void test_loop_diagnostics_3() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -1373,9 +1384,9 @@ void test_loop_diagnostics_3() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -1785,9 +1796,9 @@ void test_loop_diagnostics_3() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -2313,9 +2324,9 @@ void test_loop_diagnostics_3() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -2422,9 +2433,9 @@ void test_loop_diagnostics_3() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -2691,9 +2702,9 @@ void test_loop_diagnostics_3() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -2960,9 +2971,9 @@ void test_loop_diagnostics_3() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -3302,9 +3313,9 @@ void test_loop_diagnostics_3() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -3707,9 +3718,9 @@ void test_loop_diagnostics_3() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -4112,9 +4123,9 @@ void test_loop_diagnostics_3() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -4597,5 +4608,114 @@ void test_loop_diagnostics_3() {
// CHECK-NEXT: <key>col</key><integer>3</integer>
// CHECK-NEXT: <key>file</key><integer>0</integer>
// CHECK-NEXT: </dict>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>path</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>174</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>174</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>174</integer>
+// CHECK-NEXT: <key>col</key><integer>25</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>'s.i' initialized to a null pointer value</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>'s.i' initialized to a null pointer value</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>control</string>
+// CHECK-NEXT: <key>edges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>start</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>174</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>174</integer>
+// CHECK-NEXT: <key>col</key><integer>8</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>end</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>176</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>176</integer>
+// CHECK-NEXT: <key>col</key><integer>16</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>kind</key><string>event</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>176</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <key>ranges</key>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <array>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>176</integer>
+// CHECK-NEXT: <key>col</key><integer>18</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>176</integer>
+// CHECK-NEXT: <key>col</key><integer>22</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>depth</key><integer>0</integer>
+// CHECK-NEXT: <key>extended_message</key>
+// CHECK-NEXT: <string>Null pointer passed as an argument to a 'nonnull' parameter</string>
+// CHECK-NEXT: <key>message</key>
+// CHECK-NEXT: <string>Null pointer passed as an argument to a 'nonnull' parameter</string>
+// CHECK-NEXT: </dict>
+// CHECK-NEXT: </array>
+// CHECK-NEXT: <key>description</key><string>Null pointer passed as an argument to a 'nonnull' parameter</string>
+// CHECK-NEXT: <key>category</key><string>API</string>
+// CHECK-NEXT: <key>type</key><string>Argument with 'nonnull' attribute passed null</string>
+// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
+// CHECK-NEXT: <key>issue_context</key><string>RDar13295437</string>
+// CHECK-NEXT: <key>issue_hash</key><string>3</string>
+// CHECK-NEXT: <key>location</key>
+// CHECK-NEXT: <dict>
+// CHECK-NEXT: <key>line</key><integer>176</integer>
+// CHECK-NEXT: <key>col</key><integer>3</integer>
+// CHECK-NEXT: <key>file</key><integer>0</integer>
+// CHECK-NEXT: </dict>
// CHECK-NEXT: </dict>
// CHECK-NEXT: </array>
Modified: cfe/trunk/test/Analysis/unix-fns.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/unix-fns.c?rev=176115&r1=176114&r2=176115&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/unix-fns.c (original)
+++ cfe/trunk/test/Analysis/unix-fns.c Tue Feb 26 13:44:38 2013
@@ -1392,9 +1392,9 @@ void test_inline_dispatch_once() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -1455,9 +1455,9 @@ void test_inline_dispatch_once() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' captured by block as a null pointer value</string>
+// CHECK-NEXT: <string>'p' captured by block as a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' captured by block as a null pointer value</string>
+// CHECK-NEXT: <string>'p' captured by block as a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>event</string>
@@ -1763,9 +1763,9 @@ void test_inline_dispatch_once() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string>
+// CHECK-NEXT: <string>'p' initialized to a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>control</string>
@@ -1826,9 +1826,9 @@ void test_inline_dispatch_once() {
// CHECK-NEXT: </array>
// CHECK-NEXT: <key>depth</key><integer>0</integer>
// CHECK-NEXT: <key>extended_message</key>
-// CHECK-NEXT: <string>Variable 'p' captured by block as a null pointer value</string>
+// CHECK-NEXT: <string>'p' captured by block as a null pointer value</string>
// CHECK-NEXT: <key>message</key>
-// CHECK-NEXT: <string>Variable 'p' captured by block as a null pointer value</string>
+// CHECK-NEXT: <string>'p' captured by block as a null pointer value</string>
// CHECK-NEXT: </dict>
// CHECK-NEXT: <dict>
// CHECK-NEXT: <key>kind</key><string>event</string>
More information about the cfe-commits
mailing list