diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2013-12-10 11:23:31 +0000 |
---|---|---|
committer | Philip Withnall <philip.withnall@collabora.co.uk> | 2013-12-10 11:23:31 +0000 |
commit | 382206229391f06a59a66b31e6abeed63b690a35 (patch) | |
tree | f528a2c7b75fce273fc9a437ea58e9c21b569192 /clang-plugin/assertion-extracter.h | |
parent | 297cfd8c2d721e08f38d92e14e91f2656f28e62f (diff) |
clang-plugin: Refactor assertion extracter to reduce object allocations
Instead of creating a new unowned_set for each
assertion_is_nonnull_check() call and recursion, pass a single one down
by reference, and insert directly into it. This simplifies the code
(since every insertion is an implicit union operation) and reduces the
number of allocations needed.
Diffstat (limited to 'clang-plugin/assertion-extracter.h')
-rw-r--r-- | clang-plugin/assertion-extracter.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang-plugin/assertion-extracter.h b/clang-plugin/assertion-extracter.h index edd3294..c1c8093 100644 --- a/clang-plugin/assertion-extracter.h +++ b/clang-plugin/assertion-extracter.h @@ -30,6 +30,7 @@ using namespace clang; namespace AssertionExtracter { Expr* is_assertion_stmt (Stmt& stmt, const ASTContext& context); - std::unordered_set<const ValueDecl*> assertion_is_nonnull_check ( - Expr& assertion_expr, const ASTContext& context); + unsigned int assertion_is_nonnull_check ( + Expr& assertion_expr, const ASTContext& context, + std::unordered_set<const ValueDecl*>& param_decls); } |