Ignore:
Timestamp:
Jul 3, 2020, 4:50:21 PM (4 years ago)
Author:
Fangren Yu <f37yu@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
aebf5b0
Parents:
276f105
Message:

tracing memory allocation of resolver passes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Pass.proto.hpp

    r276f105 rc15085d  
    1616#pragma once
    1717// IWYU pragma: private, include "Pass.hpp"
     18
     19#include "Common/Stats/Heap.h"
    1820
    1921namespace ast {
     
    244246        #undef FIELD_PTR
    245247
     248        template< typename pass_t >
     249        static inline auto beginTrace(pass_t & pass, int) -> decltype( pass_t::traceId, void() ) {
     250                Stats::Heap::stacktrace_push(pass_t::traceId);
     251        }
     252
     253        template< typename pass_t >
     254        static inline auto endTrace(pass_t & pass, int) -> decltype( pass_t::traceId, void() ) {
     255                Stats::Heap::stacktrace_pop();
     256        }
     257
     258        template< typename pass_t >
     259        static void beginTrace(pass_t &, long) {}
     260
     261        template< typename pass_t >
     262        static void endTrace(pass_t &, long) {}
     263
    246264        // Another feature of the templated visitor is that it calls beginScope()/endScope() for compound statement.
    247265        // All passes which have such functions are assumed desire this behaviour
Note: See TracChangeset for help on using the changeset viewer.