Files
clang-p2996/bolt/lib/Core/DebugData.cpp
Kazu Hirata a7517e12ca [BOLT] Fix the initialization of DWARFDataExtractor
Without this patch, we pass Endian as one of the parameters to the
constructor of DWARFDataExtractor.  The problem is that Endian is of:

  enum endianness {big, little, native};

whereas the constructor is expecting "bool IsLittleEndian".  That is,
we are relying on an implicit conversion to convert big and little to
false and true, respectively.

When we migrate llvm::support::endianness to std::endian in future, we
can no longer rely on an implicit conversion because std::endian is
declared with "enum class".  Even if we could, the conversion would
not be guaranteed to work because, for example, libcxx defines:

  enum class endian {
    little = 0xDEAD,
    big = 0xFACE,
    :

where big and little are not boolean values.

This patch fixes the problem by properly converting Endian to a
boolean value.
2023-10-01 15:53:55 -07:00

46 KiB