Skip to content

[libc++][modules] Add a header to forward-declare std::get #108285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 12, 2024

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Sep 11, 2024

This is necessary because e.g. ranges::elements_view uses std::get but it needs to have in scope the declaration of all the versions of std::get that exist in the library. This need is what had originally led to elements_view.h gaining an include of __fwd/complex.h, but in reality it is a more general issue that requires a canonical declration point for all the std::get variations.

This is necessary because e.g. ranges::elements_view uses std::get
but it needs to have in scope the declaration of all the versions
of std::get that exist in the library. This need is what had originally
led to elements_view.h gaining an include of __fwd/complex.h, but
in reality it is a more general issue that requires a canonical
declration point for all the std::get variations.
@ldionne ldionne requested a review from a team as a code owner September 11, 2024 19:56
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Sep 11, 2024
@llvmbot
Copy link
Member

llvmbot commented Sep 11, 2024

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

Changes

This is necessary because e.g. ranges::elements_view uses std::get but it needs to have in scope the declaration of all the versions of std::get that exist in the library. This need is what had originally led to elements_view.h gaining an include of __fwd/complex.h, but in reality it is a more general issue that requires a canonical declration point for all the std::get variations.


Full diff: https://github.com/llvm/llvm-project/pull/108285.diff

6 Files Affected:

  • (modified) libcxx/include/CMakeLists.txt (+2)
  • (added) libcxx/include/__fwd/get.h (+24)
  • (added) libcxx/include/__fwd/variant.h (+73)
  • (modified) libcxx/include/__ranges/elements_view.h (+1-1)
  • (modified) libcxx/include/module.modulemap (+2)
  • (modified) libcxx/include/variant (+3-20)
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index ffff8114e5870d..23d9aa0adddce8 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -424,6 +424,7 @@ set(files
   __fwd/format.h
   __fwd/fstream.h
   __fwd/functional.h
+  __fwd/get.h
   __fwd/ios.h
   __fwd/istream.h
   __fwd/mdspan.h
@@ -440,6 +441,7 @@ set(files
   __fwd/string_view.h
   __fwd/subrange.h
   __fwd/tuple.h
+  __fwd/variant.h
   __fwd/vector.h
   __hash_table
   __ios/fpos.h
diff --git a/libcxx/include/__fwd/get.h b/libcxx/include/__fwd/get.h
new file mode 100644
index 00000000000000..6121ed0efd2bab
--- /dev/null
+++ b/libcxx/include/__fwd/get.h
@@ -0,0 +1,24 @@
+//===---------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===---------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FWD_GET_H
+#define _LIBCPP___FWD_GET_H
+
+#include <__config>
+#include <__fwd/array.h>
+#include <__fwd/complex.h>
+#include <__fwd/pair.h>
+#include <__fwd/subrange.h>
+#include <__fwd/tuple.h>
+#include <__fwd/variant.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#endif // _LIBCPP___FWD_GET_H
diff --git a/libcxx/include/__fwd/variant.h b/libcxx/include/__fwd/variant.h
new file mode 100644
index 00000000000000..a6b713208d9947
--- /dev/null
+++ b/libcxx/include/__fwd/variant.h
@@ -0,0 +1,73 @@
+//===---------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===---------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___FWD_VARIANT_H
+#define _LIBCPP___FWD_VARIANT_H
+
+#include <__config>
+#include <__cstddef/size_t.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class... _Types>
+class _LIBCPP_TEMPLATE_VIS variant;
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS variant_size;
+
+template <class _Tp>
+inline constexpr size_t variant_size_v = variant_size<_Tp>::value;
+
+template <size_t _Ip, class _Tp>
+struct _LIBCPP_TEMPLATE_VIS variant_alternative;
+
+template <size_t _Ip, class _Tp>
+using variant_alternative_t = typename variant_alternative<_Ip, _Tp>::type;
+
+inline constexpr size_t variant_npos = static_cast<size_t>(-1);
+
+template <size_t _Ip, class... _Types>
+_LIBCPP_HIDE_FROM_ABI
+_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr variant_alternative_t<_Ip, variant<_Types...>>&
+get(variant<_Types...>&);
+
+template <size_t _Ip, class... _Types>
+_LIBCPP_HIDE_FROM_ABI
+_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr variant_alternative_t<_Ip, variant<_Types...>>&&
+get(variant<_Types...>&&);
+
+template <size_t _Ip, class... _Types>
+_LIBCPP_HIDE_FROM_ABI
+_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr const variant_alternative_t<_Ip, variant<_Types...>>&
+get(const variant<_Types...>&);
+
+template <size_t _Ip, class... _Types>
+_LIBCPP_HIDE_FROM_ABI
+_LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr const variant_alternative_t<_Ip, variant<_Types...>>&&
+get(const variant<_Types...>&&);
+
+template <class _Tp, class... _Types>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr _Tp& get(variant<_Types...>&);
+
+template <class _Tp, class... _Types>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr _Tp&& get(variant<_Types...>&&);
+
+template <class _Tp, class... _Types>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr const _Tp& get(const variant<_Types...>&);
+
+template <class _Tp, class... _Types>
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS constexpr const _Tp&&
+get(const variant<_Types...>&&);
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___FWD_VARIANT_H
diff --git a/libcxx/include/__ranges/elements_view.h b/libcxx/include/__ranges/elements_view.h
index f159f53dc0a832..989d36fbcaaae5 100644
--- a/libcxx/include/__ranges/elements_view.h
+++ b/libcxx/include/__ranges/elements_view.h
@@ -16,7 +16,7 @@
 #include <__concepts/derived_from.h>
 #include <__concepts/equality_comparable.h>
 #include <__config>
-#include <__fwd/complex.h>
+#include <__fwd/get.h>
 #include <__iterator/concepts.h>
 #include <__iterator/iterator_traits.h>
 #include <__ranges/access.h>
diff --git a/libcxx/include/module.modulemap b/libcxx/include/module.modulemap
index add8726dead428..4e179d871e24c6 100644
--- a/libcxx/include/module.modulemap
+++ b/libcxx/include/module.modulemap
@@ -1813,6 +1813,7 @@ module std_private_tuple_tuple_like_no_subrange [system] {
 module std_private_tuple_sfinae_helpers         [system] { header "__tuple/sfinae_helpers.h" }
 module std_private_tuple_tuple_element          [system] { header "__tuple/tuple_element.h" }
 module std_private_tuple_tuple_fwd              [system] { header "__fwd/tuple.h" }
+module std_private_get_fwd                      [system] { header "__fwd/get.h" }
 module std_private_tuple_tuple_indices          [system] { header "__tuple/tuple_indices.h" }
 module std_private_tuple_tuple_like             [system] {
   header "__tuple/tuple_like.h"
@@ -2103,5 +2104,6 @@ module std_private_utility_to_underlying           [system] { header "__utility/
 module std_private_utility_unreachable             [system] { header "__utility/unreachable.h" }
 
 module std_private_variant_monostate               [system] { header "__variant/monostate.h" }
+module std_private_variant_fwd                     [system] { header "__fwd/variant.h" }
 
 module std_private_vector_fwd                      [system] { header "__fwd/vector.h" }
diff --git a/libcxx/include/variant b/libcxx/include/variant
index 1cac603c27c243..2fa5623d4f118a 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -221,6 +221,7 @@ namespace std {
 #include <__functional/invoke.h>
 #include <__functional/operations.h>
 #include <__functional/unary_function.h>
+#include <__fwd/variant.h>
 #include <__memory/addressof.h>
 #include <__memory/construct_at.h>
 #include <__tuple/find_index.h>
@@ -307,15 +308,7 @@ __throw_bad_variant_access() {
 #  endif
 }
 
-template <class... _Types>
-class _LIBCPP_TEMPLATE_VIS variant;
-
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS variant_size;
-
-template <class _Tp>
-inline constexpr size_t variant_size_v = variant_size<_Tp>::value;
-
+// variant_size
 template <class _Tp>
 struct _LIBCPP_TEMPLATE_VIS variant_size<const _Tp> : variant_size<_Tp> {};
 
@@ -328,12 +321,7 @@ struct _LIBCPP_TEMPLATE_VIS variant_size<const volatile _Tp> : variant_size<_Tp>
 template <class... _Types>
 struct _LIBCPP_TEMPLATE_VIS variant_size<variant<_Types...>> : integral_constant<size_t, sizeof...(_Types)> {};
 
-template <size_t _Ip, class _Tp>
-struct _LIBCPP_TEMPLATE_VIS variant_alternative;
-
-template <size_t _Ip, class _Tp>
-using variant_alternative_t = typename variant_alternative<_Ip, _Tp>::type;
-
+// variant_alternative
 template <size_t _Ip, class _Tp>
 struct _LIBCPP_TEMPLATE_VIS variant_alternative<_Ip, const _Tp> : add_const<variant_alternative_t<_Ip, _Tp>> {};
 
@@ -349,8 +337,6 @@ struct _LIBCPP_TEMPLATE_VIS variant_alternative<_Ip, variant<_Types...>> {
   using type = __type_pack_element<_Ip, _Types...>;
 };
 
-inline constexpr size_t variant_npos = static_cast<size_t>(-1);
-
 template <size_t _NumAlternatives>
 _LIBCPP_HIDE_FROM_ABI constexpr auto __choose_index_type() {
 #  ifdef _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION
@@ -369,9 +355,6 @@ using __variant_index_t = decltype(std::__choose_index_type<_NumAlts>());
 template <class _IndexType>
 constexpr _IndexType __variant_npos = static_cast<_IndexType>(-1);
 
-template <class... _Types>
-class _LIBCPP_TEMPLATE_VIS variant;
-
 template <class... _Types>
 _LIBCPP_HIDE_FROM_ABI constexpr variant<_Types...>& __as_variant(variant<_Types...>& __vs) noexcept {
   return __vs;

Copy link
Contributor

@philnik777 philnik777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this solves a non modules-specifc issue I'd expect a test.

@ldionne
Copy link
Member Author

ldionne commented Sep 12, 2024

If this solves a non modules-specifc issue I'd expect a test.

This is already caught by our existing tests. If you remove __fwd/complex.h, some modules tests should fail. And when you do the top-level modularization like I did in my other patch, you definitely run into this issue (that's how I found out about this problem).

@philnik777
Copy link
Contributor

If this solves a non modules-specifc issue I'd expect a test.

This is already caught by our existing tests. If you remove __fwd/complex.h, some modules tests should fail. And when you do the top-level modularization like I did in my other patch, you definitely run into this issue (that's how I found out about this problem).

This also adds forward declarations for variant though, which didn't exist before AFAICT.

@ldionne
Copy link
Member Author

ldionne commented Sep 12, 2024

As we discussed during our 1:1, this issue is indeed caught by the existing tests when we modularized. The reason why things work right now is that variant is pulled into elements_view.h transitively via common_iterator. However once we modularize stuff, those declarations are not visible even though they are technically "there", and we need to properly include them.

@ldionne ldionne merged commit 04d3a6b into llvm:main Sep 12, 2024
58 of 60 checks passed
@ldionne ldionne deleted the review/modularization-fwd-declare-get branch September 12, 2024 17:35
@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 12, 2024

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux-bootstrap-asan running on sanitizer-buildbot2 while building libcxx at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/52/builds/2234

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
[991/1308] Building CXX object unittests/MIR/CMakeFiles/MIRTests.dir/MachineStableHashTest.cpp.o
[992/1308] Building CXX object unittests/Object/CMakeFiles/ObjectTests.dir/DXContainerTest.cpp.o
[993/1308] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/SymbolRemappingReaderTest.cpp.o
[994/1308] Building CXX object unittests/Remarks/CMakeFiles/RemarksTests.dir/BitstreamRemarksParsingTest.cpp.o
[995/1308] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/ItaniumManglingCanonicalizerTest.cpp.o
[996/1308] Building CXX object unittests/IR/CMakeFiles/IRTests.dir/VPIntrinsicTest.cpp.o
[997/1308] Building CXX object unittests/ObjectYAML/CMakeFiles/ObjectYAMLTests.dir/DWARFYAMLTest.cpp.o
[998/1308] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/BPFunctionNodeTest.cpp.o
[999/1308] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/InstrProfDataTest.cpp.o
[1000/1308] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/PGOCtxProfReaderWriterTest.cpp.o
FAILED: unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/PGOCtxProfReaderWriterTest.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm_build_asan/unittests/ProfileData -I/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData -I/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm_build_asan/include -I/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include -I/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/third-party/unittest/googletest/include -I/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/third-party/unittest/googlemock/include -nostdinc++ -isystem /home/b/sanitizer-x86_64-linux-bootstrap-asan/build/libcxx_build_asan/include -isystem /home/b/sanitizer-x86_64-linux-bootstrap-asan/build/libcxx_build_asan/include/c++/v1 -fsanitize=address -Wl,--rpath=/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/libcxx_build_asan/lib -L/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/libcxx_build_asan/lib -w -stdlib=libc++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17  -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -Wno-suggest-override -MD -MT unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/PGOCtxProfReaderWriterTest.cpp.o -MF unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/PGOCtxProfReaderWriterTest.cpp.o.d -o unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/PGOCtxProfReaderWriterTest.cpp.o -c /home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp:131:33: error: use of undeclared identifier 'Guids'; did you mean 'Guid'?
  131 |     DenseSet<GlobalValue::GUID> Guids;
      |                                 ^~~~~
      |                                 Guid
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/ProfileData/PGOCtxProfWriter.h:22:51: note: 'Guid' declared here
   22 | enum PGOCtxProfileRecords { Invalid = 0, Version, Guid, CalleeIndex, Counters };
      |                                                   ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp:131:32: error: expected ';' after expression
  131 |     DenseSet<GlobalValue::GUID> Guids;
      |                                ^
      |                                ;
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp:131:5: error: use of undeclared identifier 'DenseSet'
  131 |     DenseSet<GlobalValue::GUID> Guids;
      |     ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp:132:36: error: use of undeclared identifier 'Guids'
  132 |     Ctxes.at(1U).getContainedGuids(Guids);
      |                                    ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp:133:17: error: use of undeclared identifier 'Guids'; did you mean 'Guid'?
  133 |     EXPECT_THAT(Guids,
      |                 ^~~~~
      |                 Guid
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/third-party/unittest/googlemock/include/gmock/gmock-matchers.h:5496:72: note: expanded from macro 'EXPECT_THAT'
 5496 |       ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
      |                                                                        ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/third-party/unittest/googletest/include/gtest/gtest_pred_impl.h:109:36: note: expanded from macro 'EXPECT_PRED_FORMAT1'
  109 |   GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
      |                                    ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/third-party/unittest/googletest/include/gtest/gtest_pred_impl.h:100:34: note: expanded from macro 'GTEST_PRED_FORMAT1_'
  100 |   GTEST_ASSERT_(pred_format(#v1, v1), on_failure)
      |                                  ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/third-party/unittest/googletest/include/gtest/gtest_pred_impl.h:79:52: note: expanded from macro 'GTEST_ASSERT_'
   79 |   if (const ::testing::AssertionResult gtest_ar = (expression)) \
      |                                                    ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/ProfileData/PGOCtxProfWriter.h:22:51: note: 'Guid' declared here
   22 | enum PGOCtxProfileRecords { Invalid = 0, Version, Guid, CalleeIndex, Counters };
      |                                                   ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp:136:5: error: use of undeclared identifier 'Guids'; did you mean 'Guid'?
Step 10 (stage2/asan check) failure: stage2/asan check (failure)
...
[991/1308] Building CXX object unittests/MIR/CMakeFiles/MIRTests.dir/MachineStableHashTest.cpp.o
[992/1308] Building CXX object unittests/Object/CMakeFiles/ObjectTests.dir/DXContainerTest.cpp.o
[993/1308] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/SymbolRemappingReaderTest.cpp.o
[994/1308] Building CXX object unittests/Remarks/CMakeFiles/RemarksTests.dir/BitstreamRemarksParsingTest.cpp.o
[995/1308] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/ItaniumManglingCanonicalizerTest.cpp.o
[996/1308] Building CXX object unittests/IR/CMakeFiles/IRTests.dir/VPIntrinsicTest.cpp.o
[997/1308] Building CXX object unittests/ObjectYAML/CMakeFiles/ObjectYAMLTests.dir/DWARFYAMLTest.cpp.o
[998/1308] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/BPFunctionNodeTest.cpp.o
[999/1308] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/InstrProfDataTest.cpp.o
[1000/1308] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/PGOCtxProfReaderWriterTest.cpp.o
FAILED: unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/PGOCtxProfReaderWriterTest.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm_build0/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm_build_asan/unittests/ProfileData -I/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData -I/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm_build_asan/include -I/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include -I/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/third-party/unittest/googletest/include -I/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/third-party/unittest/googlemock/include -nostdinc++ -isystem /home/b/sanitizer-x86_64-linux-bootstrap-asan/build/libcxx_build_asan/include -isystem /home/b/sanitizer-x86_64-linux-bootstrap-asan/build/libcxx_build_asan/include/c++/v1 -fsanitize=address -Wl,--rpath=/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/libcxx_build_asan/lib -L/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/libcxx_build_asan/lib -w -stdlib=libc++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17  -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -Wno-suggest-override -MD -MT unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/PGOCtxProfReaderWriterTest.cpp.o -MF unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/PGOCtxProfReaderWriterTest.cpp.o.d -o unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/PGOCtxProfReaderWriterTest.cpp.o -c /home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp:131:33: error: use of undeclared identifier 'Guids'; did you mean 'Guid'?
  131 |     DenseSet<GlobalValue::GUID> Guids;
      |                                 ^~~~~
      |                                 Guid
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/ProfileData/PGOCtxProfWriter.h:22:51: note: 'Guid' declared here
   22 | enum PGOCtxProfileRecords { Invalid = 0, Version, Guid, CalleeIndex, Counters };
      |                                                   ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp:131:32: error: expected ';' after expression
  131 |     DenseSet<GlobalValue::GUID> Guids;
      |                                ^
      |                                ;
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp:131:5: error: use of undeclared identifier 'DenseSet'
  131 |     DenseSet<GlobalValue::GUID> Guids;
      |     ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp:132:36: error: use of undeclared identifier 'Guids'
  132 |     Ctxes.at(1U).getContainedGuids(Guids);
      |                                    ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp:133:17: error: use of undeclared identifier 'Guids'; did you mean 'Guid'?
  133 |     EXPECT_THAT(Guids,
      |                 ^~~~~
      |                 Guid
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/third-party/unittest/googlemock/include/gmock/gmock-matchers.h:5496:72: note: expanded from macro 'EXPECT_THAT'
 5496 |       ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
      |                                                                        ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/third-party/unittest/googletest/include/gtest/gtest_pred_impl.h:109:36: note: expanded from macro 'EXPECT_PRED_FORMAT1'
  109 |   GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
      |                                    ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/third-party/unittest/googletest/include/gtest/gtest_pred_impl.h:100:34: note: expanded from macro 'GTEST_PRED_FORMAT1_'
  100 |   GTEST_ASSERT_(pred_format(#v1, v1), on_failure)
      |                                  ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/third-party/unittest/googletest/include/gtest/gtest_pred_impl.h:79:52: note: expanded from macro 'GTEST_ASSERT_'
   79 |   if (const ::testing::AssertionResult gtest_ar = (expression)) \
      |                                                    ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/ProfileData/PGOCtxProfWriter.h:22:51: note: 'Guid' declared here
   22 | enum PGOCtxProfileRecords { Invalid = 0, Version, Guid, CalleeIndex, Counters };
      |                                                   ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp:136:5: error: use of undeclared identifier 'Guids'; did you mean 'Guid'?
Step 13 (stage3/asan check) failure: stage3/asan check (failure)
...
[846/1175] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/ItaniumManglingCanonicalizerTest.cpp.o
[847/1175] Building CXX object unittests/Remarks/CMakeFiles/RemarksTests.dir/BitstreamRemarksSerializerTest.cpp.o
[848/1175] Building CXX object unittests/Remarks/CMakeFiles/RemarksTests.dir/RemarksLinkingTest.cpp.o
[849/1175] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/AlignOfTest.cpp.o
[850/1175] Building CXX object unittests/IR/CMakeFiles/IRTests.dir/DataLayoutTest.cpp.o
[851/1175] Building CXX object unittests/MC/CMakeFiles/MCTests.dir/DwarfLineTableHeaders.cpp.o
[852/1175] Building CXX object unittests/Remarks/CMakeFiles/RemarksTests.dir/YAMLRemarksSerializerTest.cpp.o
[853/1175] Building CXX object unittests/ObjCopy/CMakeFiles/ObjCopyTests.dir/ObjCopyTest.cpp.o
[854/1175] Building CXX object unittests/MIR/CMakeFiles/MIRTests.dir/MachineStableHashTest.cpp.o
[855/1175] Building CXX object unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/PGOCtxProfReaderWriterTest.cpp.o
FAILED: unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/PGOCtxProfReaderWriterTest.cpp.o 
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm_build_asan/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm_build2_asan/unittests/ProfileData -I/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData -I/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm_build2_asan/include -I/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include -I/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/third-party/unittest/googletest/include -I/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/third-party/unittest/googlemock/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17  -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -Wno-suggest-override -MD -MT unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/PGOCtxProfReaderWriterTest.cpp.o -MF unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/PGOCtxProfReaderWriterTest.cpp.o.d -o unittests/ProfileData/CMakeFiles/ProfileDataTests.dir/PGOCtxProfReaderWriterTest.cpp.o -c /home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp:131:33: error: use of undeclared identifier 'Guids'; did you mean 'Guid'?
  131 |     DenseSet<GlobalValue::GUID> Guids;
      |                                 ^~~~~
      |                                 Guid
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/ProfileData/PGOCtxProfWriter.h:22:51: note: 'Guid' declared here
   22 | enum PGOCtxProfileRecords { Invalid = 0, Version, Guid, CalleeIndex, Counters };
      |                                                   ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp:131:32: error: expected ';' after expression
  131 |     DenseSet<GlobalValue::GUID> Guids;
      |                                ^
      |                                ;
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp:131:5: error: use of undeclared identifier 'DenseSet'
  131 |     DenseSet<GlobalValue::GUID> Guids;
      |     ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp:132:36: error: use of undeclared identifier 'Guids'
  132 |     Ctxes.at(1U).getContainedGuids(Guids);
      |                                    ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp:133:17: error: use of undeclared identifier 'Guids'; did you mean 'Guid'?
  133 |     EXPECT_THAT(Guids,
      |                 ^~~~~
      |                 Guid
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/third-party/unittest/googlemock/include/gmock/gmock-matchers.h:5496:72: note: expanded from macro 'EXPECT_THAT'
 5496 |       ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
      |                                                                        ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/third-party/unittest/googletest/include/gtest/gtest_pred_impl.h:109:36: note: expanded from macro 'EXPECT_PRED_FORMAT1'
  109 |   GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
      |                                    ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/third-party/unittest/googletest/include/gtest/gtest_pred_impl.h:100:34: note: expanded from macro 'GTEST_PRED_FORMAT1_'
  100 |   GTEST_ASSERT_(pred_format(#v1, v1), on_failure)
      |                                  ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/third-party/unittest/googletest/include/gtest/gtest_pred_impl.h:79:52: note: expanded from macro 'GTEST_ASSERT_'
   79 |   if (const ::testing::AssertionResult gtest_ar = (expression)) \
      |                                                    ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/ProfileData/PGOCtxProfWriter.h:22:51: note: 'Guid' declared here
   22 | enum PGOCtxProfileRecords { Invalid = 0, Version, Guid, CalleeIndex, Counters };
      |                                                   ^
/home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/unittests/ProfileData/PGOCtxProfReaderWriterTest.cpp:136:5: error: use of undeclared identifier 'Guids'; did you mean 'Guid'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants