Ignore:
Timestamp:
Jan 22, 2015, 3:04:10 PM (4 years ago)
Author:
nmedfort
Message:

Possible fix for segfault issue. CC seems to be generating the same charclass multiple times.

File:
1 edited

Legend:

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

    r4432 r4433  
    8181
    8282void PabloAST::replaceAllUsesWith(PabloAST * expr) {
     83    assert (expr);
    8384    while (!mUsers.empty()) {
    8485        PabloAST * user = mUsers.pop_back_val();
     
    188189}
    189190
    190 Statement * Statement::replaceWith(PabloAST * const expr) {
     191Statement * Statement::replaceWith(PabloAST * const expr, const bool rename) {
     192    assert (expr);
    191193    if (LLVM_UNLIKELY(expr == this)) {
    192194        return getNextNode();
     195    }
     196    if (LLVM_LIKELY(rename && isa<Statement>(expr))) {
     197        Statement * const stmt = cast<Statement>(expr);
     198        if (getName()->isUserDefined() && stmt->getName()->isGenerated()) {
     199            stmt->setName(getName());
     200        }
    193201    }
    194202    replaceAllUsesWith(expr);
Note: See TracChangeset for help on using the changeset viewer.