This can be used to create a virtual environment (incl. VFS, source manager) for code snippets.
Details
Details
- Reviewers
sammccall klimek - Commits
- rG2e538089fa37: Add SourceManagerForFile helper which sets up SourceManager and dependencies…
rC331923: Add SourceManagerForFile helper which sets up SourceManager and dependencies…
rL331923: Add SourceManagerForFile helper which sets up SourceManager and dependencies…
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
include/clang/Tooling/Core/Environment.h | ||
---|---|---|
1 ↗ | (On Diff #144524) | I'm not sure about this abstraction - I can't tell what it represents, and what in future should/shouldn't be added to it.
|
Comment Actions
- Create SourceManagerForFile instead of Environment; put it in SourceManager.h which seems to be a better place.
Comment Actions
Thanks for the comment and suggestion!
I've changed this to SourceManagerForFile and move it to SourceManager.h, which seems to be a more natural fit. SourceManagerForFile sounds like a sensible name to me, but I'm guess there might be a better name...
include/clang/Basic/SourceManager.h | ||
---|---|---|
1819 ↗ | (On Diff #145386) | nit: single in-memory file |
1824 ↗ | (On Diff #145386) | why is this not just a constructor? it looks like it can't fail? |
1827 ↗ | (On Diff #145386) | this could also just be get() or operator* |
lib/Format/TokenAnalyzer.h | ||
71 ↗ | (On Diff #145386) | add a comment that this is only present if constructed from a string? |