r231657 - Make helper functions static

Benjamin Kramer benny.kra at gmail.com
Mon Mar 9 09:02:41 PDT 2015


> On 09.03.2015, at 16:50, David Blaikie <dblaikie at gmail.com> wrote:
> 
> 
> On Mar 9, 2015 8:11 AM, "Benjamin Kramer" <benny.kra at googlemail.com> wrote:
> >
> > Author: d0k
> > Date: Mon Mar  9 10:03:32 2015
> > New Revision: 231657
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=231657&view=rev
> > Log:
> > Make helper functions static
> 
> Are you finding these with -Wprototype or some other tool? I'd be curious to see if we could turn on -Wprototype.

nm and grepping for global symbols in the public namespace :/

-Wmissing-prototypes generates a lot of noise, I haven't checked if that's all false positives yet.

- Ben 

> >
> > NFC.
> >
> > Modified:
> >     cfe/trunk/lib/Analysis/Consumed.cpp
> >     cfe/trunk/lib/Sema/SemaChecking.cpp
> >
> > Modified: cfe/trunk/lib/Analysis/Consumed.cpp
> > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/Consumed.cpp?rev=231657&r1=231656&r2=231657&view=diff
> > ==============================================================================
> > --- cfe/trunk/lib/Analysis/Consumed.cpp (original)
> > +++ cfe/trunk/lib/Analysis/Consumed.cpp Mon Mar  9 10:03:32 2015
> > @@ -946,10 +946,9 @@ void ConsumedStmtVisitor::VisitVarDecl(c
> >  namespace clang {
> >  namespace consumed {
> >
> > -void splitVarStateForIf(const IfStmt * IfNode, const VarTestResult &Test,
> > -                        ConsumedStateMap *ThenStates,
> > -                        ConsumedStateMap *ElseStates) {
> > -
> > +static void splitVarStateForIf(const IfStmt *IfNode, const VarTestResult &Test,
> > +                               ConsumedStateMap *ThenStates,
> > +                               ConsumedStateMap *ElseStates) {
> >    ConsumedState VarState = ThenStates->getState(Test.Var);
> >
> >    if (VarState == CS_Unknown) {
> > @@ -964,9 +963,9 @@ void splitVarStateForIf(const IfStmt * I
> >    }
> >  }
> >
> > -void splitVarStateForIfBinOp(const PropagationInfo &PInfo,
> > -  ConsumedStateMap *ThenStates, ConsumedStateMap *ElseStates) {
> > -
> > +static void splitVarStateForIfBinOp(const PropagationInfo &PInfo,
> > +                                    ConsumedStateMap *ThenStates,
> > +                                    ConsumedStateMap *ElseStates) {
> >    const VarTestResult &LTest = PInfo.getLTest(),
> >                        &RTest = PInfo.getRTest();
> >
> >
> > Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
> > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=231657&r1=231656&r2=231657&view=diff
> > ==============================================================================
> > --- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
> > +++ cfe/trunk/lib/Sema/SemaChecking.cpp Mon Mar  9 10:03:32 2015
> > @@ -8187,8 +8187,8 @@ static bool isSetterLikeSelector(Selecto
> >    return !isLowercase(str.front());
> >  }
> >
> > -Optional<int> GetNSMutableArrayArgumentIndex(Sema &S, ObjCMessageExpr *Message) {
> > -
> > +static Optional<int> GetNSMutableArrayArgumentIndex(Sema &S,
> > +                                                    ObjCMessageExpr *Message) {
> >    if (S.NSMutableArrayPointer.isNull()) {
> >      IdentifierInfo *NSMutableArrayId =
> >        S.NSAPIObj->getNSClassId(NSAPI::ClassId_NSMutableArray);
> >
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 





More information about the cfe-commits mailing list