source: icGREP/icgrep-devel/icgrep/re/re_diff.cpp @ 6223

Last change on this file since 6223 was 6223, checked in by cameron, 5 months ago

Contextual assertion simplifier from Jeremy Schwartz - initial check-in

File size: 752 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_diff.h"
8#include <re/re_cc.h>
9#include <re/re_seq.h>
10#include <re/re_name.h>
11#include <re/re_empty_set.h>
12#include <llvm/Support/Casting.h>
13
14using namespace llvm;
15
16namespace re {
17
18#include <re/re_empty_set.h>
19   
20RE * makeDiff(RE * lh, RE * rh) {
21   
22    if (LLVM_UNLIKELY(isEmptySeq(lh) && isEmptySeq(rh))) {
23        return makeEmptySet();
24    } else if (LLVM_UNLIKELY(isEmptySet(rh))) {
25        return lh;
26    } else if (LLVM_UNLIKELY(isEmptySet(lh))) {
27        return makeEmptySet();
28    } else {
29        return new Diff(lh, rh);
30    }
31}
32
33}
Note: See TracBrowser for help on using the repository browser.