Look at all the record redeclaration when looking for a uuid attribute.

llvm-svn: 131066
This commit is contained in:
Francois Pichet 2011-05-08 10:02:20 +00:00
parent f30053d18d
commit 59d2b017d7
1 changed files with 5 additions and 4 deletions

View File

@ -385,13 +385,14 @@ static UuidAttr *GetUuidAttrOfType(QualType QT) {
else if (QT->isArrayType())
Ty = cast<ArrayType>(QT)->getElementType().getTypePtr();
// Loop all class definition and declaration looking for an uuid attribute.
// Loop all record redeclaration looking for an uuid attribute.
CXXRecordDecl *RD = Ty->getAsCXXRecordDecl();
while (RD) {
if (UuidAttr *Uuid = RD->getAttr<UuidAttr>())
for (CXXRecordDecl::redecl_iterator I = RD->redecls_begin(),
E = RD->redecls_end(); I != E; ++I) {
if (UuidAttr *Uuid = I->getAttr<UuidAttr>())
return Uuid;
RD = RD->getPreviousDeclaration();
}
return 0;
}