forked from OSchip/llvm-project
Implement simplify_type traits for redecl_iterator.
Based on Chandler Carruth's feedback on r155869. llvm-svn: 155929
This commit is contained in:
parent
6e9a8addcb
commit
2e4ae51fb4
|
@ -1632,6 +1632,23 @@ struct cast_convert_val< const ::clang::DeclContext, FromTy*, FromTy*> {
|
|||
}
|
||||
};
|
||||
|
||||
// simplify_type - Allow clients to treat redecl_iterators just like Decl
|
||||
// pointers when using casting operators.
|
||||
template<> struct simplify_type< ::clang::Decl::redecl_iterator> {
|
||||
typedef ::clang::Decl *SimpleType;
|
||||
static SimpleType getSimplifiedValue(const ::clang::Decl::redecl_iterator
|
||||
&Val) {
|
||||
return Val;
|
||||
}
|
||||
};
|
||||
template<> struct simplify_type<const ::clang::Decl::redecl_iterator> {
|
||||
typedef ::clang::Decl *SimpleType;
|
||||
static SimpleType getSimplifiedValue(const ::clang::Decl::redecl_iterator
|
||||
&Val) {
|
||||
return Val;
|
||||
}
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1069,7 +1069,7 @@ static NamedDecl *getVisibleDecl(NamedDecl *D) {
|
|||
|
||||
for (Decl::redecl_iterator RD = D->redecls_begin(), RDEnd = D->redecls_end();
|
||||
RD != RDEnd; ++RD) {
|
||||
if (NamedDecl *ND = dyn_cast<NamedDecl>(&*RD)) {
|
||||
if (NamedDecl *ND = dyn_cast<NamedDecl>(RD)) {
|
||||
if (LookupResult::isVisible(ND))
|
||||
return ND;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue