The attached patch introduces a BinarySymExpr base class for SymSymExpr, 
SymIntExpr, and IntSymExpr, and factors getType() and getOpcode() out of these 
subclasses and into the base class. I could not factor getLHS() and getRHS() 
into the base class because these return unrelated types between subclasses.

This permits the simplification of repetitive code such as:

    case SymExpr::SymIntKind:
      return cast<SymIntExpr>(SE)->getOpcode();
    case SymExpr::IntSymKind:
      return cast<IntSymExpr>(SE)->getOpcode();
    case SymExpr::SymSymKind:
      return cast<SymSymExpr>(SE)->getOpcode();

However I did not notice any existing parts of the static analyzer that would 
currently benefit from this refactoring.

Ryan

Attachment: BinarySymExpr-0001.diff
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to