[clang-tidy][NFC] Remove duplicated code

Remove duplicated matchers by moving some of them to
utils/Matchers.h. Add some anonymous namespaces and
renamed some code to avoid ODR issues.

GitOrigin-RevId: b6f6be4b500ff64c23a5103ac3311cb74519542f
45 files changed