Don't abuse reinterpret cast to do something the API of PointerUnion

provides proper support for. This was caught by
-Wundefined-reinterpret-cast, and I think a reasonable case for it to
warn on.

Also use is<...> instead of dyn_cast<...> when the result isn't needed.

This whole thing should probably switch to using UsuallyTinyPtrVector.

llvm-svn: 130707
This commit is contained in:
Chandler Carruth 2011-05-02 18:54:36 +00:00
parent f91c5ab341
commit 38a328276c
1 changed files with 2 additions and 2 deletions

View File

@ -2410,8 +2410,8 @@ VisibleDeclsRecord::ShadowMapEntry::end() {
if (DeclOrVector.isNull())
return 0;
if (DeclOrVector.dyn_cast<NamedDecl *>())
return &reinterpret_cast<NamedDecl*&>(DeclOrVector) + 1;
if (DeclOrVector.is<NamedDecl *>())
return DeclOrVector.getAddrOf<NamedDecl *>() + 1;
return DeclOrVector.get<DeclVector *>()->end();
}