clang 8.0.0

Static Public Member Functions | List of all members
clang::CloneConstraint Class Reference

This class is a utility class that contains utility functions for building custom constraints. More...

`#include "clang/Analysis/CloneDetection.h"`

## Static Public Member Functions
static void | filterGroups (std::vector< CloneDetector::CloneGroup > &CloneGroups, llvm::function_ref< bool(const CloneDetector::CloneGroup &)> Filter)
| Removes all groups by using a filter function. More...
static void | splitCloneGroups (std::vector< CloneDetector::CloneGroup > &CloneGroups, llvm::function_ref< bool(const StmtSequence &, const StmtSequence &)> Compare)
| Splits the given CloneGroups until the given Compare function returns true for all clones in a single group. More...

## Detailed Description

This class is a utility class that contains utility functions for building custom constraints.

Definition at line 229 of file CloneDetection.h.

## Member Function Documentation

## ◆ filterGroups()

static void clang::CloneConstraint::filterGroups | ( | std::vector< CloneDetector::CloneGroup > & | CloneGroups,
|  | llvm::function_ref< bool(const CloneDetector::CloneGroup &)> | Filter
| ) |  |
| inline static

Removes all groups by using a filter function.

Parameters

  CloneGroups | The list of CloneGroups that is supposed to be filtered.
  Filter | The filter function that should return true for all groups that should be removed from the list.

Definition at line 236 of file CloneDetection.h.

References clang::tooling::Filter.

Referenced by clang::MinComplexityConstraint::constrain(), clang::MinGroupSizeConstraint::constrain(), and clang::FilenamePatternConstraint::constrain().

## ◆ splitCloneGroups()

void CloneConstraint::splitCloneGroups | ( | std::vector< CloneDetector::CloneGroup > & | CloneGroups,
|  | llvm::function_ref< bool(const StmtSequence &, const StmtSequence &)> | Compare
| ) |  |
| static

Splits the given CloneGroups until the given Compare function returns true for all clones in a single group.

Parameters

  CloneGroups | A list of CloneGroups that should be modified.
  Compare | The comparison function that all clones are supposed to pass. Should return true if and only if two clones belong to the same CloneGroup.

Definition at line 480 of file CloneDetection.cpp.

References clang::Stmt::children(), and clang::Result.

Referenced by clang::RecursiveCloneTypeIIVerifyConstraint::constrain(), and clang::MatchingVariablePatternConstraint::constrain().

The documentation for this class was generated from the following files:

- include/clang/Analysis/CloneDetection.h
- lib/Analysis/CloneDetection.cpp