diff options
author | Kazu Hirata <kazu@google.com> | 2023-10-01 15:53:53 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2023-10-01 15:53:53 -0700 |
commit | 8de2ecc2e75d496fc7fc8a24c3acf71732a3bd0c (patch) | |
tree | b60e5dc4c1c01bb674ff66def9bd11127d925033 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 9580468302a1c8f6236a121163c9087ac4e02cfe (diff) | |
download | llvm-8de2ecc2e75d496fc7fc8a24c3acf71732a3bd0c.zip llvm-8de2ecc2e75d496fc7fc8a24c3acf71732a3bd0c.tar.gz llvm-8de2ecc2e75d496fc7fc8a24c3acf71732a3bd0c.tar.bz2 |
[ExecutionEngine] Fix the call to DWARFContext::create
Without this patch, we pass G.getEndianness() as one of the parameters
to DWARFContext::create. The problem is that G.getEndianness() is of:
enum endianness {big, little, native};
whereas DWARFContext::create 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 G.getEndianness()
to a boolean value.
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions