This is an archive of the discontinued LLVM Phabricator instance.

[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

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

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

88

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.