[cfe-commits] r79041 - /cfe/trunk/lib/Sema/SemaDeclAttr.cpp
Ted Kremenek
kremenek at apple.com
Fri Aug 14 13:51:59 PDT 2009
Author: kremenek
Date: Fri Aug 14 15:51:58 2009
New Revision: 79041
URL: http://llvm.org/viewvc/llvm-project?rev=79041&view=rev
Log:
Use 'dyn_cast' instead of a check for a function declaration followed by a
'cast'.
Modified:
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=79041&r1=79040&r2=79041&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Fri Aug 14 15:51:58 2009
@@ -438,13 +438,14 @@
return;
}
- if (!isFunction(d)) {
+ const FunctionDecl *FD = dyn_cast<FunctionDecl>(d);
+
+ if (!FD) {
S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
<< Attr.getName() << 0 /*function*/;
return;
}
- const FunctionDecl *FD = cast<FunctionDecl>(d);
QualType RetTy = FD->getResultType();
if (!(RetTy->isAnyPointerType() || RetTy->isBlockPointerType())) {
More information about the cfe-commits
mailing list