diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2013-12-10 18:15:53 +0000 |
---|---|---|
committer | Philip Withnall <philip.withnall@collabora.co.uk> | 2013-12-10 18:15:53 +0000 |
commit | f9cadd02d1a825a4b5dae0f5a0059798af49e0c0 (patch) | |
tree | e13b337a7a1bf09b8925c9dbfc208e2cb015b0c7 /clang-plugin/nullability-checker.cpp | |
parent | 565e8507498cc940c2c64230db6c538435443a25 (diff) |
clang-plugin: Various improvements to debug output
Diffstat (limited to 'clang-plugin/nullability-checker.cpp')
-rw-r--r-- | clang-plugin/nullability-checker.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/clang-plugin/nullability-checker.cpp b/clang-plugin/nullability-checker.cpp index 5cf3f17..e381bb2 100644 --- a/clang-plugin/nullability-checker.cpp +++ b/clang-plugin/nullability-checker.cpp @@ -87,10 +87,22 @@ NullabilityVisitor::TraverseFunctionDecl (FunctionDecl* func) return true; } + DEBUG ("Examining " << func->getNameAsString ()); + /* For each parameter, check whether it has an (allow-none) annotation, * a nonnull attribute, and a non-NULL assertion. */ NonNullAttr* nonnull_attr = func->getAttr<NonNullAttr> (); + if (nonnull_attr != NULL) { + DEBUG ("nonnull attribute indices:"); + for (NonNullAttr::args_iterator it = nonnull_attr->args_begin (), + ie = nonnull_attr->args_end (); it != ie; ++it) { + DEBUG ("\t" << *it); + } + } else { + DEBUG ("No nonnull attribute."); + } + /* Try to find typelib information about the function. */ std::string func_name = func->getNameAsString (); /* TODO: expensive? */ GIBaseInfo* info = @@ -108,7 +120,6 @@ NullabilityVisitor::TraverseFunctionDecl (FunctionDecl* func) } /* Parse the function’s body for assertions. */ - DEBUG ("Examining " << func->getNameAsString ()); std::unordered_set<const ValueDecl*> asserted_parms; ASTContext& context = func->getASTContext (); |