[PATCH] D83419: [clangd] Add error() function for creating formatv-style llvm::Errors. NFC

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 8 12:56:55 PDT 2020


sammccall created this revision.
sammccall added reviewers: kbobyrev, hokein.
Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous, MaskRay, javed.absar, ilya-biryukov, mgorny.
Herald added a project: clang.

This is considerably terser than the makeStringError and friends, and
avoids verbosity cliffs that discourage adding log information.

It follows the syntax used in log/elog/vlog/dlog that have been successful.

The main caveats are:

- it's strictly out-of-place in logger.h, though kind of fits thematically and in implementation
- it claims the "error" identifier, which seems a bit too opinionated to put higher up in llvm

I've updated some users of StringError mostly at random - there are lots
more mechanical changes but I'd like to get this reviewed before making
them all.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83419

Files:
  clang-tools-extra/clangd/ClangdLSPServer.cpp
  clang-tools-extra/clangd/ClangdServer.cpp
  clang-tools-extra/clangd/CodeComplete.cpp
  clang-tools-extra/clangd/DraftStore.cpp
  clang-tools-extra/clangd/JSONTransport.cpp
  clang-tools-extra/clangd/PathMapping.cpp
  clang-tools-extra/clangd/RIFF.cpp
  clang-tools-extra/clangd/TUScheduler.cpp
  clang-tools-extra/clangd/index/Serialization.cpp
  clang-tools-extra/clangd/support/Logger.cpp
  clang-tools-extra/clangd/support/Logger.h
  clang-tools-extra/clangd/unittests/CMakeLists.txt
  clang-tools-extra/clangd/unittests/LoggerTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83419.276529.patch
Type: text/x-patch
Size: 21933 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200708/6d12cd60/attachment-0001.bin>


More information about the cfe-commits mailing list