source: icGREP/icgrep-devel/icgrep/re/re_intersect.cpp @ 6184

Last change on this file since 6184 was 6159, checked in by cameron, 11 months ago

Optimization of intersect/diff

File size: 646 bytes
Line 
1/*
2 *  Copyright (c) 2018 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6
7#include "re_intersect.h"
8#include "re_cc.h"
9#include <re/re_name.h>
10#include <llvm/Support/Casting.h>
11
12using namespace llvm;
13
14namespace re {
15
16RE * makeIntersect(RE * lh, RE * 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 intersectCC(lh_cc, rh_cc);
22    }
23    return new Intersect(lh, rh);
24}
25
26}
Note: See TracBrowser for help on using the repository browser.