[all-commits] [llvm/llvm-project] f36518: [clangd] Fix error handling in config.yaml parsing.

Sam McCall via All-commits all-commits at lists.llvm.org
Thu Jul 9 01:20:41 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f36518637d7dfe5f8e619db1bd65dc90c92b5afa
      https://github.com/llvm/llvm-project/commit/f36518637d7dfe5f8e619db1bd65dc90c92b5afa
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2020-07-09 (Thu, 09 Jul 2020)

  Changed paths:
    M clang-tools-extra/clangd/ConfigYAML.cpp
    M clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp

  Log Message:
  -----------
  [clangd] Fix error handling in config.yaml parsing.

Summary:
A few things were broken:
 - use of Document::parseBlockNode() is incorrect and prevents moving to the
   next doc in error cases. Use getRoot() instead.
 - bailing out in the middle of iterating over a list/dict isn't allowed,
   unless you are going to throw away the parser: the next skip() asserts.
   Always consume all items.
 - There were two concepts of fatal errors: error-diagnostics and drop-fragment.
   (The latter is the "return false" case in the parser). They didn't coincide.
   Now, parser errors and explicitly emitted error diagnostics are fatal.

Fixes https://github.com/clangd/clangd/issues/452

Reviewers: hokein

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D83436




More information about the All-commits mailing list