[all-commits] [llvm/llvm-project] 781941: [clang] Use SourceLocation as key in hash maps, NFCI

Mikhail Maltsev via All-commits all-commits at lists.llvm.org
Tue Oct 20 08:24:55 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 781941183700b52d11b27227e3341385447610fa
      https://github.com/llvm/llvm-project/commit/781941183700b52d11b27227e3341385447610fa
  Author: Mikhail Maltsev <mikhail.maltsev at arm.com>
  Date:   2020-10-20 (Tue, 20 Oct 2020)

  Changed paths:
    M clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.h
    M clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp
    M clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.h
    M clang-tools-extra/clangd/FindTarget.cpp
    M clang/include/clang/Edit/EditedSource.h
    M clang/include/clang/Sema/Sema.h
    M clang/include/clang/Tooling/Syntax/Tokens.h
    M clang/lib/ARCMigrate/TransGCAttrs.cpp
    M clang/lib/ARCMigrate/TransProperties.cpp
    M clang/lib/ARCMigrate/Transforms.h
    M clang/lib/CodeGen/CGOpenMPRuntime.h
    M clang/lib/Edit/EditedSource.cpp
    M clang/lib/Tooling/Syntax/BuildTree.cpp
    M clang/lib/Tooling/Syntax/Tokens.cpp

  Log Message:
  -----------
  [clang] Use SourceLocation as key in hash maps, NFCI

The patch adjusts the existing `llvm::DenseMap<unsigned, T>` and
`llvm::DenseSet<unsigned>` objects that store source locations, so
that they use `SourceLocation` directly instead of `unsigned`.

This patch relies on the `DenseMapInfo` trait added in D89719.

It also replaces the construction of `SourceLocation` objects from
the constants -1 and -2 with calls to the trait's methods `getEmptyKey`
and `getTombstoneKey` where appropriate.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D69840




More information about the All-commits mailing list