diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2010-01-10 12:58:08 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2010-01-10 12:58:08 +0000 |
commit | 55bcea1e65ea97efb782314605f01e3bca9706d0 (patch) | |
tree | be67c9ed2f95facf346be289e231b9b2dba78c52 /clang/lib/Sema/SemaDeclAttr.cpp | |
parent | 89b14a4309ec7c59a0dbb748aef088a661edbfe4 (diff) | |
download | bcm5719-llvm-55bcea1e65ea97efb782314605f01e3bca9706d0.tar.gz bcm5719-llvm-55bcea1e65ea97efb782314605f01e3bca9706d0.zip |
Generalize target weirdness handling having proper layering in mind:
1. Add helper class for sema checks for target attributes
2. Add helper class for codegen of target attributes
As a proof-of-concept - implement msp430's 'interrupt' attribute.
llvm-svn: 93118
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 094e5b56e55..ceab525db12 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "Sema.h" +#include "TargetAttributesSema.h" #include "clang/AST/ASTContext.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/Expr.h" @@ -1959,7 +1960,10 @@ static void ProcessDeclAttribute(Scope *scope, Decl *D, // Just ignore break; default: - S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << Attr.getName(); + // Ask target about the attribute. + const TargetAttributesSema &TargetAttrs = S.getTargetAttributesSema(); + if (!TargetAttrs.ProcessDeclAttribute(scope, D, Attr, S)) + S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << Attr.getName(); break; } } |