Ignore:
Timestamp:
Dec 15, 2017, 12:44:01 PM (18 months ago)
Author:
nmedfort
Message:

Initial check-in of LookAhead? support; modified LineBreakKernel? to compute CR+LF using LookAhead?(1) + misc. fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/attributes.cpp

    r5755 r5782  
    11#include "attributes.h"
     2
     3#include <llvm/Support/raw_ostream.h>
    24
    35namespace kernel {
    46
    5 void AttributeSet::addAttribute(Attribute attribute) {
    6     for (Attribute & attr : *this) {
     7Attribute & AttributeSet::addAttribute(Attribute attribute) {
     8    for (auto i = begin(), i_end = end(); i != i_end; ++i) {
     9        Attribute & attr = const_cast<Attribute &>(*i);
    710        if (attr.getKind() == attribute.getKind()) {
    8             attr.mK = attribute.mK;
    9             return;
     11            attr.mAmount = attribute.mAmount;
     12            return attr;
    1013        }
    1114    }
    1215    emplace_back(attribute);
     16    return back();
    1317}
    1418
    15 bool AttributeSet::hasAttribute(const AttributeId id) const {
    16     for (const Attribute & attr : *this) {
    17         if (attr.getKind() == id) {
    18             return true;
     19Attribute * AttributeSet::__findAttribute(const AttributeId id) const {
     20    for (auto i = begin(), i_end = end(); i != i_end; ++i) {
     21        if (i->getKind() == id) {
     22            return const_cast<Attribute *>(&*i);
    1923        }
    2024    }
    21     return false;
     25    return nullptr;
    2226}
    2327
Note: See TracChangeset for help on using the changeset viewer.