[all-commits] [llvm/llvm-project] 65eb74: PointerLikeTypeTraits: Standardize NumLowBitsAvail...

David Blaikie via All-commits all-commits at lists.llvm.org
Thu Jan 16 15:30:56 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 65eb74e94b414fcde6bfa810d1c30c7fcb136b77
      https://github.com/llvm/llvm-project/commit/65eb74e94b414fcde6bfa810d1c30c7fcb136b77
  Author: David Blaikie <dblaikie at gmail.com>
  Date:   2020-01-16 (Thu, 16 Jan 2020)

  Changed paths:
    M clang/include/clang/AST/CanonicalType.h
    M clang/include/clang/AST/DeclGroup.h
    M clang/include/clang/AST/ExternalASTSource.h
    M clang/include/clang/AST/TemplateName.h
    M clang/include/clang/AST/Type.h
    M clang/include/clang/Basic/IdentifierTable.h
    M clang/include/clang/Basic/SourceLocation.h
    M clang/include/clang/CodeGen/ConstantInitFuture.h
    M clang/include/clang/Sema/Ownership.h
    M llvm/include/llvm/ADT/IntervalMap.h
    M llvm/include/llvm/ADT/PointerEmbeddedInt.h
    M llvm/include/llvm/ADT/PointerIntPair.h
    M llvm/include/llvm/IR/Use.h
    M llvm/include/llvm/Support/PointerLikeTypeTraits.h
    M llvm/lib/Analysis/GlobalsModRef.cpp
    M llvm/unittests/ADT/PointerEmbeddedIntTest.cpp
    M llvm/unittests/ADT/PointerIntPairTest.cpp
    M mlir/include/mlir/IR/Attributes.h
    M mlir/include/mlir/IR/Function.h
    M mlir/include/mlir/IR/Identifier.h
    M mlir/include/mlir/IR/Location.h
    M mlir/include/mlir/IR/Module.h
    M mlir/include/mlir/IR/OperationSupport.h
    M mlir/include/mlir/IR/Types.h
    M mlir/include/mlir/IR/Value.h
    M polly/include/polly/CodeGen/IslExprBuilder.h

  Log Message:
  -----------
  PointerLikeTypeTraits: Standardize NumLowBitsAvailable on static constexpr rather than anonymous enum

This is (more?) usable by GDB pretty printers and seems nicer to write.

There's one tricky caveat that in C++14 (LLVM's codebase today) the
static constexpr member declaration is not a definition - so odr use of
this constant requires an out of line definition, which won't be
provided (that'd make all these trait classes more annoyidng/expensive
to maintain). But the use of this constant in the library implementation
is/should always be in a non-odr context - only two unit tests needed to
be touched to cope with this/avoid odr using these constants.

Based on/expanded from D72590 by Christian Sigg.




More information about the All-commits mailing list