aboutsummaryrefslogtreecommitdiff
path: root/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
commitb84412f587bc9f2f90930cc1c63ba10cb833bd4e (patch)
tree44b00f90cc4e4b7311e1eb9289b42736727e897b /lib/Sema/TargetAttributesSema.cpp
parentbab71685568085b635f077ee5720d22dffab84be (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95939 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/TargetAttributesSema.cpp')
-rw-r--r--lib/Sema/TargetAttributesSema.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Sema/TargetAttributesSema.cpp b/lib/Sema/TargetAttributesSema.cpp
index 9062d368ca..d45d0106ff 100644
--- a/lib/Sema/TargetAttributesSema.cpp
+++ b/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)