[PATCH] D26691: [analyzer] Run clang-format and fix style
This revision was automatically updated to reflect the committed changes. Closed by commit rL289511: [analyzer] Run clang-format and fix style (authored by ddcc). Changed prior to commit: https://reviews.llvm.org/D26691?vs=80128=81170#toc Repository: rL LLVM https://reviews.llvm.org/D26691 Files: cfe/trunk/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp cfe/trunk/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp cfe/trunk/lib/StaticAnalyzer/Core/SimpleConstraintManager.h Index: cfe/trunk/lib/StaticAnalyzer/Core/SimpleConstraintManager.h === --- cfe/trunk/lib/StaticAnalyzer/Core/SimpleConstraintManager.h +++ cfe/trunk/lib/StaticAnalyzer/Core/SimpleConstraintManager.h @@ -24,78 +24,74 @@ class SimpleConstraintManager : public ConstraintManager { SubEngine *SU; SValBuilder + public: - SimpleConstraintManager(SubEngine *subengine, SValBuilder ) -: SU(subengine), SVB(SB) {} + SimpleConstraintManager(SubEngine *SE, SValBuilder ) : SU(SE), SVB(SB) {} ~SimpleConstraintManager() override; //===--===// // Common implementation for the interface provided by ConstraintManager. //===--===// - ProgramStateRef assume(ProgramStateRef state, DefinedSVal Cond, -bool Assumption) override; + ProgramStateRef assume(ProgramStateRef State, DefinedSVal Cond, + bool Assumption) override; - ProgramStateRef assume(ProgramStateRef state, NonLoc Cond, bool Assumption); + ProgramStateRef assume(ProgramStateRef State, NonLoc Cond, bool Assumption); - ProgramStateRef assumeInclusiveRange(ProgramStateRef State, - NonLoc Value, - const llvm::APSInt , - const llvm::APSInt , - bool InRange) override; - - ProgramStateRef assumeSymRel(ProgramStateRef state, - const SymExpr *LHS, - BinaryOperator::Opcode op, - const llvm::APSInt& Int); + ProgramStateRef assumeInclusiveRange(ProgramStateRef State, NonLoc Value, + const llvm::APSInt , + const llvm::APSInt , + bool InRange) override; + + ProgramStateRef assumeSymRel(ProgramStateRef State, const SymExpr *LHS, + BinaryOperator::Opcode Op, + const llvm::APSInt ); ProgramStateRef assumeSymWithinInclusiveRange(ProgramStateRef State, SymbolRef Sym, const llvm::APSInt , const llvm::APSInt , bool InRange); - protected: - //===--===// // Interface that subclasses must implement. //===--===// - // Each of these is of the form "$sym+Adj <> V", where "<>" is the comparison + // Each of these is of the form "$Sym+Adj <> V", where "<>" is the comparison // operation for the method being invoked. - virtual ProgramStateRef assumeSymNE(ProgramStateRef state, SymbolRef sym, - const llvm::APSInt& V, - const llvm::APSInt& Adjustment) = 0; - - virtual ProgramStateRef assumeSymEQ(ProgramStateRef state, SymbolRef sym, - const llvm::APSInt& V, - const llvm::APSInt& Adjustment) = 0; - - virtual ProgramStateRef assumeSymLT(ProgramStateRef state, SymbolRef sym, - const llvm::APSInt& V, - const llvm::APSInt& Adjustment) = 0; - - virtual ProgramStateRef assumeSymGT(ProgramStateRef state, SymbolRef sym, - const llvm::APSInt& V, - const llvm::APSInt& Adjustment) = 0; - - virtual ProgramStateRef assumeSymLE(ProgramStateRef state, SymbolRef sym, - const llvm::APSInt& V, - const llvm::APSInt& Adjustment) = 0; - - virtual ProgramStateRef assumeSymGE(ProgramStateRef state, SymbolRef sym, - const llvm::APSInt& V, - const llvm::APSInt& Adjustment) = 0; - + virtual ProgramStateRef assumeSymNE(ProgramStateRef State, SymbolRef Sym, + const llvm::APSInt , + const
[PATCH] D26691: [analyzer] Run clang-format and fix style
zaks.anna accepted this revision. zaks.anna added a comment. This revision is now accepted and ready to land. Thank you! Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:459 // Notice that the lower bound is greater than the upper bound. - RangeSet New = GetRange(St, Sym).Intersect(getBasicVals(), F, Upper, Lower); + RangeSet New = getRange(St, Sym).Intersect(getBasicVals(), F, Upper, Lower); return New.isEmpty() ? nullptr : St->set(Sym, New); ddcc wrote: > zaks.anna wrote: > > ddcc wrote: > > > zaks.anna wrote: > > > > We should use lower case function names. > > > Are you saying more functions should be changed to lowercase (e.g. > > > intersect)? Or that `getRange` should be `getrange`? > > Should be "camel case, and start with a lower case letter", see: > > > > http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly > Right, isn't changing `GetRange` to `getRange` correct then? I'm a little > confused, is there something else that needs to be fixed? Sorry, my bad. This does look good! https://reviews.llvm.org/D26691 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26691: [analyzer] Run clang-format and fix style
ddcc added inline comments. Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:459 // Notice that the lower bound is greater than the upper bound. - RangeSet New = GetRange(St, Sym).Intersect(getBasicVals(), F, Upper, Lower); + RangeSet New = getRange(St, Sym).Intersect(getBasicVals(), F, Upper, Lower); return New.isEmpty() ? nullptr : St->set(Sym, New); zaks.anna wrote: > ddcc wrote: > > zaks.anna wrote: > > > We should use lower case function names. > > Are you saying more functions should be changed to lowercase (e.g. > > intersect)? Or that `getRange` should be `getrange`? > Should be "camel case, and start with a lower case letter", see: > > http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly Right, isn't changing `GetRange` to `getRange` correct then? I'm a little confused, is there something else that needs to be fixed? https://reviews.llvm.org/D26691 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26691: [analyzer] Run clang-format and fix style
zaks.anna added inline comments. Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:459 // Notice that the lower bound is greater than the upper bound. - RangeSet New = GetRange(St, Sym).Intersect(getBasicVals(), F, Upper, Lower); + RangeSet New = getRange(St, Sym).Intersect(getBasicVals(), F, Upper, Lower); return New.isEmpty() ? nullptr : St->set(Sym, New); ddcc wrote: > zaks.anna wrote: > > We should use lower case function names. > Are you saying more functions should be changed to lowercase (e.g. > intersect)? Or that `getRange` should be `getrange`? Should be "camel case, and start with a lower case letter", see: http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly https://reviews.llvm.org/D26691 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26691: [analyzer] Run clang-format and fix style
ddcc added inline comments. Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:459 // Notice that the lower bound is greater than the upper bound. - RangeSet New = GetRange(St, Sym).Intersect(getBasicVals(), F, Upper, Lower); + RangeSet New = getRange(St, Sym).Intersect(getBasicVals(), F, Upper, Lower); return New.isEmpty() ? nullptr : St->set(Sym, New); zaks.anna wrote: > We should use lower case function names. Are you saying more functions should be changed to lowercase (e.g. intersect)? Or that `getRange` should be `getrange`? https://reviews.llvm.org/D26691 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26691: [analyzer] Run clang-format and fix style
ddcc updated this revision to Diff 80128. ddcc added a comment. Un-change comments, misc. changes https://reviews.llvm.org/D26691 Files: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp lib/StaticAnalyzer/Core/SimpleConstraintManager.h Index: lib/StaticAnalyzer/Core/SimpleConstraintManager.h === --- lib/StaticAnalyzer/Core/SimpleConstraintManager.h +++ lib/StaticAnalyzer/Core/SimpleConstraintManager.h @@ -24,78 +24,74 @@ class SimpleConstraintManager : public ConstraintManager { SubEngine *SU; SValBuilder + public: - SimpleConstraintManager(SubEngine *subengine, SValBuilder ) -: SU(subengine), SVB(SB) {} + SimpleConstraintManager(SubEngine *SE, SValBuilder ) : SU(SE), SVB(SB) {} ~SimpleConstraintManager() override; //===--===// // Common implementation for the interface provided by ConstraintManager. //===--===// - ProgramStateRef assume(ProgramStateRef state, DefinedSVal Cond, -bool Assumption) override; + ProgramStateRef assume(ProgramStateRef State, DefinedSVal Cond, + bool Assumption) override; - ProgramStateRef assume(ProgramStateRef state, NonLoc Cond, bool Assumption); + ProgramStateRef assume(ProgramStateRef State, NonLoc Cond, bool Assumption); - ProgramStateRef assumeInclusiveRange(ProgramStateRef State, - NonLoc Value, - const llvm::APSInt , - const llvm::APSInt , - bool InRange) override; + ProgramStateRef assumeInclusiveRange(ProgramStateRef State, NonLoc Value, + const llvm::APSInt , + const llvm::APSInt , + bool InRange) override; - ProgramStateRef assumeSymRel(ProgramStateRef state, - const SymExpr *LHS, - BinaryOperator::Opcode op, - const llvm::APSInt& Int); + ProgramStateRef assumeSymRel(ProgramStateRef State, const SymExpr *LHS, + BinaryOperator::Opcode Op, + const llvm::APSInt ); ProgramStateRef assumeSymWithinInclusiveRange(ProgramStateRef State, SymbolRef Sym, const llvm::APSInt , const llvm::APSInt , bool InRange); - protected: - //===--===// // Interface that subclasses must implement. //===--===// - // Each of these is of the form "$sym+Adj <> V", where "<>" is the comparison + // Each of these is of the form "$Sym+Adj <> V", where "<>" is the comparison // operation for the method being invoked. - virtual ProgramStateRef assumeSymNE(ProgramStateRef state, SymbolRef sym, - const llvm::APSInt& V, - const llvm::APSInt& Adjustment) = 0; + virtual ProgramStateRef assumeSymNE(ProgramStateRef State, SymbolRef Sym, + const llvm::APSInt , + const llvm::APSInt ) = 0; - virtual ProgramStateRef assumeSymEQ(ProgramStateRef state, SymbolRef sym, - const llvm::APSInt& V, - const llvm::APSInt& Adjustment) = 0; + virtual ProgramStateRef assumeSymEQ(ProgramStateRef State, SymbolRef Sym, + const llvm::APSInt , + const llvm::APSInt ) = 0; - virtual ProgramStateRef assumeSymLT(ProgramStateRef state, SymbolRef sym, - const llvm::APSInt& V, - const llvm::APSInt& Adjustment) = 0; + virtual ProgramStateRef assumeSymLT(ProgramStateRef State, SymbolRef Sym, + const llvm::APSInt , + const llvm::APSInt ) = 0; - virtual ProgramStateRef assumeSymGT(ProgramStateRef state, SymbolRef sym, - const llvm::APSInt& V, - const llvm::APSInt& Adjustment) = 0; + virtual ProgramStateRef assumeSymGT(ProgramStateRef State, SymbolRef Sym, + const llvm::APSInt , + const llvm::APSInt ) = 0; - virtual ProgramStateRef
[PATCH] D26691: [analyzer] Run clang-format and fix style
dcoughlin added a comment. In https://reviews.llvm.org/D26691#610292, @zaks.anna wrote: > I am not a big fan of loosing svn blame only to fix formatting, but since you > are modifying this code anyway, it's fine by me. > > Artem and Devin, what is your opinion on this? I agree that in general it is not good to lose the annotation information, but if you're fine with it I'm fine with it. https://reviews.llvm.org/D26691 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26691: [analyzer] Run clang-format and fix style
zaks.anna added a comment. I am not a big fan of loosing svn blame only to fix formatting, but since you are modifying this code anyway, it's fine by me. Artem and Devin, what is your opinion on this? Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:459 // Notice that the lower bound is greater than the upper bound. - RangeSet New = GetRange(St, Sym).Intersect(getBasicVals(), F, Upper, Lower); + RangeSet New = getRange(St, Sym).Intersect(getBasicVals(), F, Upper, Lower); return New.isEmpty() ? nullptr : St->set(Sym, New); We should use lower case function names. Comment at: lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp:228 static void computeAdjustment(SymbolRef , llvm::APSInt ) { - // Is it a "($sym+constant1)" expression? + // Is it a "($Sym+constant1)" expression? if (const SymIntExpr *SE = dyn_cast(Sym)) { I don't think we should change the case in the comment. Comment at: lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp:255 - // We only handle simple comparisons of the form "$sym == constant" - // or "($sym+constant1) == constant2". + // We only handle simple comparisons of the form "$Sym == constant" + // or "($Sym+constant1) == constant2". Not sure the comment needs to change. https://reviews.llvm.org/D26691 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26691: [analyzer] Run clang-format and fix style
ddcc created this revision. ddcc added reviewers: zaks.anna, dcoughlin. ddcc added a subscriber: cfe-commits. Split out formatting and style changes from https://reviews.llvm.org/D26061 https://reviews.llvm.org/D26691 Files: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp lib/StaticAnalyzer/Core/SimpleConstraintManager.h Index: lib/StaticAnalyzer/Core/SimpleConstraintManager.h === --- lib/StaticAnalyzer/Core/SimpleConstraintManager.h +++ lib/StaticAnalyzer/Core/SimpleConstraintManager.h @@ -24,77 +24,72 @@ class SimpleConstraintManager : public ConstraintManager { SubEngine *SU; SValBuilder + public: - SimpleConstraintManager(SubEngine *subengine, SValBuilder ) -: SU(subengine), SVB(SB) {} + SimpleConstraintManager(SubEngine *SE, SValBuilder ) : SU(SE), SVB(SB) {} ~SimpleConstraintManager() override; //===--===// // Common implementation for the interface provided by ConstraintManager. //===--===// - ProgramStateRef assume(ProgramStateRef state, DefinedSVal Cond, -bool Assumption) override; + ProgramStateRef assume(ProgramStateRef State, DefinedSVal Cond, + bool Assumption) override; - ProgramStateRef assume(ProgramStateRef state, NonLoc Cond, bool Assumption); + ProgramStateRef assume(ProgramStateRef State, NonLoc Cond, bool Assumption); - ProgramStateRef assumeInclusiveRange(ProgramStateRef State, - NonLoc Value, - const llvm::APSInt , - const llvm::APSInt , - bool InRange) override; + ProgramStateRef assumeInclusiveRange(ProgramStateRef State, NonLoc Value, + const llvm::APSInt , + const llvm::APSInt , + bool InRange) override; - ProgramStateRef assumeSymRel(ProgramStateRef state, - const SymExpr *LHS, - BinaryOperator::Opcode op, - const llvm::APSInt& Int); + ProgramStateRef assumeSymRel(ProgramStateRef State, const SymExpr *LHS, + BinaryOperator::Opcode Op, + const llvm::APSInt ); ProgramStateRef assumeSymWithinInclusiveRange(ProgramStateRef State, SymbolRef Sym, const llvm::APSInt , const llvm::APSInt , bool InRange); - protected: - //===--===// // Interface that subclasses must implement. //===--===// - // Each of these is of the form "$sym+Adj <> V", where "<>" is the comparison + // Each of these is of the form "$Sym+Adj <> V", where "<>" is the comparison // operation for the method being invoked. - virtual ProgramStateRef assumeSymNE(ProgramStateRef state, SymbolRef sym, - const llvm::APSInt& V, - const llvm::APSInt& Adjustment) = 0; + virtual ProgramStateRef assumeSymNE(ProgramStateRef State, SymbolRef Sym, + const llvm::APSInt , + const llvm::APSInt ) = 0; - virtual ProgramStateRef assumeSymEQ(ProgramStateRef state, SymbolRef sym, - const llvm::APSInt& V, - const llvm::APSInt& Adjustment) = 0; + virtual ProgramStateRef assumeSymEQ(ProgramStateRef State, SymbolRef Sym, + const llvm::APSInt , + const llvm::APSInt ) = 0; - virtual ProgramStateRef assumeSymLT(ProgramStateRef state, SymbolRef sym, - const llvm::APSInt& V, - const llvm::APSInt& Adjustment) = 0; + virtual ProgramStateRef assumeSymLT(ProgramStateRef State, SymbolRef Sym, + const llvm::APSInt , + const llvm::APSInt ) = 0; - virtual ProgramStateRef assumeSymGT(ProgramStateRef state, SymbolRef sym, - const llvm::APSInt& V, - const llvm::APSInt& Adjustment) = 0; + virtual ProgramStateRef assumeSymGT(ProgramStateRef State, SymbolRef Sym, + const llvm::APSInt , +