[llvm-branch-commits] [cfe-branch] r146826 - /cfe/branches/tooling/include/clang/ASTMatchers/ASTMatchersInternal.h
Chandler Carruth
chandlerc at gmail.com
Sat Dec 17 02:14:17 PST 2011
Author: chandlerc
Date: Sat Dec 17 04:14:17 2011
New Revision: 146826
URL: http://llvm.org/viewvc/llvm-project?rev=146826&view=rev
Log:
Update for tweaked API of VariadicFunction.
Modified:
cfe/branches/tooling/include/clang/ASTMatchers/ASTMatchersInternal.h
Modified: cfe/branches/tooling/include/clang/ASTMatchers/ASTMatchersInternal.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/ASTMatchers/ASTMatchersInternal.h?rev=146826&r1=146825&r2=146826&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/ASTMatchers/ASTMatchersInternal.h (original)
+++ cfe/branches/tooling/include/clang/ASTMatchers/ASTMatchersInternal.h Sat Dec 17 04:14:17 2011
@@ -713,16 +713,16 @@
/// T is dyn_cast'able into InnerT and all inner matchers match.
template<typename T, typename InnerT>
Matcher<T> MakeDynCastAllOfComposite(
- const Matcher<InnerT> *const InnerMatchers[], int Count) {
- if (Count == 0) {
+ ArrayRef<const Matcher<InnerT> *> InnerMatchers) {
+ if (InnerMatchers.empty()) {
return ArgumentAdaptingMatcher<DynCastMatcher, InnerT>(
MakeMatcher(new TrueMatcher<InnerT>));
}
- Matcher<InnerT> InnerMatcher = *InnerMatchers[Count-1];
- for (int I = Count-2; I >= 0; --I) {
+ Matcher<InnerT> InnerMatcher = *InnerMatchers.back();
+ for (int i = InnerMatchers.size() - 2; i >= 0; --i) {
InnerMatcher = MakeMatcher(
new AllOfMatcher<InnerT, Matcher<InnerT>, Matcher<InnerT> >(
- *InnerMatchers[I], InnerMatcher));
+ *InnerMatchers[i], InnerMatcher));
}
return ArgumentAdaptingMatcher<DynCastMatcher, InnerT>(InnerMatcher);
}
More information about the llvm-branch-commits
mailing list