source: icGREP/icgrep-devel/icgrep/pablo/pe_not.cpp @ 4388

Last change on this file since 4388 was 4247, checked in by cameron, 5 years ago

All -> Zeroes, Ones

File size: 588 bytes
Line 
1/*
2 *  Copyright (c) 2014 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 <pablo/pe_not.h>
8#include <pablo/codegenstate.h>
9
10
11namespace pablo {
12
13PabloAST * OptimizeNot::operator ()(PabloAST * expr) {
14    if (isa<Ones>(expr)) {
15        return cg.createZeroes();
16    }
17    else if (isa<Zeroes>(expr)){
18        return cg.createOnes();       
19    }
20    else if (Not * pe_not = dyn_cast<Not>(expr)) {
21        return pe_not->getExpr();
22    }
23    return new Not(expr);
24}
25
26}
Note: See TracBrowser for help on using the repository browser.