[cfe-commits] r130707 - /cfe/trunk/lib/Sema/SemaLookup.cpp
Chandler Carruth
chandlerc at gmail.com
Mon May 2 11:54:36 PDT 2011
Author: chandlerc
Date: Mon May 2 13:54:36 2011
New Revision: 130707
URL: http://llvm.org/viewvc/llvm-project?rev=130707&view=rev
Log:
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.
Modified:
cfe/trunk/lib/Sema/SemaLookup.cpp
Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=130707&r1=130706&r2=130707&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Mon May 2 13:54:36 2011
@@ -2410,8 +2410,8 @@
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();
}
More information about the cfe-commits
mailing list