class CalledOnceCheckHandler

Declaration

class CalledOnceCheckHandler { /* full declaration omitted */ };

Declared at: clang/include/clang/Analysis/Analyses/CalledOnceCheck.h:47

Method Overview

Methods

CalledOnceCheckHandler()

Declared at: clang/include/clang/Analysis/Analyses/CalledOnceCheck.h:49

virtual void
handleBlockThatIsGuaranteedToBeCalledOnce(
    const clang::BlockDecl* Block)

Description

Called when the block is guaranteed to be called exactly once. It means that we can be stricter with what we report on that block.

Declared at: clang/include/clang/Analysis/Analyses/CalledOnceCheck.h:99

Parameters

const clang::BlockDecl* Block
-- block declaration that is known to be called exactly once.

virtual void handleBlockWithNoGuarantees(
    const clang::BlockDecl* Block)

Description

Called when the block has no guarantees about how many times it can get called. It means that we should be more lenient with reporting warnings in it.

Declared at: clang/include/clang/Analysis/Analyses/CalledOnceCheck.h:105

Parameters

const clang::BlockDecl* Block
-- block declaration in question.

virtual void handleCapturedNeverCalled(
    const clang::ParmVarDecl* Parameter,
    const clang::Decl* Where,
    bool IsCompletionHandler)

Description

Called when captured parameter is not called at all.

Declared at: clang/include/clang/Analysis/Analyses/CalledOnceCheck.h:73

Parameters

const clang::ParmVarDecl* Parameter
-- parameter that should be called once.
const clang::Decl* Where
-- declaration that captures \p Parameter
bool IsCompletionHandler
-- true, if parameter is a completion handler.

virtual void handleDoubleCall(
    const clang::ParmVarDecl* Parameter,
    const clang::Expr* Call,
    const clang::Expr* PrevCall,
    bool IsCompletionHandler,
    bool Poised)

Description

Called when parameter is called twice.

Declared at: clang/include/clang/Analysis/Analyses/CalledOnceCheck.h:59

Parameters

const clang::ParmVarDecl* Parameter
-- parameter that should be called once.
const clang::Expr* Call
-- call to report the warning.
const clang::Expr* PrevCall
-- previous call.
bool IsCompletionHandler
-- true, if parameter is a completion handler.
bool Poised
-- true, if the second call is guaranteed to happen after the first call.

virtual void handleNeverCalled(
    const clang::ParmVarDecl* Parameter,
    bool IsCompletionHandler)

Description

Called when parameter is not called at all.

Declared at: clang/include/clang/Analysis/Analyses/CalledOnceCheck.h:66

Parameters

const clang::ParmVarDecl* Parameter
-- parameter that should be called once.
bool IsCompletionHandler
-- true, if parameter is a completion handler.

virtual void handleNeverCalled(
    const clang::ParmVarDecl* Parameter,
    const clang::Decl* Function,
    const clang::Stmt* Where,
    clang::NeverCalledReason Reason,
    bool IsCalledDirectly,
    bool IsCompletionHandler)

Description

Called when parameter is not called on one of the paths. Usually we try to find a statement that is the least common ancestor of the path containing the call and not containing the call. This helps us to pinpoint a bad path for the user.

Declared at: clang/include/clang/Analysis/Analyses/CalledOnceCheck.h:89

Parameters

const clang::ParmVarDecl* Parameter
-- parameter that should be called once.
const clang::Decl* Function
-- function declaration where the problem occurred.
const clang::Stmt* Where
-- the least common ancestor statement.
clang::NeverCalledReason Reason
-- a reason describing the path without a call.
bool IsCalledDirectly
-- true, if parameter actually gets called on the other path. It is opposed to be used in some other way (added to some collection, passed as a parameter, etc.).
bool IsCompletionHandler
-- true, if parameter is a completion handler.

virtual ~CalledOnceCheckHandler()

Declared at: clang/include/clang/Analysis/Analyses/CalledOnceCheck.h:50