diff options
author | Kazu Hirata <kazu@google.com> | 2023-10-01 15:53:55 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2023-10-01 15:53:55 -0700 |
commit | a7517e12caab0750d3dfd7c0c6faec9acc7e5a2b (patch) | |
tree | d8e7d43f2d0da9ade28e4178fcc44f89f5ae8582 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 8de2ecc2e75d496fc7fc8a24c3acf71732a3bd0c (diff) | |
download | llvm-a7517e12caab0750d3dfd7c0c6faec9acc7e5a2b.zip llvm-a7517e12caab0750d3dfd7c0c6faec9acc7e5a2b.tar.gz llvm-a7517e12caab0750d3dfd7c0c6faec9acc7e5a2b.tar.bz2 |
[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.
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions