diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-08-06 21:12:55 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-08-06 21:12:55 +0000 |
commit | dde201b9b53a05912780fc94bd4974c59454f2b6 (patch) | |
tree | 08329d8c7ab402c3cedcfb413d2491eb9bf94ba2 /lib/Checker/MallocChecker.cpp | |
parent | 8c91230a6870797e2afd89388ca58ab4f8144700 (diff) |
Fix 80 col. violations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110473 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/MallocChecker.cpp')
-rw-r--r-- | lib/Checker/MallocChecker.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/Checker/MallocChecker.cpp b/lib/Checker/MallocChecker.cpp index 0b98d07b85..b7ad4be00b 100644 --- a/lib/Checker/MallocChecker.cpp +++ b/lib/Checker/MallocChecker.cpp @@ -24,7 +24,8 @@ using namespace clang; namespace { class RefState { - enum Kind { AllocateUnchecked, AllocateFailed, Released, Escaped, Relinquished } K; + enum Kind { AllocateUnchecked, AllocateFailed, Released, Escaped, + Relinquished } K; const Stmt *S; public: @@ -48,7 +49,9 @@ public: } static RefState getReleased(const Stmt *s) { return RefState(Released, s); } static RefState getEscaped(const Stmt *s) { return RefState(Escaped, s); } - static RefState getRelinquished(const Stmt *s) { return RefState(Relinquished, s); } + static RefState getRelinquished(const Stmt *s) { + return RefState(Relinquished, s); + } void Profile(llvm::FoldingSetNodeID &ID) const { ID.AddInteger(K); @@ -68,7 +71,8 @@ class MallocChecker : public CheckerVisitor<MallocChecker> { public: MallocChecker() - : BT_DoubleFree(0), BT_Leak(0), BT_UseFree(0), BT_UseRelinquished(0), BT_BadFree(0), + : BT_DoubleFree(0), BT_Leak(0), BT_UseFree(0), BT_UseRelinquished(0), + BT_BadFree(0), II_malloc(0), II_free(0), II_realloc(0), II_calloc(0) {} static void *getTag(); bool EvalCallExpr(CheckerContext &C, const CallExpr *CE); @@ -84,7 +88,8 @@ public: private: void MallocMem(CheckerContext &C, const CallExpr *CE); - void MallocMemReturnsAttr(CheckerContext &C, const CallExpr *CE, const OwnershipAttr* Att); + void MallocMemReturnsAttr(CheckerContext &C, const CallExpr *CE, + const OwnershipAttr* Att); const GRState *MallocMemAux(CheckerContext &C, const CallExpr *CE, const Expr *SizeEx, SVal Init, const GRState *state) { @@ -706,11 +711,14 @@ void MallocChecker::PreVisitBind(CheckerContext &C, break; // If the state can't represent this binding, we still own it. - if (notNullState == (notNullState->bindLoc(cast<Loc>(location), UnknownVal()))) + if (notNullState == (notNullState->bindLoc(cast<Loc>(location), + UnknownVal()))) break; // We no longer own this pointer. - notNullState = notNullState->set<RegionState>(Sym, RefState::getRelinquished(StoreE)); + notNullState = + notNullState->set<RegionState>(Sym, + RefState::getRelinquished(StoreE)); } while (false); } |