diff options
| author | Charles Davis <cdavis@mines.edu> | 2010-02-18 04:39:19 +0000 |
|---|---|---|
| committer | Charles Davis <cdavis@mines.edu> | 2010-02-18 04:39:19 +0000 |
| commit | cb9572e7b3d104e610dfa088e10ffcd40e310949 (patch) | |
| tree | aec7a43098994cf6eed57760cbb5bca4c2586535 /clang/lib/Sema | |
| parent | 44272ca35654471d30e31e7a76aebd8e0ab82ccd (diff) | |
| download | bcm5719-llvm-cb9572e7b3d104e610dfa088e10ffcd40e310949.tar.gz bcm5719-llvm-cb9572e7b3d104e610dfa088e10ffcd40e310949.zip | |
Two fixes related to force_align_arg_pointer:
- Also recognize __force_align_arg_pointer__.
- Don't warn if it's used on a function pointer typedef.
llvm-svn: 96568
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/TargetAttributesSema.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Sema/TargetAttributesSema.cpp b/clang/lib/Sema/TargetAttributesSema.cpp index 76cff1f3151..1ea02991034 100644 --- a/clang/lib/Sema/TargetAttributesSema.cpp +++ b/clang/lib/Sema/TargetAttributesSema.cpp @@ -82,9 +82,13 @@ static void HandleX86ForceAlignArgPointerAttr(Decl *D, // 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. - ValueDecl* VD = dyn_cast<ValueDecl>(D); + ValueDecl *VD = dyn_cast<ValueDecl>(D); if (VD && VD->getType()->isFunctionPointerType()) return; + // Also don't warn on function pointer typedefs. + TypedefDecl *TD = dyn_cast<TypedefDecl>(D); + if (TD && TD->getUnderlyingType()->isFunctionPointerType()) + return; // Attribute can only be applied to function types. if (!isa<FunctionDecl>(D)) { S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type) @@ -189,7 +193,8 @@ namespace { default: break; } } - if (Attr.getName()->getName() == "force_align_arg_pointer") { + if (Attr.getName()->getName() == "force_align_arg_pointer" || + Attr.getName()->getName() == "__force_align_arg_pointer__") { HandleX86ForceAlignArgPointerAttr(D, Attr, S); return true; } |

