summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
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
commitb68dd4717e1e47a67e42b6a0fbde0df545340a61 (patch)
treeb10b7257eadcd8825d290805e53c510a2763e7d2 /clang/lib/Sema
parent27614589dc6d214d7a69a1ad8dc3db3803b2b53e (diff)
downloadbcm5719-llvm-b68dd4717e1e47a67e42b6a0fbde0df545340a61.tar.gz
bcm5719-llvm-b68dd4717e1e47a67e42b6a0fbde0df545340a61.zip
Clear LV cache when dropping availability attributes.
llvm-svn: 171906
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index a13da7c9412..225ee24d0fc 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/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 &&
OpenPOWER on IntegriCloud