summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/TargetAttributesSema.cpp
diff options
context:
space:
mode:
authorCharles Davis <cdavis@mines.edu>2010-02-11 23:57:08 +0000
committerCharles Davis <cdavis@mines.edu>2010-02-11 23:57:08 +0000
commita90f7ca591f922471386d3dbbbe7b8e7818fbe0a (patch)
tree9e112f6e7224bf3188fd565515037ed7a3ae3686 /clang/lib/Sema/TargetAttributesSema.cpp
parent93c92225af5e29c7cb215530653e4fcb0e74b0c4 (diff)
downloadbcm5719-llvm-a90f7ca591f922471386d3dbbbe7b8e7818fbe0a.tar.gz
bcm5719-llvm-a90f7ca591f922471386d3dbbbe7b8e7818fbe0a.zip
Warn about using the new force_align_arg_pointer attribute on a function
pointer. If you don't like the new warning, you can turn it off with -Wno-force-align-arg-pointer. llvm-svn: 95939
Diffstat (limited to 'clang/lib/Sema/TargetAttributesSema.cpp')
-rw-r--r--clang/lib/Sema/TargetAttributesSema.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Sema/TargetAttributesSema.cpp b/clang/lib/Sema/TargetAttributesSema.cpp
index 9062d368cad..d45d0106ffe 100644
--- a/clang/lib/Sema/TargetAttributesSema.cpp
+++ b/clang/lib/Sema/TargetAttributesSema.cpp
@@ -79,12 +79,14 @@ static void HandleX86ForceAlignArgPointerAttr(Decl *D,
return;
}
- // If we try to apply it to a function pointer, don't warn, but don't
- // do anything, either. It doesn't matter anyway, because there's nothing
- // special about calling a force_align_arg_pointer function.
+ // If we try to apply it to a function pointer, warn. This is a special
+ // instance of the warn_attribute_ignored warning that can be turned
+ // off with -Wno-force-align-arg-pointer.
ValueDecl* VD = dyn_cast<ValueDecl>(D);
- if (VD && VD->getType()->isFunctionPointerType())
+ if (VD && VD->getType()->isFunctionPointerType()) {
+ S.Diag(Attr.getLoc(), diag::warn_faap_attribute_ignored);
return;
+ }
// Attribute can only be applied to function types.
if (!isa<FunctionDecl>(D)) {
S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
OpenPOWER on IntegriCloud