[cfe-commits] r96847 - /cfe/trunk/lib/Sema/SemaChecking.cpp
Ted Kremenek
kremenek at apple.com
Mon Feb 22 17:19:11 PST 2010
Author: kremenek
Date: Mon Feb 22 19:19:11 2010
New Revision: 96847
URL: http://llvm.org/viewvc/llvm-project?rev=96847&view=rev
Log:
Simplify logic for determining values of 'ReturnsVoid' and 'HasNoReturn' flags.
No functionality change.
Modified:
cfe/trunk/lib/Sema/SemaChecking.cpp
Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=96847&r1=96846&r2=96847&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Mon Feb 22 19:19:11 2010
@@ -2490,22 +2490,20 @@
bool ReturnsVoid = false;
bool HasNoReturn = false;
+
if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
// For function templates, class templates and member function templates
// we'll do the analysis at instantiation time.
if (FD->isDependentContext())
return;
- if (FD->getResultType()->isVoidType())
- ReturnsVoid = true;
- if (FD->hasAttr<NoReturnAttr>() ||
- FD->getType()->getAs<FunctionType>()->getNoReturnAttr())
- HasNoReturn = true;
+ ReturnsVoid = FD->getResultType()->isVoidType();
+ HasNoReturn = FD->hasAttr<NoReturnAttr>() ||
+ FD->getType()->getAs<FunctionType>()->getNoReturnAttr();
+
} else if (ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(D)) {
- if (MD->getResultType()->isVoidType())
- ReturnsVoid = true;
- if (MD->hasAttr<NoReturnAttr>())
- HasNoReturn = true;
+ ReturnsVoid = MD->getResultType()->isVoidType();
+ HasNoReturn = MD->hasAttr<NoReturnAttr>();
}
// Short circuit for compilation speed.
More information about the cfe-commits
mailing list