[PATCH] D51725: Allow un-setting the compilation database path
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 13 06:18:29 PDT 2018
kadircet added inline comments.
================
Comment at: clangd/Protocol.h:368
+ /// both Optionals are instantiated.
+ llvm::Optional<llvm::Optional<std::string>> compilationDatabasePath;
----------------
ilya-biryukov wrote:
> Not a big fan or something like this, but maybe give special meaning to empty path instead of wrapping an optional into an optional?
>
> Double optionals are a real pain to write and read.
Sorry just passing by since I've seen a similar usage that already exists in codebase, wanted to point it out.
Some api like this could be easier, to make the decision of using empty path or anything else for an invalid path and making it an implementation detail.
https://github.com/llvm-mirror/clang/blob/master/include/clang/Sema/DeclSpec.h#L53
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D51725
More information about the cfe-commits
mailing list