[cfe-commits] r139078 - in /cfe/trunk/lib: Sema/SemaDeclAttr.cpp Sema/SemaExpr.cpp StaticAnalyzer/Checkers/RetainCountChecker.cpp
Benjamin Kramer
benny.kra at googlemail.com
Fri Sep 2 20:30:59 PDT 2011
Author: d0k
Date: Fri Sep 2 22:30:59 2011
New Revision: 139078
URL: http://llvm.org/viewvc/llvm-project?rev=139078&view=rev
Log:
Make helpers static, remove unused variables.
Modified:
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=139078&r1=139077&r2=139078&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Fri Sep 2 22:30:59 2011
@@ -274,16 +274,16 @@
/// \brief Thread Safety Analysis: Checks that the passed in RecordType
/// resolves to a lockable object. May flag an error.
-bool checkForLockableRecord(Sema &S, Decl *D, const AttributeList &Attr,
- const RecordType *RT) {
+static bool checkForLockableRecord(Sema &S, Decl *D, const AttributeList &Attr,
+ const RecordType *RT) {
// Flag error if could not get record type for this argument.
- if(!RT) {
+ if (!RT) {
S.Diag(Attr.getLoc(), diag::err_attribute_argument_not_class)
<< Attr.getName();
return false;
}
// Flag error if the type is not lockable.
- if(!RT->getDecl()->getAttr<LockableAttr>()) {
+ if (!RT->getDecl()->getAttr<LockableAttr>()) {
S.Diag(Attr.getLoc(), diag::err_attribute_argument_not_lockable)
<< Attr.getName();
return false;
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=139078&r1=139077&r2=139078&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Fri Sep 2 22:30:59 2011
@@ -5978,8 +5978,6 @@
if (!checkArithmeticOpPointerOperand(*this, Loc, PExp))
return QualType();
- QualType PointeeTy = PExp->getType()->getPointeeType();
-
// Diagnose bad cases where we step over interface counts.
if (!checkArithmethicPointerOnNonFragileABI(*this, Loc, PExp))
return QualType();
@@ -6210,8 +6208,6 @@
/// If two different enums are compared, raise a warning.
static void checkEnumComparison(Sema &S, SourceLocation Loc, ExprResult &lex,
ExprResult &rex) {
- QualType lType = lex.get()->getType();
- QualType rType = rex.get()->getType();
QualType LHSStrippedType = lex.get()->IgnoreParenImpCasts()->getType();
QualType RHSStrippedType = rex.get()->IgnoreParenImpCasts()->getType();
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp?rev=139078&r1=139077&r2=139078&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp Fri Sep 2 22:30:59 2011
@@ -3557,7 +3557,7 @@
Out << '}';
}
-bool UsesAutorelease(const ProgramState *state) {
+static bool UsesAutorelease(const ProgramState *state) {
// A state uses autorelease if it allocated an autorelease pool or if it has
// objects in the caller's autorelease pool.
return !state->get<AutoreleaseStack>().isEmpty() ||
More information about the cfe-commits
mailing list