[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176115 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Analysis/method-call-path-notes.cpp b/test/Analysis/method-call-path-notes.cpp
index d6308a7..f946b32 100644
--- a/test/Analysis/method-call-path-notes.cpp
+++ b/test/Analysis/method-call-path-notes.cpp
@@ -10,12 +10,12 @@
};
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_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 @@
// 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 @@
// 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 @@
// 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>