Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions hilti/toolchain/include/ast/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
__HILTI_NODE_0(hilti, CLASS, override_) \
\
void dispatch(::hilti::visitor::Dispatcher& v) override_ { \
v(static_cast<::hilti::Node*>(this)); \
v(this); \
v(static_cast<::hilti::Node*>(this)); \
}

#define __HILTI_NODE_1(NS, CLASS, BASE, override_) \
Expand All @@ -63,9 +63,9 @@
__HILTI_NODE_1(hilti, CLASS, BASE, override_) \
\
void dispatch(::hilti::visitor::Dispatcher& v) override_ { \
v(static_cast<::hilti::Node*>(this)); \
v(static_cast<BASE*>(this)); \
v(this); \
v(static_cast<BASE*>(this)); \
v(static_cast<::hilti::Node*>(this)); \
}

#define __HILTI_NODE_2(NS, CLASS, BASE1, BASE2, override_) \
Expand All @@ -80,10 +80,10 @@
__HILTI_NODE_2(hilti, CLASS, BASE1, BASE2, override_) \
\
void dispatch(::hilti::visitor::Dispatcher& v) override_ { \
v(static_cast<::hilti::Node*>(this)); \
v(this); \
v(static_cast<BASE1*>(this)); \
v(static_cast<BASE2*>(this)); \
v(this); \
v(static_cast<::hilti::Node*>(this)); \
}

namespace hilti {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ class Optimizer {
*
* @param id the ID to check
*/
// FIXME(bbannier): drop `%`?
static bool isFeatureFlag(const ID& id) { return util::startsWith(id.local(), HILTI_INTERNAL_ID("feat%")); }

/**
Expand Down
4 changes: 3 additions & 1 deletion hilti/toolchain/src/compiler/validator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,9 @@ struct VisitorCFG : visitor::PreOrder, public validator::VisitorMixIn {
return false;

for ( const auto& s : successors ) {
if ( ! ensureReturns(cfg, *cfg.graph().getNode(s), seen) )
const auto* n = cfg.graph().getNode(s);
assert(n);
if ( ! ensureReturns(cfg, *n, seen) )
return false;
}

Expand Down
18 changes: 9 additions & 9 deletions spicy/toolchain/include/ast/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
void dispatch(::hilti::visitor::Dispatcher& v) override_ { \
if ( v.dispatcherTag() == spicy::visitor::Dispatcher::Spicy ) { \
auto sv = static_cast<spicy::visitor::Dispatcher*>(&v); \
(*sv)(static_cast<::hilti::Node*>(this)); \
(*sv)(this); \
(*sv)(static_cast<::hilti::Node*>(this)); \
} \
else { \
v(static_cast<::hilti::Node*>(this)); \
v(this); \
v(static_cast<::hilti::Node*>(this)); \
} \
}

Expand All @@ -28,14 +28,14 @@
void dispatch(::hilti::visitor::Dispatcher& v) override_ { \
if ( v.dispatcherTag() == spicy::visitor::Dispatcher::Spicy ) { \
auto sv = static_cast<spicy::visitor::Dispatcher*>(&v); \
(*sv)(static_cast<::hilti::Node*>(this)); \
(*sv)(static_cast<BASE*>(this)); \
(*sv)(this); \
(*sv)(static_cast<BASE*>(this)); \
(*sv)(static_cast<::hilti::Node*>(this)); \
} \
else { \
v(static_cast<::hilti::Node*>(this)); \
v(static_cast<BASE*>(this)); \
v(this); \
v(static_cast<BASE*>(this)); \
v(static_cast<::hilti::Node*>(this)); \
} \
}

Expand All @@ -46,15 +46,15 @@
using namespace hilti; \
if ( v.dispatcherTag() == spicy::visitor::Dispatcher::Spicy ) { \
auto sv = static_cast<spicy::visitor::Dispatcher*>(&v); \
(*sv)(static_cast<::hilti::Node*>(this)); \
(*sv)(this); \
(*sv)(static_cast<BASE1*>(this)); \
(*sv)(static_cast<BASE2*>(this)); \
(*sv)(this); \
(*sv)(static_cast<::hilti::Node*>(this)); \
} \
else { \
v(static_cast<::hilti::Node*>(this)); \
v(static_cast<BASE1*>(this)); \
v(static_cast<BASE2*>(this)); \
v(static_cast<::hilti::Node*>(this)); \
} \
}

Expand Down
Loading
Loading