summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-01-08 22:04:34 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-01-08 22:04:34 +0000
commita3aea433f8141c7969ad7b8ad459f49ef6877035 (patch)
tree81721c68a9969f02f62ed16b97e9da452375b53d /clang/lib/Sema
parentb65d733f0684d331c0ceed8e2261892b45ae108b (diff)
downloadbcm5719-llvm-a3aea433f8141c7969ad7b8ad459f49ef6877035.tar.gz
bcm5719-llvm-a3aea433f8141c7969ad7b8ad459f49ef6877035.zip
Tighten types a bit. No functionality change.
llvm-svn: 171902
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp16
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp4
2 files changed, 8 insertions, 12 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 58ba3eeae77..5b610b96050 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -1788,23 +1788,19 @@ DeclHasAttr(const Decl *D, const Attr *A) {
return false;
}
-bool Sema::mergeDeclAttribute(Decl *D, InheritableAttr *Attr) {
+bool Sema::mergeDeclAttribute(NamedDecl *D, InheritableAttr *Attr) {
InheritableAttr *NewAttr = NULL;
if (AvailabilityAttr *AA = dyn_cast<AvailabilityAttr>(Attr)) {
NewAttr = mergeAvailabilityAttr(D, AA->getRange(), AA->getPlatform(),
AA->getIntroduced(), AA->getDeprecated(),
AA->getObsoleted(), AA->getUnavailable(),
AA->getMessage());
- if (NewAttr) {
- NamedDecl *ND = cast<NamedDecl>(D);
- ND->ClearLVCache();
- }
+ if (NewAttr)
+ D->ClearLVCache();
} else if (VisibilityAttr *VA = dyn_cast<VisibilityAttr>(Attr)) {
NewAttr = mergeVisibilityAttr(D, VA->getRange(), VA->getVisibility());
- if (NewAttr) {
- NamedDecl *ND = cast<NamedDecl>(D);
- ND->ClearLVCache();
- }
+ if (NewAttr)
+ D->ClearLVCache();
} else if (DLLImportAttr *ImportA = dyn_cast<DLLImportAttr>(Attr))
NewAttr = mergeDLLImportAttr(D, ImportA->getRange());
else if (DLLExportAttr *ExportA = dyn_cast<DLLExportAttr>(Attr))
@@ -1875,7 +1871,7 @@ static void checkNewAttributesAfterDef(Sema &S, Decl *New, const Decl *Old) {
}
/// mergeDeclAttributes - Copy attributes from the Old decl to the New one.
-void Sema::mergeDeclAttributes(Decl *New, Decl *Old,
+void Sema::mergeDeclAttributes(NamedDecl *New, Decl *Old,
bool MergeDeprecation) {
// attributes declared post-definition are currently ignored
checkNewAttributesAfterDef(*this, New, Old);
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 75268b8cc5a..a13da7c9412 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -2032,7 +2032,7 @@ static bool checkAvailabilityAttr(Sema &S, SourceRange Range,
return false;
}
-AvailabilityAttr *Sema::mergeAvailabilityAttr(Decl *D, SourceRange Range,
+AvailabilityAttr *Sema::mergeAvailabilityAttr(NamedDecl *D, SourceRange Range,
IdentifierInfo *Platform,
VersionTuple Introduced,
VersionTuple Deprecated,
@@ -2147,7 +2147,7 @@ static void handleAvailabilityAttr(Sema &S, Decl *D,
if (SE)
Str = SE->getString();
- AvailabilityAttr *NewAttr = S.mergeAvailabilityAttr(D, Attr.getRange(),
+ AvailabilityAttr *NewAttr = S.mergeAvailabilityAttr(ND, Attr.getRange(),
Platform,
Introduced.Version,
Deprecated.Version,
OpenPOWER on IntegriCloud