llvm-project/clang/test
Devin Coughlin e39bd407ba [analyzer] Add generateErrorNode() APIs to CheckerContext.
The analyzer trims unnecessary nodes from the exploded graph before reporting
path diagnostics. However, in some cases it can trim all nodes (including the
error node), leading to an assertion failure (see
https://llvm.org/bugs/show_bug.cgi?id=24184).

This commit addresses the issue by adding two new APIs to CheckerContext to
explicitly create error nodes. Unless the client provides a custom tag, these
APIs tag the node with the checker's tag -- preventing it from being trimmed.
The generateErrorNode() method creates a sink error node, while
generateNonFatalErrorNode() creates an error node for a path that should
continue being explored.

The intent is that one of these two methods should be used whenever a checker
creates an error node.

This commit updates the checkers to use these APIs. These APIs
(unlike addTransition() and generateSink()) do not take an explicit Pred node.
This is because there are not any error nodes in the checkers that were created
with an explicit different than the default (the CheckerContext's Pred node).

It also changes generateSink() to require state and pred nodes (previously
these were optional) to reduce confusion.

Additionally, there were several cases where checkers did check whether a
generated node could be null; we now explicitly check for null in these places.

This commit also includes a test case written by Ying Yi as part of
http://reviews.llvm.org/D12163 (that patch originally addressed this issue but
was reverted because it introduced false positive regressions).

Differential Revision: http://reviews.llvm.org/D12780

llvm-svn: 247859
2015-09-16 22:03:05 +00:00
..
ARCMT [Edit] Fix issue with tracking what macro argument inputs have been edited. 2015-09-11 20:09:11 +00:00
ASTMerge PR10405 - Desugar FunctionType and TemplateSpecializationType if any type that appears inside needs to be desugared. 2015-07-16 01:06:17 +00:00
Analysis [analyzer] Add generateErrorNode() APIs to CheckerContext. 2015-09-16 22:03:05 +00:00
CXX thread_local is not implemented for targeting cygwin yet. 2015-09-09 22:51:31 +00:00
CodeCompletion [Tests] Modified Lit Tests to be C++11 compatibile 2015-08-27 18:49:15 +00:00
CodeGen Make clang/test/CodeGen/catch-undef-behavior.c* capable of -Asserts with "opt -instnamer". 2015-09-15 09:50:24 +00:00
CodeGenCUDA [CUDA] Postprocess bitcode linked in during device-side CUDA compilation. 2015-09-10 18:24:23 +00:00
CodeGenCXX [WinEH] Pass the catch adjectives to catchpad directly 2015-09-16 20:15:55 +00:00
CodeGenObjC Add test coverage for @encode(SEL); completely untested until now. 2015-09-15 20:05:20 +00:00
CodeGenObjCXX Fix a nasty bug with the partial destruction of nested arrays; 2015-09-14 18:57:08 +00:00
CodeGenOpenCL Fix invalid shufflevector operands 2015-08-02 15:28:10 +00:00
Coverage
CoverageMapping InstrProf: Fix a misuse of the FunctionDecl API when generating coverage 2015-07-28 00:41:51 +00:00
Driver [Solaris] Default to -fno-cxa-finalize. 2015-09-14 23:21:31 +00:00
FixIt Replace __double_underscored type nullability qualifiers with _Uppercase_underscored 2015-06-24 22:02:08 +00:00
Format Disable style-on-command-line test on Windows 2015-06-09 17:47:59 +00:00
Frontend Revert "Always_inline codegen rewrite" and 2 follow-ups. 2015-09-14 21:35:16 +00:00
Headers Revert "Revert r241620 and follow-up commits" and move the initialization 2015-07-08 01:00:30 +00:00
Index [sema] Fix assertion hit when using libclang to index a particular C++ snippet involving templates. 2015-09-11 01:44:56 +00:00
Integration
Layout Fix the layout of bitfields in ms_struct unions: their 2015-08-19 22:42:36 +00:00
Lexer Turn off __has_feature(cxx_rtti) when -fno-rtti-data is present 2015-08-13 17:56:49 +00:00
Misc C11 _Bool bitfield diagnostic 2015-09-14 21:27:36 +00:00
Modules [modules] Fix a corner case in the macro override rules: properly handle overridden leaf module macros. 2015-09-16 00:55:50 +00:00
OpenMP Allow static local variables specified on data-sharing attribute clauses. 2015-09-15 18:56:58 +00:00
PCH [OpenCL] Add new types for OpenCL 2.0. 2015-09-15 11:18:52 +00:00
Parser Windows ARM: ignore calling conventions as described on MSDN 2015-08-14 18:00:09 +00:00
Preprocessor [WebAssembly] Define the atomic type sizes 2015-09-14 21:56:37 +00:00
Profile Tweak a couple of -fprofile tests in clang/test to accept backslash in path. 2015-07-10 13:11:08 +00:00
Rewriter __declspec is not a core Clang language extension. Instead, require -fms-extensions or -fborland to enable the language extension. 2015-05-26 19:44:52 +00:00
Sema Prevent implicit re-interpret casts between ExtVector and Scalar types. 2015-09-15 00:21:56 +00:00
SemaCUDA [CUDA] Check register names on appropriate side of cuda compilation only. 2015-08-27 19:54:21 +00:00
SemaCXX MS ABI: Don't allow dllexport/import on lambdas 2015-09-15 21:05:30 +00:00
SemaObjC C11 _Bool bitfield diagnostic 2015-09-14 21:27:36 +00:00
SemaObjCXX Don't crash when passing &@selector to a _Nonnull parameter. Fixes PR24774. 2015-09-15 23:17:17 +00:00
SemaOpenCL [OpenCL] Improve diagnostics detecting implicit vector conversion. 2015-08-30 18:06:39 +00:00
SemaTemplate Fix assertion failure in TransformOpaqueValueExpr 2015-09-01 22:50:31 +00:00
TableGen
Tooling Change the expectation for test/Tooling/ms-asm-no-target.cpp since 2015-07-08 01:39:38 +00:00
Unit
VFS Commit some test changes somehow missed in r239789. 2015-06-16 00:19:29 +00:00
.clang-format
CMakeLists.txt [CMake] r247548 introduced llvm-readobj. 2015-09-14 12:42:52 +00:00
Makefile
TestRunner.sh
cxx-sections.data
lit.cfg Enable clang tests requiring "clang-driver" on mingw. 2015-07-25 20:05:21 +00:00
lit.site.cfg.in
make_test_dirs.pl