|
clang 22.0.0git
|
#include "clang/Analysis/CloneDetection.h"#include "clang/AST/Attr.h"#include "clang/AST/DataCollection.h"#include "clang/Basic/SourceManager.h"#include "llvm/Support/MD5.h"#include "llvm/Support/Path.h"#include "clang/AST/StmtDataCollectors.inc"Go to the source code of this file.
Macros | |
| #define | DEF_ADD_DATA(CLASS, CODE) |
| #define | SKIP(CLASS) |
Functions | |
| static bool | containsAnyInGroup (StmtSequence &Seq, CloneDetector::CloneGroup &Group) |
Returns true if and only if Stmt contains at least one other sequence in the Group. | |
| static bool | containsGroup (CloneDetector::CloneGroup &Group, CloneDetector::CloneGroup &OtherGroup) |
Returns true if and only if all sequences in OtherGroup are contained by a sequence in Group. | |
| static size_t | createHash (llvm::MD5 &Hash) |
| static size_t | saveHash (const Stmt *S, const Decl *D, std::vector< std::pair< size_t, StmtSequence > > &StmtsByHash) |
| Generates and saves a hash code for the given Stmt. | |
| static void | CollectStmtSequenceData (const StmtSequence &Sequence, FoldingSetNodeIDWrapper &OutputData) |
| Writes the relevant data from all statements and child statements in the given StmtSequence into the given FoldingSetNodeID. | |
| static bool | areSequencesClones (const StmtSequence &LHS, const StmtSequence &RHS) |
| Returns true if both sequences are clones of each other. | |
| #define DEF_ADD_DATA | ( | CLASS, | |
| CODE ) |
Definition at line 199 of file CloneDetection.cpp.
| #define SKIP | ( | CLASS | ) |
Definition at line 208 of file CloneDetection.cpp.
|
static |
Returns true if both sequences are clones of each other.
Definition at line 333 of file CloneDetection.cpp.
References CollectStmtSequenceData().
Referenced by clang::RecursiveCloneTypeIIVerifyConstraint::constrain().
|
static |
Writes the relevant data from all statements and child statements in the given StmtSequence into the given FoldingSetNodeID.
Definition at line 316 of file CloneDetection.cpp.
References CollectStmtSequenceData(), clang::StmtSequence::getASTContext(), and clang::StmtSequence::getContainingDecl().
Referenced by areSequencesClones(), and CollectStmtSequenceData().
|
static |
Returns true if and only if Stmt contains at least one other sequence in the Group.
Definition at line 98 of file CloneDetection.cpp.
References clang::Seq.
Referenced by containsGroup().
|
static |
Returns true if and only if all sequences in OtherGroup are contained by a sequence in Group.
Definition at line 109 of file CloneDetection.cpp.
References containsAnyInGroup().
Referenced by clang::OnlyLargestCloneConstraint::constrain().
|
static |
Definition at line 223 of file CloneDetection.cpp.
Referenced by saveHash().
|
static |
Generates and saves a hash code for the given Stmt.
| S | The given Stmt. |
| D | The Decl containing S. |
| StmtsByHash | Output parameter that will contain the hash codes for each StmtSequence in the given Stmt. |
If the given Stmt is a CompoundStmt, this method will also generate hashes for all possible StmtSequences in the children of this Stmt.
Definition at line 248 of file CloneDetection.cpp.
References clang::Stmt::children(), createHash(), clang::Decl::getASTContext(), and saveHash().
Referenced by clang::RecursiveCloneTypeIIHashConstraint::constrain(), and saveHash().