clang 20.0.0git
|
#include "clang/Analysis/CloneDetection.h"
#include "clang/AST/Attr.h"
#include "clang/AST/DataCollection.h"
#include "clang/AST/DeclTemplate.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 200 of file CloneDetection.cpp.
#define SKIP | ( | CLASS | ) |
Definition at line 209 of file CloneDetection.cpp.
|
static |
Returns true if both sequences are clones of each other.
Definition at line 334 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 317 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 99 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 110 of file CloneDetection.cpp.
References containsAnyInGroup().
Referenced by clang::OnlyLargestCloneConstraint::constrain().
|
static |
Definition at line 224 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 249 of file CloneDetection.cpp.
References createHash(), D, clang::Decl::getASTContext(), and saveHash().
Referenced by clang::RecursiveCloneTypeIIHashConstraint::constrain(), and saveHash().