Commit graph

63 commits

Author SHA1 Message Date
Vern Paxson
86709c5992 activate &is_used 2021-02-23 08:32:14 -08:00
Vern Paxson
f82d443225 Merge branch 'topic/vern/use-defs' of github.com:zeek/zeek into topic/vern/use-defs 2021-02-10 19:09:28 -08:00
Vern Paxson
dc80d2f36f removed unnecessary statement flagged by Coverity (thanks, Jon!) 2021-02-10 19:08:52 -08:00
Jon Siwek
b450b90a3e Adjust reference/move nitpicks in use-def/reduce code
Use std::move() and avoid superfluous copies by assigning to
const-reference in a few places.
2021-02-08 17:53:21 -08:00
Jon Siwek
8d452f58fc Adjust some whitespace in UseDefs.cc 2021-02-08 17:48:53 -08:00
Vern Paxson
94b85e3527 driver glue for invoking use-def construction 2021-02-06 10:58:56 -08:00
Vern Paxson
372fb8b197 classes for managing and propagating use-defs 2021-02-06 10:57:56 -08:00
Vern Paxson
2114c4a26b enhancements/changes to the Reduce class in preparation for use-defs 2021-02-06 09:52:35 -08:00
Vern Paxson
a067f4c5b0 some tidying with smart pointers 2021-02-06 09:49:37 -08:00
Vern Paxson
12c9b5ede5 flag/environment variable for dumping use-defs 2021-02-05 22:26:24 -08:00
Vern Paxson
772834e375 whitespace micro-preening 2021-02-05 21:03:10 -08:00
Jon Siwek
d7dfb16909 Speedup ReachingDefs logic by ~15%
Mainly from the potential of ReachingDefs::AddRD() performing a
redundant map lookup that it had just done.
2021-02-04 17:23:14 -08:00
Jon Siwek
2c04054975 Simplify ReachingDefs::RDMap() accessor 2021-02-04 15:37:05 -08:00
Vern Paxson
c991c54690 &is_set => &is_assigned 2021-02-04 12:18:46 -08:00
Vern Paxson
d71675a7dc remove pending maybe-reconsider-this comment 2021-02-04 11:51:57 -08:00
Vern Paxson
e336a30963 fixes for ?$ operator - always track it, and assume subrecords are initialized 2021-02-04 11:39:33 -08:00
Vern Paxson
183fbc750f speedup (and more coherent memory management) for tracking RDs 2021-02-03 17:13:51 -08:00
Vern Paxson
5dde3adbdd fixes for generating and evaluating RDs associate with ?$ expressions 2021-02-03 16:51:34 -08:00
Vern Paxson
6f20c0da3f inlining fix: propagate identifier attributes (such as &is_set) 2021-02-03 16:46:07 -08:00
Vern Paxson
cb9a959978 tidier memory management 2021-02-02 17:00:28 -08:00
Jon Siwek
aa03e54ba0 Fix IntrusivePtr release leaks in reaching-def logic 2021-02-01 23:25:15 -08:00
Jon Siwek
6c80052c55 Change dynamic_cast in reaching-def logic to static_cast 2021-02-01 22:57:46 -08:00
Jon Siwek
6d3df74788 Adjust some reaching-def memory management
E.g. can use unique_ptr or just avoid heap-allocating as minor
simplification of some mem-mgmt logic.
2021-02-01 22:54:17 -08:00
Jon Siwek
36f27a0d01 Adjust various reaching-def move/reference semantics
Nothing that important, just changing things to what is hypothetically
more efficient in general.
2021-02-01 22:00:56 -08:00
Jon Siwek
1f7580db65 Change LambdaExpr::OuterIDs() accessor to return const-reference 2021-02-01 18:06:19 -08:00
Jon Siwek
990bbb1626 Simplify declaration of DefPointType enum 2021-02-01 17:54:57 -08:00
Jon Siwek
40b41964f9 Fix a sign-compare compiler warning 2021-02-01 17:32:27 -08:00
Vern Paxson
f6a119254f fix for analyzing non-reduced ASTs 2021-01-23 12:29:04 -08:00
Vern Paxson
2f0d02c878 driver class for generating RDs across an AST, and logic to invoke it 2021-01-23 10:54:43 -08:00
Vern Paxson
baab336d2e class for managing "reaching definitions" for each AST node 2021-01-23 10:52:33 -08:00
Vern Paxson
2883f4ebee class for tracking the "reach" of variable/field definitions 2021-01-23 10:51:04 -08:00
Vern Paxson
d2d681c2a5 class for referring to definitions of variables or record fields 2021-01-23 10:48:14 -08:00
Vern Paxson
9b549e4034 additional converters and accessors for Expr subclasses 2021-01-23 10:48:14 -08:00
Vern Paxson
64eb229880 class encapsulating location of variable/field definition 2021-01-23 10:47:46 -08:00
Vern Paxson
732633ebb4 option handling for new -u/-uu flag for reporting usage issues 2021-01-23 10:25:06 -08:00
Jon Siwek
12f9ba5f37 Guard against nullptr deref after AST-reduction consistency checks
Addresses Coverity issue 1443771
2021-01-19 11:22:52 -08:00
Jon Siwek
b4cf393475 Adjust some Reducer ref-counting and IntrusivePtr usage 2021-01-14 00:24:12 -08:00
Jon Siwek
7ce4351ed0 Fix reference counting in ListExpr inline/reduce methods 2021-01-13 23:01:44 -08:00
Jon Siwek
177b723a60 Switch some Stmt transform/reduce logic to use IntrusivePtr 2021-01-13 22:57:48 -08:00
Jon Siwek
b799665c1a Switch some Expr transform/reduce logic to use IntrusivePtr 2021-01-13 20:27:41 -08:00
Jon Siwek
f9e0b14d38 Add missing header-includes to Reduce.h 2021-01-13 16:39:59 -08:00
Jon Siwek
fe8db7f150 Use string for TempVar::name
Nothing of consequence; just encapsulation of memory management
2021-01-13 13:49:32 -08:00
Jon Siwek
81fa7f7e3d Switch AnalyOpt::only_func to optional<string>
Nothing of consequence; may help express meaning and memory management.
2021-01-13 13:19:46 -08:00
Jon Siwek
48da8b7d66 Fix a signed/unsigned comparison warning 2021-01-13 12:31:19 -08:00
Vern Paxson
03085d45e5 simplified some vestigial complexity I noticed when flipping through diffs 2021-01-10 17:36:03 -08:00
Vern Paxson
e2edb622ac logic for driving the script optimization process 2021-01-10 14:18:11 -08:00
Vern Paxson
e42b1fa05d low-level tidying 2021-01-10 14:15:11 -08:00
Vern Paxson
607e9950bf implementation for Reduce class - code now links 2021-01-10 14:14:09 -08:00
Vern Paxson
7a9694a2a4 reduction of Stmt subclasses - compiles but does not yet link 2021-01-10 14:13:16 -08:00
Vern Paxson
10e80dfcd3 reductions of expressions in ASTs - code compiles but doesn't yet link 2021-01-10 14:04:01 -08:00