Use std::clamp directly from the standard library now that LLVM is built with
C++17 standards mode.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM.
If you’re up for it, cleaning up how we parse tolerance in clang and how we store it in the context would be nice.
If not, I’ll probably do it later today so no worries.
Thanks for the clean up!
llvm/lib/Transforms/Utils/MisExpect.cpp | ||
---|---|---|
171 | I don’t know what I was thinking when I implemented the tolerance option. There’s no reason they need to be 64-bit. Really, we should fix how we parse and store the tolerance values. That would allow us to ditch all these casts here and also choose more reasonable types. Especially since they can’t exceed 100 … |
llvm/lib/Transforms/Utils/MisExpect.cpp | ||
---|---|---|
75 | Yeah, I noticed this. Not a biggie - just fixed and rebased. |
Ugh. in D131935 I think I forgot to update the return type here, despite changing everything else to uint32_t.
When you rebase, could you update this?