From 7656f418091b1ae51145cf12edabb29fed67ab6d Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Sat, 4 Oct 2014 06:16:45 +0000 Subject: [PATCH] Sema: Simplify checkAttributesAfterMerging Use getDLLAttr to factor out some common dllimport/dllexport code. llvm-svn: 219048 --- clang/lib/Sema/SemaDecl.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index a3227aa29601..03dd2a7093cd 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -5103,14 +5103,7 @@ static void checkAttributesAfterMerging(Sema &S, NamedDecl &ND) { } // dll attributes require external linkage. - if (const DLLImportAttr *Attr = ND.getAttr()) { - if (!ND.isExternallyVisible()) { - S.Diag(ND.getLocation(), diag::err_attribute_dll_not_extern) - << &ND << Attr; - ND.setInvalidDecl(); - } - } - if (const DLLExportAttr *Attr = ND.getAttr()) { + if (const InheritableAttr *Attr = getDLLAttr(&ND)) { if (!ND.isExternallyVisible()) { S.Diag(ND.getLocation(), diag::err_attribute_dll_not_extern) << &ND << Attr;