Ignore:
Timestamp:
Oct 30, 2014, 1:19:34 PM (5 years ago)
Author:
nmedfort
Message:

Created an "insertion friendly" Pablo AST structure similar to LLVM; fixed engine builder bug when creating a unicode class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/pabloAST.cpp

    r4272 r4276  
    1919#include "pe_zeroes.h"
    2020#include "pe_ones.h"
     21#include <llvm/Support/Compiler.h>
    2122
    2223namespace pablo {
     
    3334
    3435bool equals(const PabloAST * expr1, const PabloAST * expr2) {
     36    assert (expr1 && expr2);
    3537    if (expr1->getClassTypeId() == expr2->getClassTypeId()) {
    3638        if ((isa<const Zeroes>(expr1)) || (isa<const Ones>(expr1))) {
     
    9092}
    9193
     94void StatementList::push_back(Statement * const statement) {
     95    if (LLVM_UNLIKELY(mLast == nullptr)) {
     96        mFirst = mLast = statement;
     97    }
     98    else {
     99        statement->insertAfter(mLast);
     100        mLast = statement;
     101    }
    92102}
     103
     104}
Note: See TracChangeset for help on using the changeset viewer.