Ignore:
Timestamp:
Dec 12, 2018, 9:17:18 AM (5 months ago)
Author:
cameron
Message:

Contextual assertion simplifier from Jeremy Schwartz - initial check-in

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/re/re_seq.h

    r6195 r6223  
    11/*
    2  *  Copyright (c) 2014 International Characters.
     2 *  Copyright (c) 2018 International Characters.
    33 *  This software is licensed to the public under the Open Software License 3.0.
    44 *  icgrep is a trademark of International Characters.
     
    1313#include <re/re_cc.h>
    1414#include <re/re_re.h>
     15#include <re/re_empty_set.h>
    1516#include <UCD/unicode_set.h>
    1617#include <llvm/Support/Casting.h>
     
    2627        return false;
    2728    }
    28     virtual ~Seq() {}
    2929protected:
    3030    friend Seq * makeSeq();
     
    4444    for (auto i = begin; i != end; ++i) {
    4545        RE * const item = *i;
    46         if (LLVM_UNLIKELY(llvm::isa<Seq>(item))) {
     46        if (LLVM_UNLIKELY(isEmptySet(item))) {
     47            return makeEmptySet();
     48        } else if (LLVM_UNLIKELY(llvm::isa<Seq>(item))) {
    4749            for (RE * const innerItem : *llvm::cast<Seq>(item)) {
    4850                seq->push_back(innerItem);
     
    5860}
    5961
    60 inline RE * makeSeq(RE::InitializerList list) {
     62inline RE * makeSeq(std::initializer_list<RE *> list) {
    6163    return makeSeq(list.begin(), list.end());
    6264}
Note: See TracChangeset for help on using the changeset viewer.