Ignore:
Timestamp:
Sep 9, 2018, 10:09:53 AM (8 months ago)
Author:
cameron
Message:

Optimization of intersect/diff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/re/re_diff.cpp

    r5267 r6159  
    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.
     
    66
    77#include "re_diff.h"
    8 #include "re_cc.h"
     8#include <re/re_cc.h>
     9#include <re/re_name.h>
    910#include <llvm/Support/Casting.h>
    1011
     
    1415
    1516RE * makeDiff(RE * lh, RE * rh) {
    16     if (isa<CC>(lh) && isa<CC>(rh)) {
    17         return subtractCC(cast<CC>(lh), cast<CC>(rh));
     17    if (defined<CC>(lh) && defined<CC>(rh)) {
     18        CC * lh_cc = defCast<CC>(lh);
     19        CC * rh_cc = defCast<CC>(rh);
     20        if (lh_cc->getAlphabet() == rh_cc->getAlphabet())
     21            return subtractCC(lh_cc, rh_cc);
    1822    }
    1923    return new Diff(lh, rh);
Note: See TracChangeset for help on using the changeset viewer.