class StmtSequence
Declaration
class StmtSequence { /* full declaration omitted */ };
Description
Identifies a list of statements. Can either identify a single arbitrary Stmt object, a continuous sequence of child statements inside a CompoundStmt or no statements at all.
Declared at: clang/include/clang/Analysis/CloneDetection.h:33
Member Variables
- private const clang::Stmt* S
- If this object identifies a sequence of statements inside a CompoundStmt, S points to this CompoundStmt. If this object only identifies a single Stmt, then S is a pointer to this Stmt.
- private const clang::Decl* D
- The declaration that contains the statements.
- private unsigned int StartIndex
- If EndIndex is non-zero, then S is a CompoundStmt and this StmtSequence instance is representing the CompoundStmt children inside the array [StartIndex, EndIndex).
- private unsigned int EndIndex
Method Overview
- public StmtSequence(const clang::CompoundStmt * Stmt, const clang::Decl * D, unsigned int StartIndex, unsigned int EndIndex)
- public StmtSequence(const clang::Stmt * Stmt, const clang::Decl * D)
- public StmtSequence()
- public const clang::Stmt * back() const
- public clang::StmtSequence::iterator begin() const
- public bool contains(const clang::StmtSequence & Other) const
- public bool empty() const
- public clang::StmtSequence::iterator end() const
- public const clang::Stmt * front() const
- public clang::ASTContext & getASTContext() const
- public clang::SourceLocation getBeginLoc() const
- public const clang::Decl * getContainingDecl() const
- public clang::SourceLocation getEndLoc() const
- public clang::SourceRange getSourceRange() const
- public bool holdsSequence() const
- public unsigned int size() const
Methods
¶StmtSequence(const clang::CompoundStmt* Stmt,
const clang::Decl* D,
unsigned int StartIndex,
unsigned int EndIndex)
StmtSequence(const clang::CompoundStmt* Stmt,
const clang::Decl* D,
unsigned int StartIndex,
unsigned int EndIndex)
Description
Constructs a StmtSequence holding multiple statements. The resulting StmtSequence identifies a continuous sequence of statements in the body of the given CompoundStmt. Which statements of the body should be identified needs to be specified by providing a start and end index that describe a non-empty sub-array in the body of the given CompoundStmt.
Declared at: clang/include/clang/Analysis/CloneDetection.h:61
Parameters
- const clang::CompoundStmt* Stmt
- A CompoundStmt that contains all statements in its body.
- const clang::Decl* D
- The Decl containing this Stmt.
- unsigned int StartIndex
- The inclusive start index in the children array of\p Stmt
- unsigned int EndIndex
- The exclusive end index in the children array of \p Stmt.
¶StmtSequence(const clang::Stmt* Stmt,
const clang::Decl* D)
StmtSequence(const clang::Stmt* Stmt,
const clang::Decl* D)
Description
Constructs a StmtSequence holding a single statement.
Declared at: clang/include/clang/Analysis/CloneDetection.h:68
Parameters
- const clang::Stmt* Stmt
- An arbitrary Stmt.
- const clang::Decl* D
- The Decl containing this Stmt.
¶StmtSequence()
StmtSequence()
Description
Constructs an empty StmtSequence.
Declared at: clang/include/clang/Analysis/CloneDetection.h:71
¶const clang::Stmt* back() const
const clang::Stmt* back() const
Description
Returns the last statement in this sequence. This method should only be called on a non-empty StmtSequence object.
Declared at: clang/include/clang/Analysis/CloneDetection.h:92
¶clang::StmtSequence::iterator begin() const
clang::StmtSequence::iterator begin() const
Description
Returns an iterator pointing to the first statement in this sequence.
Declared at: clang/include/clang/Analysis/CloneDetection.h:76
¶bool contains(
const clang::StmtSequence& Other) const
bool contains(
const clang::StmtSequence& Other) const
Description
Returns true if and only if this sequence covers a source range that contains the source range of the given sequence \p Other. This method should only be called on a non-empty StmtSequence object and passed a non-empty StmtSequence object.
Declared at: clang/include/clang/Analysis/CloneDetection.h:150
Parameters
- const clang::StmtSequence& Other
¶bool empty() const
bool empty() const
Description
Returns true if and only if this StmtSequence contains no statements.
Declared at: clang/include/clang/Analysis/CloneDetection.h:107
¶clang::StmtSequence::iterator end() const
clang::StmtSequence::iterator end() const
Description
Returns an iterator pointing behind the last statement in this sequence.
Declared at: clang/include/clang/Analysis/CloneDetection.h:79
¶const clang::Stmt* front() const
const clang::Stmt* front() const
Description
Returns the first statement in this sequence. This method should only be called on a non-empty StmtSequence object.
Declared at: clang/include/clang/Analysis/CloneDetection.h:84
¶clang::ASTContext& getASTContext() const
clang::ASTContext& getASTContext() const
Description
Returns the related ASTContext for the stored Stmts.
Declared at: clang/include/clang/Analysis/CloneDetection.h:110
¶clang::SourceLocation getBeginLoc() const
clang::SourceLocation getBeginLoc() const
Description
Returns the start sourcelocation of the first statement in this sequence. This method should only be called on a non-empty StmtSequence object.
Declared at: clang/include/clang/Analysis/CloneDetection.h:124
¶const clang::Decl* getContainingDecl() const
const clang::Decl* getContainingDecl() const
Description
Returns the declaration that contains the stored Stmts.
Declared at: clang/include/clang/Analysis/CloneDetection.h:113
¶clang::SourceLocation getEndLoc() const
clang::SourceLocation getEndLoc() const
Description
Returns the end sourcelocation of the last statement in this sequence. This method should only be called on a non-empty StmtSequence object.
Declared at: clang/include/clang/Analysis/CloneDetection.h:129
¶clang::SourceRange getSourceRange() const
clang::SourceRange getSourceRange() const
Description
Returns the source range of the whole sequence - from the beginning of the first statement to the end of the last statement.
Declared at: clang/include/clang/Analysis/CloneDetection.h:133
¶bool holdsSequence() const
bool holdsSequence() const
Description
Returns true if this objects holds a list of statements.
Declared at: clang/include/clang/Analysis/CloneDetection.h:119
¶unsigned int size() const
unsigned int size() const
Description
Returns the number of statements this object holds.
Declared at: clang/include/clang/Analysis/CloneDetection.h:98