Clarify contract of StringSaver (it null-terminates, callers rely on it).
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Thanks!
lib/Support/StringSaver.cpp | ||
---|---|---|
26 ↗ | (On Diff #156476) | While we have nice assertion message here, but in return we pay an extra lookup cost. I think we should avoid it (this function is likely to be used in hot path). Maybe just auto It = Unique.insert(S); if (It.second) { *It.first = Strings.save(V); } return *It.first. |
Comment Actions
Simplify insertion.
lib/Support/StringSaver.cpp | ||
---|---|---|
26 ↗ | (On Diff #156476) | I was all ready to explain why this doesn't work (keys in a map/set are const) but... it does. |