[PATCH] D126183: Implement soft reset of the diagnostics engine.

Tapasweni Pathak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 22 23:51:01 PDT 2022


tapaswenipathak created this revision.
tapaswenipathak added a reviewer: v.g.vassilev.
tapaswenipathak added a project: clang.
Herald added a project: All.
tapaswenipathak requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch implements soft reset and adds tests for soft reset success of the diagnostics engine.

      

This patch adds unittest for soft reset success using #define public private. Multiple options were
used before arriving on using #define public private as discussed in https://github.com/vgvassilev/clang/pull/1.

      

1. Enable getter for private variables distinguishing soft reset.
2. Using any existing locs
3. gtest:friend_test https://google.github.io/googletest/reference/testing.html#FRIEND_TEST
4. using #define public private accomapnied with #undef private before and after the inclusion of `.h`

file to access a few private members of enclosing class in the test function.

      

This patch also adds a clang-repl test and a adapts clang:tools:clang-repl to return a boolean hadErrors
instead of integer 0.

      

Screenshots of testing this patch can be found on the mentioned pull request.

      

Co-authored-by: Vassil Vassilev <vvasilev at cern.ch>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126183

Files:
  include/clang/Basic/Diagnostic.h
  lib/Basic/Diagnostic.cpp
  test/Interpreter/error-recovery-pragmas.cpp
  tools/clang-repl/ClangRepl.cpp
  unittests/Basic/DiagnosticTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126183.431291.patch
Type: text/x-patch
Size: 5026 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220523/2c78d2d2/attachment.bin>


More information about the llvm-commits mailing list