diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2013-12-04 23:23:19 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2013-12-04 23:23:19 +0000 |
commit | 8b9e236bb4d2db3ebaaa94047d0da1f1485614f5 (patch) | |
tree | 7e349f99737f32e1152bc30a2ff9225fcc49e2e3 /clang/lib/Sema/TargetAttributesSema.cpp | |
parent | aad23ecadb78a6c57719765817276746c23bd3ff (diff) | |
download | bcm5719-llvm-8b9e236bb4d2db3ebaaa94047d0da1f1485614f5.tar.gz bcm5719-llvm-8b9e236bb4d2db3ebaaa94047d0da1f1485614f5.zip |
Giving a Subjects list to DllExport, which allows the removal of some custom semantic handling. The same cannot be done for DllImport, and so comments were left explaining why.
llvm-svn: 196429
Diffstat (limited to 'clang/lib/Sema/TargetAttributesSema.cpp')
-rw-r--r-- | clang/lib/Sema/TargetAttributesSema.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/clang/lib/Sema/TargetAttributesSema.cpp b/clang/lib/Sema/TargetAttributesSema.cpp index 80168480ac7..68f13494a3e 100644 --- a/clang/lib/Sema/TargetAttributesSema.cpp +++ b/clang/lib/Sema/TargetAttributesSema.cpp @@ -201,17 +201,9 @@ DLLExportAttr *Sema::mergeDLLExportAttr(Decl *D, SourceRange Range, } static void HandleDLLExportAttr(Decl *D, const AttributeList &Attr, Sema &S) { - // Attribute can be applied only to functions or variables. - FunctionDecl *FD = dyn_cast<FunctionDecl>(D); - if (!FD && !isa<VarDecl>(D)) { - S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type) - << Attr.getName() << 2 /*variable and function*/; - return; - } - // Currently, the dllexport attribute is ignored for inlined functions, unless // the -fkeep-inline-functions flag has been used. Warning is emitted; - if (FD && FD->isInlineSpecified()) { + if (isa<FunctionDecl>(D) && cast<FunctionDecl>(D)->isInlineSpecified()) { // FIXME: ... unless the -fkeep-inline-functions flag has been used. S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << Attr.getName(); return; |