Details
- Reviewers
abrachet
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I encounter this issue when running the LLVM test suite with the address sanitizer enabled.
llvm/tools/llvm-mt/llvm-mt.cpp | ||
---|---|---|
153–157 | That should work too. WDYT? |
llvm/tools/llvm-mt/llvm-mt.cpp | ||
---|---|---|
153–157 | I didn't know about that overload. I'll change it use your version. |
In fact, bring back the size comparison to speed up the comparison in the case the sizes do not match
llvm/tools/llvm-mt/llvm-mt.cpp | ||
---|---|---|
153–157 | Ah, sorry I didn't mean to keep SameSize in my suggested change. Just this should be sufficient Same = std::equal(OutputBuffer->getBufferStart(), OutputBuffer->getBufferEnd(), FileBuffer->getBufferStart()); FileBuffer->getBufferStart(), FileBuffer->getBufferEnd()); |
llvm/tools/llvm-mt/llvm-mt.cpp | ||
---|---|---|
153–157 | I know, but checking the size first gives a shortcut in case the sizes are different (instead of scanning for a difference). Do you think we can keep it in this case ? |
llvm/tools/llvm-mt/llvm-mt.cpp | ||
---|---|---|
153–157 | I just realized that with the right iterator type, std::equals computes the distance and does the shortcut on its own. I'm removing the size comparison. |
That should work too. WDYT?