34    std::map<const IR::P4Action *, const IR::MethodCallExpression *> invocations;
 
   35    std::set<const IR::P4Action *> all;  
 
   36    std::set<const IR::MethodCallExpression *> calls;
 
   38    std::map<const IR::MethodCallExpression *, unsigned> defaultActions;
 
   41    void bind(
const IR::P4Action *action, 
const IR::MethodCallExpression *invocation,
 
   44        BUG_CHECK(invocations.find(action) == invocations.end(), 
"%1%: action called twice",
 
   46        invocations.emplace(action, invocation);
 
   47        if (allParams) all.emplace(action);
 
   48        calls.emplace(invocation);
 
   50    void bindDefaultAction(
const IR::P4Action *action,
 
   51                           const IR::MethodCallExpression *defaultInvocation) {
 
   53        auto actionCallInvocation = ::get(invocations, action);
 
   54        CHECK_NULL(actionCallInvocation);
 
   56        unsigned boundArgs = actionCallInvocation->arguments->size();
 
   57        defaultActions.emplace(defaultInvocation, boundArgs);
 
   59    const IR::MethodCallExpression *get(
const IR::P4Action *action)
 const {
 
   60        return ::get(invocations, action);
 
   62    bool removeAllParameters(
const IR::P4Action *action)
 const {
 
   63        return all.find(action) != all.end();
 
   65    bool isCall(
const IR::MethodCallExpression *expression)
 const {
 
   66        return calls.find(expression) != calls.end();
 
   68    unsigned argsToRemove(
const IR::MethodCallExpression *defaultCall)
 const {
 
   69        if (defaultActions.find(defaultCall) == defaultActions.end()) 
return 0;
 
   70        return ::get(defaultActions, defaultCall);
 
 
Visitor mixin for looking up names in enclosing scopes from the Visitor::Context.
Definition resolveReferences.h:32