Ignore:
Timestamp:
Dec 19, 2016, 2:39:35 PM (2 years ago)
Author:
nmedfort
Message:

Multi-threading support for PabloAST / PabloCompiler?. Requires unique LLVM Context / Module for each thread.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/codegenstate.h

    r5229 r5230  
    6262
    6363    inline static PabloBlock * Create(PabloKernel * const parent) noexcept {
    64         return new PabloBlock(parent);
    65     }
    66 
    67     inline static PabloBlock * Create(PabloBlock * const predecessor) noexcept {
    68         return new PabloBlock(predecessor->mParent);
     64        Allocator & allocator = parent->mAllocator;
     65        return new (allocator) PabloBlock(parent, allocator);
    6966    }
    7067
     
    313310protected:
    314311
    315     explicit PabloBlock(PabloKernel * const parent) noexcept
    316     : PabloAST(PabloAST::ClassTypeId::Block, nullptr, nullptr)
     312    explicit PabloBlock(PabloKernel * const parent, Allocator & allocator) noexcept
     313    : PabloAST(PabloAST::ClassTypeId::Block, nullptr, nullptr, allocator)
    317314    , mParent(parent)
    318315    , mBranch(nullptr)
    319     , mScopeIndex(0) {
     316    , mScopeIndex(0)
     317    , mAllocator(allocator) {
    320318
    321319    }
     
    337335    Branch *                    mBranch;
    338336    unsigned                    mScopeIndex;
     337    Allocator &                 mAllocator;
    339338};
    340339
Note: See TracChangeset for help on using the changeset viewer.