14#include "llvm/Support/CommandLine.h"
17llvm::cl::opt<bool> UseVisitorHash(
20 "Use hash-consing during expression visitation (default=true)"),
27 if (!UseVisitorHash || isa<ConstantExpr>(e)) {
30 visited_ty::iterator it =
visited.find(e);
36 visited.insert(std::make_pair(e, res));
43 if (isa<ConstantExpr>(e)) {
93 assert(0 &&
"invalid expression kind");
98 assert(0 &&
"invalid kind");
100 bool rebuild =
false;
103 for (
unsigned i=0; i<count; i++) {
105 kids[i] =
visit(kid);
114 if (!isa<ConstantExpr>(e)) {
static Action doChildren()
static Action skipChildren()
virtual Action visitUle(const UleExpr &)
virtual Action visitUge(const UgeExpr &)
virtual Action visitZExt(const ZExtExpr &)
ref< Expr > visit(const ref< Expr > &e)
virtual Action visitOr(const OrExpr &)
virtual Action visitSge(const SgeExpr &)
virtual Action visitNotOptimized(const NotOptimizedExpr &)
virtual Action visitSRem(const SRemExpr &)
virtual Action visitRead(const ReadExpr &)
virtual Action visitMul(const MulExpr &)
ref< Expr > visitActual(const ref< Expr > &e)
virtual Action visitSub(const SubExpr &)
virtual Action visitSExt(const SExtExpr &)
virtual Action visitURem(const URemExpr &)
virtual Action visitSlt(const SltExpr &)
virtual Action visitEq(const EqExpr &)
virtual Action visitSDiv(const SDivExpr &)
virtual Action visitAShr(const AShrExpr &)
virtual Action visitSgt(const SgtExpr &)
virtual Action visitAdd(const AddExpr &)
virtual Action visitXor(const XorExpr &)
virtual Action visitAnd(const AndExpr &)
virtual Action visitExprPost(const Expr &)
virtual Action visitExpr(const Expr &)
virtual Action visitExtract(const ExtractExpr &)
virtual Action visitLShr(const LShrExpr &)
virtual Action visitShl(const ShlExpr &)
virtual Action visitUlt(const UltExpr &)
virtual Action visitSle(const SleExpr &)
virtual Action visitConcat(const ConcatExpr &)
virtual Action visitNot(const NotExpr &)
virtual Action visitNe(const NeExpr &)
virtual Action visitUgt(const UgtExpr &)
virtual Action visitSelect(const SelectExpr &)
virtual Action visitUDiv(const UDivExpr &)
Class representing symbolic expressions.
virtual Kind getKind() const =0
virtual unsigned getNumKids() const =0
@ Sge
Not used in canonical form.
@ Ne
Not used in canonical form.
@ Ugt
Not used in canonical form.
@ Sgt
Not used in canonical form.
@ Uge
Not used in canonical form.
virtual ref< Expr > rebuild(ref< Expr > kids[]) const =0
virtual ref< Expr > getKid(unsigned i) const =0
Class representing a one byte read from an array.
Class representing an if-then-else expression.
llvm::cl::OptionCategory ExprCat