diff options
author | Anna Zaks <ganna@apple.com> | 2016-01-29 18:43:15 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2016-01-29 18:43:15 +0000 |
commit | ad9e7ea6d703b88986ebc3cebf191a2e23711cbf (patch) | |
tree | 197e7653dbb649c7c532791b706a236b848d1641 /clang/lib/StaticAnalyzer/Core/CheckerContext.cpp | |
parent | 6ea637af35c992cb3bece3e3e9e8de9cc42b8cd1 (diff) | |
download | bcm5719-llvm-ad9e7ea6d703b88986ebc3cebf191a2e23711cbf.tar.gz bcm5719-llvm-ad9e7ea6d703b88986ebc3cebf191a2e23711cbf.zip |
[analyzer] Improve Nullability checker diagnostics
- Include the position of the argument on which the nullability is violated
- Differentiate between a 'method' and a 'function' in the message wording
- Test for the error message text in the tests
- Fix a bug with setting 'IsDirectDereference' which resulted in regular dereferences assumed to have call context.
llvm-svn: 259221
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/CheckerContext.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/CheckerContext.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/CheckerContext.cpp b/clang/lib/StaticAnalyzer/Core/CheckerContext.cpp index 5ec8bfa8007..548b06ef91f 100644 --- a/clang/lib/StaticAnalyzer/Core/CheckerContext.cpp +++ b/clang/lib/StaticAnalyzer/Core/CheckerContext.cpp @@ -35,6 +35,13 @@ StringRef CheckerContext::getCalleeName(const FunctionDecl *FunDecl) const { return funI->getName(); } +StringRef CheckerContext::getDeclDescription(const Decl *D) { + if (isa<ObjCMethodDecl>(D) || isa<CXXMethodDecl>(D)) + return "method"; + if (isa<BlockDecl>(D)) + return "anonymous block"; + return "function"; +} bool CheckerContext::isCLibraryFunction(const FunctionDecl *FD, StringRef Name) { |