aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/ELFObjectFile.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-09-17 12:37:51 -0700
committerGitHub <noreply@github.com>2025-09-17 12:37:51 -0700
commit5cb7bf63eda283fb2b079458010467f00d52d78c (patch)
treed562a2d9224ab92edb2d16b953d5bf1a57079657 /llvm/lib/Object/ELFObjectFile.cpp
parent0d989b2aefe8d8f66981f1d39f56ce0214b5de86 (diff)
downloadllvm-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