From: David Majnemer Date: Sat, 4 Oct 2014 06:16:45 +0000 (+0000) Subject: Sema: Simplify checkAttributesAfterMerging X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=751c0f0d3ce56463e443bc35b882eba99148386f;p=clang Sema: Simplify checkAttributesAfterMerging Use getDLLAttr to factor out some common dllimport/dllexport code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219048 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index a3227aa296..03dd2a7093 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/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;