aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-01-08 22:31:36 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-01-08 22:31:36 +0000
commitd130fd2e141f1fef412c2d58e7385370801bd718 (patch)
treea3bee60e5f300dec0f3fe7c1fd89e669250b51cc /lib/Sema/SemaDeclAttr.cpp
parent51be6e3487c4b7f43d9f5b2db962382b79295acb (diff)
Clear LV cache when dropping availability attributes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171906 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--lib/Sema/SemaDeclAttr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index a13da7c941..225ee24d0f 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -2043,6 +2043,7 @@ AvailabilityAttr *Sema::mergeAvailabilityAttr(NamedDecl *D, SourceRange Range,
VersionTuple MergedDeprecated = Deprecated;
VersionTuple MergedObsoleted = Obsoleted;
bool FoundAny = false;
+ bool DroppedAny = false;
if (D->hasAttrs()) {
AttrVec &Attrs = D->getAttrs();
@@ -2077,6 +2078,7 @@ AvailabilityAttr *Sema::mergeAvailabilityAttr(NamedDecl *D, SourceRange Range,
Diag(OldAA->getLocation(), diag::warn_mismatched_availability);
Diag(Range.getBegin(), diag::note_previous_attribute);
Attrs.erase(Attrs.begin() + i);
+ DroppedAny = true;
--e;
continue;
}
@@ -2096,6 +2098,7 @@ AvailabilityAttr *Sema::mergeAvailabilityAttr(NamedDecl *D, SourceRange Range,
MergedIntroduced2, MergedDeprecated2,
MergedObsoleted2)) {
Attrs.erase(Attrs.begin() + i);
+ DroppedAny = true;
--e;
continue;
}
@@ -2107,6 +2110,9 @@ AvailabilityAttr *Sema::mergeAvailabilityAttr(NamedDecl *D, SourceRange Range,
}
}
+ if (DroppedAny)
+ D->ClearLVCache();
+
if (FoundAny &&
MergedIntroduced == Introduced &&
MergedDeprecated == Deprecated &&