Ignore:
Timestamp:
Nov 1, 2014, 2:10:07 PM (5 years ago)
Author:
nmedfort
Message:

Initial stage of pablo metadata inclusion.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/pabloAST.cpp

    r4280 r4284  
    9292}
    9393
     94
     95void PabloAST::setMetadata(const std::string & name, PMDNode * node) {
     96    if (LLVM_UNLIKELY(mMetadataMap == nullptr)) {
     97        mMetadataMap = new PMDNodeMap();
     98    }
     99    mMetadataMap->insert(std::make_pair(name, node));
     100}
     101
     102PMDNode * PabloAST::getMetadata(const std::string & name) {
     103    if (LLVM_UNLIKELY(mMetadataMap == nullptr)) {
     104        return nullptr;
     105    }
     106    auto f = mMetadataMap->find(name);
     107    if (f == mMetadataMap->end()) {
     108        return nullptr;
     109    }
     110    return f->second;
     111}
     112
    94113Statement::~Statement() {
    95114
Note: See TracChangeset for help on using the changeset viewer.