[all-commits] [llvm/llvm-project] b9543f: Revert "[clang][Interp][NFC] Trim Source.h includes"

Sterling-Augustine via All-commits all-commits at lists.llvm.org
Fri Jul 14 13:41:25 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b9543f7de69770a97e983452c5158acc3b4783c7
      https://github.com/llvm/llvm-project/commit/b9543f7de69770a97e983452c5158acc3b4783c7
  Author: Sterling Augustine <saugustine at google.com>
  Date:   2023-07-14 (Fri, 14 Jul 2023)

  Changed paths:
    M clang/lib/AST/Interp/Source.h

  Log Message:
  -----------
  Revert "[clang][Interp][NFC] Trim Source.h includes"

This reverts commit 245d10b7a2c12ec25e7b5860a38c61991543a739 which causes
errors like the ones below on slightly older versions of clang:

```
In file included from .../clang/lib/AST/Interp/Source.h:17:
In file included from .../llvm/include/llvm/ADT/PointerUnion.h:19:
In file included from .../llvm/include/llvm/ADT/PointerIntPair.h:18:
.../llvm/include/llvm/Support/PointerLikeTypeTraits.h:61:28: error: invalid application of 'alignof' to an incomplete type 'clang::Decl'
   61 |       detail::ConstantLog2<alignof(T)>::value;
      |                            ^~~~~~~~~~
.../llvm/include/llvm/Support/PointerLikeTypeTraits.h:101:56: note: in instantiation of static data member 'llvm::PointerLikeTypeTraits<clang::Decl *>::NumLowBitsAvailable' requested here
  101 |   static constexpr int NumLowBitsAvailable = NonConst::NumLowBitsAvailable;
      |                                                        ^
.../llvm/include/llvm/ADT/PointerUnion.h:38:54: note: in instantiation of static data member 'llvm::PointerLikeTypeTraits<const clang::Decl *>::NumLowBitsAvailable' requested here
   38 |     return std::min<int>({PointerLikeTypeTraits<Ts>::NumLowBitsAvailable...});
      |                                                      ^
.../llvm/include/llvm/ADT/PointerUnion.h:52:48: note: in instantiation of function template specialization 'llvm::pointer_union_detail::lowBitsAvailable<const clang::Decl *, const clang::Stmt *>' requested here
   52 |     static constexpr int NumLowBitsAvailable = lowBitsAvailable<PTs...>();
      |                                                ^
.../llvm/include/llvm/ADT/PointerIntPair.h:169:28: note: in instantiation of static data member 'llvm::pointer_union_detail::PointerUnionUIntTraits<const clang::Decl *, const clang::Stmt *>::NumLowBitsAvailable' requested here
  169 |   static_assert(PtrTraits::NumLowBitsAvailable <
      |                            ^
.../llvm/include/llvm/ADT/PointerIntPair.h:111:13: note: in instantiation of template class 'llvm::PointerIntPairInfo<void *, 1, llvm::pointer_union_detail::PointerUnionUIntTraits<const clang::Decl *, const clang::Stmt *>>' requested here
  111 |     Value = Info::updateInt(Info::updatePointer(0, PtrVal),
      |             ^
.../llvm/include/llvm/ADT/PointerIntPair.h:89:5: note: in instantiation of member function 'llvm::PointerIntPair<void *, 1, int, llvm::pointer_union_detail::PointerUnionUIntTraits<const clang::Decl *, const clang::Stmt *>>::setPointerAndInt' requested here
   89 |     setPointerAndInt(PtrVal, IntVal);
      |     ^
.../llvm/include/llvm/ADT/PointerUnion.h:77:16: note: in instantiation of member function 'llvm::PointerIntPair<void *, 1, int, llvm::pointer_union_detail::PointerUnionUIntTraits<const clang::Decl *, const clang::Stmt *>>::PointerIntPair' requested here
   77 |         : Base(ValTy(const_cast<void *>(
      |                ^
.../clang/lib/AST/Interp/Source.h:76:31: note: in instantiation of member function 'llvm::pointer_union_detail::PointerUnionMembers<llvm::PointerUnion<const clang::Decl *, const clang::Stmt *>, llvm::PointerIntPair<void *, 1, int, llvm::pointer_union_detail::PointerUnionUIntTraits<const clang::Decl *, const clang::Stmt *>>, 1, const clang::Stmt *>::PointerUnionMembers' requested here
   76 |   SourceInfo(const Stmt *E) : Source(E) {}
      |                               ^
.../clang/lib/AST/Interp/Source.h:22:7: note: forward declaration of 'clang::Decl'
   22 | class Decl;
      |       ^
```




More information about the All-commits mailing list