mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
fix for AST optimization altering top-level body statement
This commit is contained in:
parent
22af54dda2
commit
143d306883
3 changed files with 17 additions and 5 deletions
|
@ -57,14 +57,18 @@ public:
|
|||
// True if we've computed use-defs for the given statement.
|
||||
bool HasUsage(const Stmt* s) const
|
||||
{ return use_defs_map.find(s) != use_defs_map.end(); }
|
||||
bool HasUsage(const StmtPtr& s) const
|
||||
{ return HasUsage(s.get()); }
|
||||
|
||||
// Returns the use-defs for the given statement.
|
||||
UDs GetUsage(const Stmt* s) const { return FindUsage(s); }
|
||||
UDs GetUsage(const StmtPtr& s) const { return FindUsage(s.get()); }
|
||||
|
||||
// Removes assignments corresponding to unused temporaries.
|
||||
// In the process, reports on locals that are assigned
|
||||
// but never used.
|
||||
void RemoveUnused();
|
||||
// but never used. Returns the body, which may have been
|
||||
// changed if the original first statement has been pruned.
|
||||
StmtPtr RemoveUnused();
|
||||
|
||||
void Dump();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue