Page MenuHomePhabricator

[clangd] Improve const-correctness of Symbol->Detail. NFC
ClosedPublic

Authored by sammccall on Jan 15 2018, 4:03 AM.

Details

Summary

This would have caught a bug I wrote in an early version of D42049, where
an index user could overwrite data internal to the index because the Symbol is
not deep-const.

The YAML traits are now a bit more verbose, but separate concerns a bit more
nicely: ArenaPtr can be reused for other similarly-allocated objects, including
scalars etc.

Diff Detail

Repository
rL LLVM

Event Timeline

sammccall created this revision.Jan 15 2018, 4:03 AM
hokein accepted this revision.Jan 15 2018, 7:56 AM

LTGM.

clangd/index/SymbolYAML.cpp
84 ↗(On Diff #129830)

woo, I learnt new thing here. I'd expect a comment, using placement new with the custom allocator :)

88 ↗(On Diff #129830)

The template type should be T, I think.

This revision is now accepted and ready to land.Jan 15 2018, 7:56 AM
sammccall marked 2 inline comments as done.Jan 15 2018, 12:04 PM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.