Changeset 6185


Ignore:
Timestamp:
Nov 2, 2018, 8:33:46 PM (6 months ago)
Author:
cameron
Message:

Fix segfault issue on Mac OS

Location:
icGREP/icgrep-devel/icgrep/re
Files:
6 edited

Legend:

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

    r6173 r6185  
    2020using List = std::vector<RE *>;
    2121
    22 struct PassContainer final : public RE_Transformer {
     22struct RE_Minimizer : public RE_Transformer {
    2323
    2424    RE * transformAlt(Alt * alt) override {
     
    102102    }
    103103
    104     PassContainer() : RE_Transformer("minimizer", NameTransformationMode::TransformDefinition) { }
     104    RE_Minimizer() : RE_Transformer("minimizer", NameTransformationMode::TransformDefinition) { }
    105105
    106106protected:
     
    307307
    308308
    309 RE * RE_Minimizer::minimize(RE * re) {
    310     PassContainer pc;
    311     return pc.transformRE(re);
     309RE * minimizeRE(RE * re) {
     310    return RE_Minimizer().transformRE(re);
    312311}
    313312
  • icGREP/icgrep-devel/icgrep/re/re_minimizer.h

    r5630 r6185  
    55
    66class RE;
    7 
    8 class RE_Minimizer {
    9 public:
    10     static RE * minimize(RE * re);
    11 };
     7   
     8RE * minimizeRE(RE * re);
    129
    1310}
  • icGREP/icgrep-devel/icgrep/re/re_simplifier.cpp

    r6184 r6185  
    1919using List = std::vector<RE *>;
    2020
    21 struct PassContainer final : public RE_Transformer {
     21struct RE_Simplifier final : public RE_Transformer {
    2222
    2323    RE * transformAlt(Alt * alt) override {
     
    5555    }
    5656
    57     PassContainer() : RE_Transformer("Simplifier", NameTransformationMode::TransformDefinition) { }
     57    RE_Simplifier() : RE_Transformer("Simplifier", NameTransformationMode::TransformDefinition) { }
    5858
    5959};
    6060
    61 RE * RE_Simplifier::simplify(RE * re) {
    62     PassContainer pc;
    63     return pc.transformRE(re);
     61RE * simplifyRE(RE * re) {
     62    return RE_Simplifier().transformRE(re);
    6463}
    6564
  • icGREP/icgrep-devel/icgrep/re/re_simplifier.h

    r5732 r6185  
    88class RE;
    99
    10 class RE_Simplifier {
    11 public:
    12     static RE * simplify(RE * re);
    13 };
     10RE * simplifyRE(RE * re);
    1411
    1512}
  • icGREP/icgrep-devel/icgrep/re/re_toolchain.cpp

    r6184 r6185  
    116116    r = RE_Star_Normal().transformRE(r);
    117117    if (codegen::OptLevel > 1) {
    118         r = RE_Minimizer::minimize(r);
    119     } else {
    120         r = RE_Simplifier::simplify(r);
     118        r = minimizeRE(r);
     119    } else {
     120        r = simplifyRE(r);
    121121    }
    122122    if (!DefiniteLengthBackReferencesOnly(r)) {
  • icGREP/icgrep-devel/icgrep/re/re_toolchain.h

    r6178 r6185  
    5454    : mTransformationName(std::move(transformationName)), mNameTransform(m) {}
    5555
     56    virtual ~RE_Transformer() {}
    5657    RE * transform(RE * r);
    5758    virtual RE * transformName(Name * n);
Note: See TracChangeset for help on using the changeset viewer.