A transition from one TESLA state to another.
Definition at line 69 of file Transition.h.
#include "Transition.h"
Public Types | |
enum | TransitionKind { Null, Now, Fn, FieldAssign, SubAutomaton } |
Information for LLVM's RTTI (isa<>, cast<>, etc.). More... | |
Public Member Functions | |
virtual | ~Transition () |
const State & | Source () const |
const State & | Destination () const |
virtual bool | EquivalentTo (const Transition &T) const =0 |
Does this transition consume and produce the same symbols as another? More... | |
bool | RequiresInit () const |
This transition triggers initialisation of its TESLA automata class. More... | |
bool | RequiresCleanup () const |
This transition triggers cleanup of its TESLA automata class. More... | |
virtual bool | IsStrict () const |
This transition can only occur as described in an automaton. More... | |
virtual const ReferenceVector | Arguments () const =0 |
Arguments referenced by this transition. More... | |
llvm::SmallVector< const Argument *, 4 > | NewArguments () const |
Arguments newly referenced by this transition (unknown to previous state). More... | |
int | NewArgMask () const |
A bitmask representing the arguments newly referenced by this transition. More... | |
void | ReferencesThusFar (llvm::OwningArrayPtr< const Argument * > &Args, ReferenceVector &Ref) const |
The references known at the point this transition occurs. More... | |
virtual bool | IsRealisable () const =0 |
Can this transition be captured by real instrumentation code? More... | |
virtual std::string | ShortLabel () const =0 |
A short, human-readable label. More... | |
virtual std::string | DotLabel () const =0 |
A label that can go in a .dot file (can use newline, Greek HTML codes...). More... | |
virtual std::string | String () const |
bool | InScope () const |
virtual TransitionKind | getKind () const =0 |
Static Public Member Functions | |
static void | Create (State &From, State &To, TransitionVector &Transitions, bool Init=false, bool Cleanup=false) |
Create an unconditional transition. More... | |
static void | Create (State &From, State &To, const FunctionEvent &Ev, TransitionVector &, bool Init, bool Cleanup, bool OutOfScope=false) |
Create a FunctionEvent transition. More... | |
static void | Create (State &From, State &To, const FieldAssignment &A, TransitionVector &, bool Init, bool Cleanup, bool OutOfScope=false) |
Create a FieldAssignment transition. More... | |
static void | Create (State &From, State &To, const NowEvent &, const AutomatonDescription &, TransitionVector &, bool Init, bool Cleanup) |
static void | CreateSubAutomaton (State &From, State &To, const Identifier &, TransitionVector &) |
static void | Copy (State &From, State &To, const Transition *Other, TransitionVector &, bool OutOfScope=false) |
Creates a transition between the specified states, with the same transition type as the copied transition. More... | |
static void | GroupClasses (const TransitionVector &, TransitionSets &) |
Group transitions into equivalence classes. More... | |
Protected Member Functions | |
Transition (const State &From, const State &To, bool Init, bool Cleanup, bool OutOfScope) | |
Static Protected Member Functions | |
static void | Register (llvm::OwningPtr< Transition > &, State &From, State &To, TransitionVector &) |
static void | Append (const llvm::OwningPtr< Transition > &, TransitionSets &) |
Protected Attributes | |
const State & | From |
const State & | To |
bool | Init |
This transition triggers initialisation. More... | |
bool | Cleanup |
This transition triggers cleanup. More... | |
const bool | OutOfScope |
Information for LLVM's RTTI (isa<>, cast<>, etc.).
Enumerator | |
---|---|
Null | |
Now | |
Fn | |
FieldAssign | |
SubAutomaton |
Definition at line 186 of file Transition.h.
|
inlinevirtual |
Definition at line 137 of file Transition.h.
|
inlineprotected |
Definition at line 195 of file Transition.h.
|
staticprotected |
|
pure virtual |
Arguments referenced by this transition.
Implemented in tesla::SubAutomatonTransition, tesla::FieldAssignTransition, tesla::FnTransition, tesla::NowTransition, and tesla::NullTransition.
|
static |
Creates a transition between the specified states, with the same transition type as the copied transition.
This is used when constructing DFA transitions from NFA transitions.
Definition at line 94 of file Transition.cpp.
References getKind(), OutOfScope, RequiresCleanup(), and RequiresInit().
Referenced by tesla::internal::DFABuilder::ConstructDFA(), and tesla::internal::NFAParser::Parse().
|
static |
Create an unconditional transition.
An unconditional transition (ε in the automata literature) cannot be driven by instrumentation, so it should only appear in an NFA.
[in,out] | From | The state to transition from; will be given ownership of the new transition. |
[in] | To | The state to transition to. |
[out] | Transitions | A place to record the new transition. |
[in] | Init | Transition triggers class initialisation. |
[in] | Cleanup | Transition triggers class cleanup. |
Definition at line 49 of file Transition.cpp.
|
static |
Create a FunctionEvent transition.
[in,out] | From | The state to transition from; will be given ownership of the new transition. |
[in] | To | The state to transition to. |
[in] | Ev | Protobuf representation of the event. |
[out] | Transitions | A place to record the new transition. |
[in] | Init | Transition triggers class initialisation. |
[in] | Cleanup | Transition triggers class cleanup. |
[in] | OutOfScope | The transition is out of a conditional automaton's scope. |
Definition at line 66 of file Transition.cpp.
|
static |
Create a FieldAssignment transition.
[in,out] | From | The state to transition from; will be given ownership of the new transition. |
[in] | To | The state to transition to. |
[in] | A | Protobuf representation of the event. |
[out] | Transitions | A place to record the new transition. |
[in] | Init | Transition triggers class initialisation. |
[in] | Cleanup | Transition triggers class cleanup. |
[in] | OutOfScope | The transition is out of a conditional automaton's scope. |
Definition at line 76 of file Transition.cpp.
|
static |
Definition at line 55 of file Transition.cpp.
References tesla::AutomatonDescription::argument.
|
static |
|
inline |
Definition at line 140 of file Transition.h.
References To.
Referenced by tesla::internal::DFABuilder::ConstructDFA().
|
pure virtual |
A label that can go in a .dot file (can use newline, Greek HTML codes...).
Implemented in tesla::SubAutomatonTransition, tesla::FieldAssignTransition, tesla::FnTransition, tesla::NowTransition, and tesla::NullTransition.
|
pure virtual |
Does this transition consume and produce the same symbols as another?
Implemented in tesla::SubAutomatonTransition, tesla::FieldAssignTransition, tesla::FnTransition, tesla::NowTransition, and tesla::NullTransition.
|
pure virtual |
Implemented in tesla::SubAutomatonTransition, tesla::FieldAssignTransition, tesla::FnTransition, tesla::NowTransition, and tesla::NullTransition.
Referenced by tesla::NullTransition::classof(), tesla::NowTransition::classof(), tesla::FnTransition::classof(), tesla::FieldAssignTransition::classof(), tesla::SubAutomatonTransition::classof(), tesla::internal::DFABuilder::ConstructDFA(), Copy(), tesla::NullTransition::EquivalentTo(), tesla::NowTransition::EquivalentTo(), tesla::FnTransition::EquivalentTo(), tesla::FieldAssignTransition::EquivalentTo(), and tesla::SubAutomatonTransition::EquivalentTo().
|
static |
Group transitions into equivalence classes.
Definition at line 153 of file Transition.cpp.
References tesla::debugs().
Referenced by tesla::internal::DFABuilder::ConstructDFA(), and tesla::internal::NFAParser::Parse().
|
inline |
Definition at line 183 of file Transition.h.
References OutOfScope.
Referenced by tesla::State::UpdateReferences().
|
pure virtual |
Can this transition be captured by real instrumentation code?
Implemented in tesla::SubAutomatonTransition, tesla::FieldAssignTransition, tesla::FnTransition, tesla::NowTransition, and tesla::NullTransition.
Referenced by tesla::internal::DFABuilder::ConstructDFA().
|
inlinevirtual |
This transition can only occur as described in an automaton.
Reimplemented in tesla::FieldAssignTransition, and tesla::FnTransition.
Definition at line 152 of file Transition.h.
int tesla::Transition::NewArgMask | ( | ) | const |
A bitmask representing the arguments newly referenced by this transition.
Definition at line 239 of file Transition.cpp.
SmallVector< const Argument *, 4 > tesla::Transition::NewArguments | ( | ) | const |
Arguments newly referenced by this transition (unknown to previous state).
Definition at line 226 of file Transition.cpp.
void tesla::Transition::ReferencesThusFar | ( | llvm::OwningArrayPtr< const Argument * > & | Args, |
ReferenceVector & | Ref | ||
) | const |
The references known at the point this transition occurs.
[out] | Args | where to store the resulting array of arguments |
[out] | Ref | a reference to the created arguments; includes length |
Definition at line 191 of file Transition.cpp.
Referenced by tesla::State::UpdateReferences().
|
staticprotected |
Definition at line 138 of file Transition.cpp.
References tesla::State::AddTransition(), tesla::debugs(), tesla::State::ID(), and tesla::State::UpdateReferences().
|
inline |
This transition triggers cleanup of its TESLA automata class.
Definition at line 149 of file Transition.h.
References Cleanup.
Referenced by Copy().
|
inline |
This transition triggers initialisation of its TESLA automata class.
Definition at line 146 of file Transition.h.
References Init.
Referenced by Copy().
|
pure virtual |
A short, human-readable label.
Implemented in tesla::SubAutomatonTransition, tesla::FieldAssignTransition, tesla::FnTransition, tesla::NowTransition, and tesla::NullTransition.
|
inline |
|
virtual |
Definition at line 251 of file Transition.cpp.
References tesla::ShortName().
Referenced by tesla::State::String().
|
protected |
This transition triggers cleanup.
This transition is not named by the (conditional) TESLA automaton.
Definition at line 208 of file Transition.h.
Referenced by RequiresCleanup().
|
protected |
Definition at line 204 of file Transition.h.
Referenced by Source().
|
protected |
This transition triggers initialisation.
Definition at line 207 of file Transition.h.
Referenced by RequiresInit().
|
protected |
Definition at line 211 of file Transition.h.
|
protected |
Definition at line 205 of file Transition.h.
Referenced by Destination().