aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
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
commit51be6e3487c4b7f43d9f5b2db962382b79295acb (patch)
treee9deb10c893b6045e9686719df2ff8b07e10fc16 /lib/Sema/SemaDecl.cpp
parent8c4222adbc0fd22928e751be6a75328fc9283a72 (diff)
Tighten types a bit. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171902 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 58ba3eeae7..5b610b9605 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/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);