Ignore:
Timestamp:
Dec 9, 2017, 5:05:16 PM (18 months ago)
Author:
nmedfort
Message:

Minor changes and hopefully a fix for bug exposed by base64 test

Location:
icGREP/icgrep-devel/icgrep/toolchain
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/toolchain/object_cache.cpp

    r5761 r5771  
    119119                if (kernel->hasSignature()) {
    120120                    const MDString * const sig = getSignature(M.get());
    121                     assert ("signature is missing from kernel file: possible module naming conflict?" && sig);
     121                    assert ("signature is missing from kernel file: possible module naming conflict or change in the LLVM metadata storage policy?" && sig);
    122122                    if (LLVM_UNLIKELY(sig == nullptr || !sig->getString().equals(kernel->makeSignature(idb)))) {
    123123                        goto invalid;
     
    200200
    201201void ParabixObjectCache::performIncrementalCacheCleanupStep() {
    202     if (mCacheCleanupIterator != fs::directory_iterator()) {
    203         const auto e = mCacheCleanupIterator->path();
    204         mCacheCleanupIterator++;
     202    mCleanupMutex.lock();
     203    if (LLVM_UNLIKELY(mCleanupIterator == fs::directory_iterator())) {
     204        mCleanupMutex.unlock();
     205    } else {
     206        const auto e = mCleanupIterator->path();
     207        mCleanupIterator++;
     208        mCleanupMutex.unlock();
     209
    205210        // Simple clean-up policy: files that haven't been touched by the
    206211        // driver in MaxCacheEntryHours are deleted.
     
    232237        sys::fs::create_directories(mCachePath);
    233238    }
    234     fs::directory_iterator it(p);
    235     mCacheCleanupIterator = it;
     239    mCleanupIterator = fs::directory_iterator(p);
    236240}
    237241
  • icGREP/icgrep-devel/icgrep/toolchain/object_cache.h

    r5761 r5771  
    1515#include <vector>
    1616#include <string>
     17#include <mutex>
    1718
    1819namespace llvm { class Module; }
     
    4849    void performIncrementalCacheCleanupStep();
    4950private:
     51    std::mutex mCleanupMutex;
     52    boost::filesystem::directory_iterator mCleanupIterator;
    5053    ModuleCache mCachedObject;
    5154    const Path mCachePath;
    52     boost::filesystem::directory_iterator mCacheCleanupIterator;
    5355};
    5456
  • icGREP/icgrep-devel/icgrep/toolchain/toolchain.cpp

    r5759 r5771  
    123123TargetOptions Options;
    124124
    125 const cl::OptionCategory * codegen_flags() {
     125const cl::OptionCategory * LLVM_READONLY codegen_flags() {
    126126    return &CodeGenOptions;
    127127}
    128128
    129 bool DebugOptionIsSet(const DebugFlags flag) {
     129bool LLVM_READONLY DebugOptionIsSet(const DebugFlags flag) {
    130130    return DebugOptions.isSet(flag);
    131131}
  • icGREP/icgrep-devel/icgrep/toolchain/toolchain.h

    r5757 r5771  
    3838namespace codegen {
    3939
    40 const llvm::cl::OptionCategory * codegen_flags();
     40const llvm::cl::OptionCategory * LLVM_READONLY codegen_flags();
    4141
    4242// Command Parameters
     
    5252};
    5353
    54 bool DebugOptionIsSet(const DebugFlags flag);
     54bool LLVM_READONLY DebugOptionIsSet(const DebugFlags flag);
    5555
    5656extern bool PipelineParallel;
Note: See TracChangeset for help on using the changeset viewer.