]> granicus.if.org Git - clang/commitdiff
Make helpers static, remove unused variables.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 3 Sep 2011 03:30:59 +0000 (03:30 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 3 Sep 2011 03:30:59 +0000 (03:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139078 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclAttr.cpp
lib/Sema/SemaExpr.cpp
lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp

index ae4cef952db3eb456e681ec81a93bd5957ffdc68..0483552c51952dde43e24b42f7f42858a83d80ba 100644 (file)
@@ -274,16 +274,16 @@ static const RecordType *getRecordType(QualType QT) {
 
 /// \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;
index 91cc7a923e6523693e9040d54ddc8ba81c80e1d8..800f8e3061aa5b3dbd4fd48343d1881adb9ec8f9 100644 (file)
@@ -5978,8 +5978,6 @@ QualType Sema::CheckAdditionOperands( // C99 6.5.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 @@ static bool IsWithinTemplateSpecialization(Decl *D) {
 /// 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();
 
index 37a0bf91bb8f0cdb8777fdd31d73220605fcb7e8..cf06f54c70a8f19eb0d135b85482d9d5fa81b4fa 100644 (file)
@@ -3557,7 +3557,7 @@ static void PrintPool(raw_ostream &Out, SymbolRef Sym,
   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() ||