Minor tweak to my last patch per Doug's comment.

llvm-svn: 133731
This commit is contained in:
Fariborz Jahanian 2011-06-23 18:04:27 +00:00
parent 72d91dd6e4
commit d0cb83a6ab
1 changed files with 4 additions and 2 deletions

View File

@ -575,11 +575,13 @@ template <typename T>
void Decl::dropAttr() {
if (!HasAttrs) return;
AttrVec &Attrs = getASTContext().getDeclAttrs(this);
for (unsigned i = 0, e = Attrs.size(); i != e; ++i) {
for (unsigned i = 0, e = Attrs.size(); i != e; /* in loop */) {
if (isa<T>(Attrs[i])) {
Attrs.erase(Attrs.begin() + i);
--i, --e;
--e;
}
else
++i;
}
if (Attrs.empty())
HasAttrs = false;