|
| | StmtDataCollector (const Stmt *S, ASTContext &Context, T &DataConsumer) |
| | Collects data of the given Stmt. More...
|
| |
| void | addData (DataPiece Integer) |
| |
| void | addData (llvm::StringRef Str) |
| |
| void | addData (const QualType &QT) |
| |
| | DEF_ADD_DATA (Stmt,{addData(S->getStmtClass());addData(getMacroStack(S->getLocStart(), Context));addData(getMacroStack(S->getLocEnd(), Context));}) DEF_ADD_DATA(Expr |
| |
| | DEF_ADD_DATA (ArrayTypeTraitExpr,{addData(S->getTrait());}) DEF_ADD_DATA(ExpressionTraitExpr |
| |
| | DEF_ADD_DATA (PredefinedExpr,{addData(S->getIdentType());}) DEF_ADD_DATA(TypeTraitExpr |
| |
| | for (unsigned i=0;i< S->getNumArgs();++i) addData(S-> getArg(i) ->getType()) |
| |
| | DEF_ADD_DATA (CallExpr,{if(const FunctionDecl *D=S->getDirectCallee()){if(auto Args=D->getTemplateSpecializationArgs()){std::string ArgString;llvm::raw_string_ostream OS(ArgString);for(unsigned i=0;i< Args->size();++i){Args->get(i).print(Context.getLangOpts(), OS);OS<< '\n';}OS.flush();addData(ArgString);}addData(D->getQualifiedNameAsString());}}) DEF_ADD_DATA(CXXCatchStmt |
| |
| | DEF_ADD_DATA (CXXDeleteExpr,{addData(S->isArrayFormAsWritten());addData(S->isGlobalDelete());}) DEF_ADD_DATA(ObjCBridgedCastExpr |
| |
| | DEF_ADD_DATA (BinaryOperator,{addData(S->getOpcode());}) DEF_ADD_DATA(UnaryOperator |
| |
| | DEF_ADD_DATA (GotoStmt,{addData(S->getLabel() ->getName());}) DEF_ADD_DATA(IndirectGotoStmt |
| |
| | DEF_ADD_DATA (LabelStmt,{addData(S->getDecl() ->getName());}) DEF_ADD_DATA(MSDependentExistsStmt |
| |
| | DEF_ADD_DATA (AddrLabelExpr,{addData(S->getLabel() ->getName());}) DEF_ADD_DATA(ObjCIndirectCopyRestoreExpr |
| |
| | DEF_ADD_DATA (ObjCPropertyRefExpr,{addData(S->isSuperReceiver());addData(S->isImplicitProperty());}) DEF_ADD_DATA(ObjCAtCatchStmt |
| |
| | DEF_ADD_DATA (CXXFoldExpr,{addData(S->isRightFold());addData(S->getOperator());}) DEF_ADD_DATA(GenericSelectionExpr |
| |
| void | Visit (PTR(Stmt) S) |
| |
| | BINOP_FALLBACK (PtrMemD) BINOP_FALLBACK(PtrMemI) BINOP_FALLBACK(Mul) BINOP_FALLBACK(Div) BINOP_FALLBACK(Rem) BINOP_FALLBACK(Add) BINOP_FALLBACK(Sub) BINOP_FALLBACK(Shl) BINOP_FALLBACK(LT) BINOP_FALLBACK(GT) BINOP_FALLBACK(LE) BINOP_FALLBACK(GE) BINOP_FALLBACK(EQ) BINOP_FALLBACK(NE) BINOP_FALLBACK(And) BINOP_FALLBACK(Xor) BINOP_FALLBACK(Or) BINOP_FALLBACK(LAnd) BINOP_FALLBACK(LOr) CAO_FALLBACK(MulAssign) CAO_FALLBACK(DivAssign) CAO_FALLBACK(RemAssign) CAO_FALLBACK(AddAssign) CAO_FALLBACK(SubAssign) CAO_FALLBACK(ShlAssign) CAO_FALLBACK(ShrAssign) CAO_FALLBACK(AndAssign) CAO_FALLBACK(OrAssign) UNARYOP_FALLBACK(PostInc) UNARYOP_FALLBACK(PostDec) UNARYOP_FALLBACK(PreInc) UNARYOP_FALLBACK(PreDec) UNARYOP_FALLBACK(AddrOf) UNARYOP_FALLBACK(Deref) UNARYOP_FALLBACK(Plus) UNARYOP_FALLBACK(Minus) UNARYOP_FALLBACK(Not) UNARYOP_FALLBACK(LNot) UNARYOP_FALLBACK(Real) UNARYOP_FALLBACK(Imag) UNARYOP_FALLBACK(Extension) UNARYOP_FALLBACK(Coawait) voidVisitStmt(PTR(Stmt) Node) |
| |
template<typename T>
class clang::clone_detection::StmtDataCollector< T >
Collects the data of a single Stmt.
This class defines what a code clone is: If it collects for two statements the same data, then those two statements are considered to be clones of each other.
All collected data is forwarded to the given data consumer of the type T. The data consumer class needs to provide a member method with the signature: update(StringRef Str)
Definition at line 53 of file CloneDetection.h.