apelete updated this revision to Diff 56042.
apelete added a comment.
[scan-build] fix dead store warnings emitted on clang code base
Changes since last revision:
- Initialize 'CXCursor Parent' variable to avoid passing 'Record' variable as
an un-initialized argument thereafter.
http://reviews.llvm.org/D19831
Files:
tools/c-index-test/c-index-test.c
Index: tools/c-index-test/c-index-test.c
===================================================================
--- tools/c-index-test/c-index-test.c
+++ tools/c-index-test/c-index-test.c
@@ -1432,10 +1432,10 @@
CXString FieldSpelling = clang_getCursorSpelling(cursor);
const char *FieldName = clang_getCString(FieldSpelling);
/* recurse to get the first parent record that is not anonymous. */
- CXCursor Parent, Record;
+ CXCursor Record;
+ CXCursor Parent = p;
unsigned RecordIsAnonymous = 0;
if (clang_getCursorKind(cursor) == CXCursor_FieldDecl) {
- Record = Parent = p;
do {
Record = Parent;
Parent = clang_getCursorSemanticParent(Record);
Index: tools/c-index-test/c-index-test.c
===================================================================
--- tools/c-index-test/c-index-test.c
+++ tools/c-index-test/c-index-test.c
@@ -1432,10 +1432,10 @@
CXString FieldSpelling = clang_getCursorSpelling(cursor);
const char *FieldName = clang_getCString(FieldSpelling);
/* recurse to get the first parent record that is not anonymous. */
- CXCursor Parent, Record;
+ CXCursor Record;
+ CXCursor Parent = p;
unsigned RecordIsAnonymous = 0;
if (clang_getCursorKind(cursor) == CXCursor_FieldDecl) {
- Record = Parent = p;
do {
Record = Parent;
Parent = clang_getCursorSemanticParent(Record);
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits