diff options
author | Aina Niemetz <aina.niemetz@gmail.com> | 2021-04-20 11:58:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-20 18:58:46 +0000 |
commit | 92fa57d6ec03ea19cf5ef177905ee59f29231e8f (patch) | |
tree | 704f9ef88ac86122358dac4b95300146d03fb35a /src/theory/rewriter_tables_template.h | |
parent | 1d5a6e4a0773064ca0f1465b5e94a301af4eee2e (diff) |
Add guards to disable clang-format around placeholders in templates. (#6375)
Diffstat (limited to 'src/theory/rewriter_tables_template.h')
-rw-r--r-- | src/theory/rewriter_tables_template.h | 95 |
1 files changed, 60 insertions, 35 deletions
diff --git a/src/theory/rewriter_tables_template.h b/src/theory/rewriter_tables_template.h index 5c52e79b5..c549f8cfb 100644 --- a/src/theory/rewriter_tables_template.h +++ b/src/theory/rewriter_tables_template.h @@ -20,76 +20,101 @@ #pragma once +#include "expr/attribute.h" +#include "expr/attribute_unique_id.h" #include "theory/rewriter.h" #include "theory/rewriter_attributes.h" -#include "expr/attribute_unique_id.h" -#include "expr/attribute.h" +// clang-format off ${rewriter_includes} +// clang-format on namespace cvc5 { namespace theory { -Node Rewriter::getPreRewriteCache(theory::TheoryId theoryId, TNode node) { - switch(theoryId) { +Node Rewriter::getPreRewriteCache(theory::TheoryId theoryId, TNode node) +{ + switch (theoryId) + { + // clang-format off ${pre_rewrite_get_cache} - default: - Unreachable(); + // clang-format on + default: Unreachable(); } } -Node Rewriter::getPostRewriteCache(theory::TheoryId theoryId, TNode node) { - switch(theoryId) { +Node Rewriter::getPostRewriteCache(theory::TheoryId theoryId, TNode node) +{ + switch (theoryId) + { + // clang-format off ${post_rewrite_get_cache} - default: - Unreachable(); + // clang-format on + default: Unreachable(); } } -void Rewriter::setPreRewriteCache(theory::TheoryId theoryId, TNode node, TNode cache) { - switch(theoryId) { +void Rewriter::setPreRewriteCache(theory::TheoryId theoryId, + TNode node, + TNode cache) +{ + switch (theoryId) + { + // clang-format off ${pre_rewrite_set_cache} - default: - Unreachable(); + // clang-format on + default: Unreachable(); } } -void Rewriter::setPostRewriteCache(theory::TheoryId theoryId, TNode node, TNode cache) { - switch(theoryId) { +void Rewriter::setPostRewriteCache(theory::TheoryId theoryId, + TNode node, + TNode cache) +{ + switch (theoryId) + { + // clang-format off ${post_rewrite_set_cache} - default: - Unreachable(); + // clang-format on + default: Unreachable(); } } Rewriter::Rewriter() : d_tpg(nullptr) { -for (size_t i = 0; i < kind::LAST_KIND; ++i) -{ - d_preRewriters[i] = nullptr; - d_postRewriters[i] = nullptr; -} + for (size_t i = 0; i < kind::LAST_KIND; ++i) + { + d_preRewriters[i] = nullptr; + d_postRewriters[i] = nullptr; + } -for (size_t i = 0; i < theory::THEORY_LAST; ++i) -{ - d_preRewritersEqual[i] = nullptr; - d_postRewritersEqual[i] = nullptr; -} + for (size_t i = 0; i < theory::THEORY_LAST; ++i) + { + d_preRewritersEqual[i] = nullptr; + d_postRewritersEqual[i] = nullptr; + } } -void Rewriter::clearCachesInternal() { +void Rewriter::clearCachesInternal() +{ typedef cvc5::expr::attr::AttributeUniqueId AttributeUniqueId; std::vector<AttributeUniqueId> preids; - ${pre_rewrite_attribute_ids} + // clang-format off + ${pre_rewrite_attribute_ids} // clang-format on - std::vector<AttributeUniqueId> postids; - ${post_rewrite_attribute_ids} + std::vector<AttributeUniqueId> + postids; + // clang-format off + ${post_rewrite_attribute_ids} // clang-format on - std::vector<const AttributeUniqueId*> allids; - for(unsigned i = 0; i < preids.size(); ++i){ + std::vector<const AttributeUniqueId*> + allids; + for (size_t i = 0, size = preids.size(); i < size; ++i) + { allids.push_back(&preids[i]); } - for(unsigned i = 0; i < postids.size(); ++i){ + for (size_t i = 0, size = postids.size(); i < size; ++i) + { allids.push_back(&postids[i]); } NodeManager::currentNM()->deleteAttributes(allids); |