mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 04:58:21 +00:00
binpac: Add pre-commit hooks and run clang-format on everything
This commit is contained in:
parent
090ac0a6e0
commit
090325df40
91 changed files with 3086 additions and 3665 deletions
|
@ -1,14 +1,12 @@
|
|||
#include "pac_datadep.h"
|
||||
|
||||
#include "pac_expr.h"
|
||||
#include "pac_id.h"
|
||||
#include "pac_type.h"
|
||||
|
||||
DataDepElement::DataDepElement(DDE_Type type)
|
||||
: dde_type_(type), in_traversal(false)
|
||||
{
|
||||
}
|
||||
DataDepElement::DataDepElement(DDE_Type type) : dde_type_(type), in_traversal(false) { }
|
||||
|
||||
bool DataDepElement::Traverse(DataDepVisitor *visitor)
|
||||
bool DataDepElement::Traverse(DataDepVisitor* visitor)
|
||||
{
|
||||
// Avoid infinite loop
|
||||
if ( in_traversal )
|
||||
|
@ -27,19 +25,19 @@ bool DataDepElement::Traverse(DataDepVisitor *visitor)
|
|||
return true;
|
||||
}
|
||||
|
||||
Expr *DataDepElement::expr()
|
||||
{
|
||||
return static_cast<Expr *>(this);
|
||||
}
|
||||
|
||||
Type *DataDepElement::type()
|
||||
{
|
||||
return static_cast<Type *>(this);
|
||||
}
|
||||
|
||||
bool RequiresAnalyzerContext::PreProcess(DataDepElement *element)
|
||||
Expr* DataDepElement::expr()
|
||||
{
|
||||
switch ( element->dde_type() )
|
||||
return static_cast<Expr*>(this);
|
||||
}
|
||||
|
||||
Type* DataDepElement::type()
|
||||
{
|
||||
return static_cast<Type*>(this);
|
||||
}
|
||||
|
||||
bool RequiresAnalyzerContext::PreProcess(DataDepElement* element)
|
||||
{
|
||||
switch ( element->dde_type() )
|
||||
{
|
||||
case DataDepElement::EXPR:
|
||||
ProcessExpr(element->expr());
|
||||
|
@ -52,23 +50,22 @@ bool RequiresAnalyzerContext::PreProcess(DataDepElement *element)
|
|||
return ! requires_analyzer_context_;
|
||||
}
|
||||
|
||||
bool RequiresAnalyzerContext::PostProcess(DataDepElement *element)
|
||||
bool RequiresAnalyzerContext::PostProcess(DataDepElement* element)
|
||||
{
|
||||
return ! requires_analyzer_context_;
|
||||
}
|
||||
|
||||
void RequiresAnalyzerContext::ProcessExpr(Expr *expr)
|
||||
void RequiresAnalyzerContext::ProcessExpr(Expr* expr)
|
||||
{
|
||||
if ( expr->expr_type() == Expr::EXPR_ID )
|
||||
{
|
||||
requires_analyzer_context_ =
|
||||
(requires_analyzer_context_ ||
|
||||
*expr->id() == *analyzer_context_id ||
|
||||
*expr->id() == *context_macro_id);
|
||||
requires_analyzer_context_ = (requires_analyzer_context_ ||
|
||||
*expr->id() == *analyzer_context_id ||
|
||||
*expr->id() == *context_macro_id);
|
||||
}
|
||||
}
|
||||
|
||||
bool RequiresAnalyzerContext::compute(DataDepElement *element)
|
||||
bool RequiresAnalyzerContext::compute(DataDepElement* element)
|
||||
{
|
||||
RequiresAnalyzerContext visitor;
|
||||
element->Traverse(&visitor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue