diff options
author | Kazu Hirata <kazu@google.com> | 2025-09-17 12:37:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-17 12:37:51 -0700 |
commit | 5cb7bf63eda283fb2b079458010467f00d52d78c (patch) | |
tree | d562a2d9224ab92edb2d16b953d5bf1a57079657 /llvm/lib/Object/ELFObjectFile.cpp | |
parent | 0d989b2aefe8d8f66981f1d39f56ce0214b5de86 (diff) | |
download | llvm-5cb7bf63eda283fb2b079458010467f00d52d78c.zip llvm-5cb7bf63eda283fb2b079458010467f00d52d78c.tar.gz llvm-5cb7bf63eda283fb2b079458010467f00d52d78c.tar.bz2 |
[Support] Simplify has_StreamOperator (NFC) (#159242)
Without this patch, we are doing a roundtrip on types. Specifically,
if decltype(...) is well formed, std::is_same_v evaluates to a boolean
value. We then pass the boolean value to std::enable_if_t, go through
the sizeof(char)/sizeof(double) trick, and then come back to a boolean
value.
This patch simplifies all this by having test() return
std::is_same<...>. The "caller" attaches ::value, so effectively we
are using std::is_same<...>::value when decltype(...) is well formed,
bypassing std::enable_if_t and the sizeof(char)/sizeof(double) trick.
If we did not care about the return type of the shift operator, we
could use llvm::is_detected, but the return type check doesn't allow
us to simplify things that far.
Diffstat (limited to 'llvm/lib/Object/ELFObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions