[cfe-commits] r150209 - in /cfe/trunk: lib/Sema/SemaInit.cpp test/Sema/init.c
Aaron Ballman
aaron at aaronballman.com
Thu Feb 9 14:16:56 PST 2012
Author: aaronballman
Date: Thu Feb 9 16:16:56 2012
New Revision: 150209
URL: http://llvm.org/viewvc/llvm-project?rev=150209&view=rev
Log:
Switching to using dyn_cast_or_null, and fixing line endings in the test case.
Modified:
cfe/trunk/lib/Sema/SemaInit.cpp
cfe/trunk/test/Sema/init.c
Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=150209&r1=150208&r2=150209&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Thu Feb 9 16:16:56 2012
@@ -1511,8 +1511,8 @@
IdentifierInfo *FieldName) {
assert(AnonField->isAnonymousStructOrUnion());
Decl *NextDecl = AnonField->getNextDeclInContext();
- IndirectFieldDecl *IF = NULL;
- while (NextDecl && (IF = dyn_cast<IndirectFieldDecl>(NextDecl))) {
+ while (IndirectFieldDecl *IF =
+ dyn_cast_or_null<IndirectFieldDecl>(NextDecl)) {
if (FieldName && FieldName == IF->getAnonField()->getIdentifier())
return IF;
NextDecl = NextDecl->getNextDeclInContext();
Modified: cfe/trunk/test/Sema/init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/init.c?rev=150209&r1=150208&r2=150209&view=diff
==============================================================================
--- cfe/trunk/test/Sema/init.c (original)
+++ cfe/trunk/test/Sema/init.c Thu Feb 9 16:16:56 2012
@@ -18,12 +18,12 @@
void *g = &x;
int *h = &x;
-struct union_crash
-{
- union
- {
- };
-};
+struct union_crash
+{
+ union
+ {
+ };
+};
int test() {
int a[10];
More information about the cfe-commits
mailing list