about summary refs log tree commit diff homepage
path: root/lib/Expr/Expr.cpp
diff options
context:
space:
mode:
authorDan Liew <daniel.liew@imperial.ac.uk>2016-11-28 10:57:12 +0000
committerDan Liew <daniel.liew@imperial.ac.uk>2016-11-28 15:08:08 +0000
commit08d4716e7882be14d3b2d466d0fa8a58d087523d (patch)
tree28b3e4c59f8342d9db2786d8a7a7f0bcc6f4daa6 /lib/Expr/Expr.cpp
parent3946c3232512e436891d299243c9986a5f6e1e4c (diff)
downloadklee-08d4716e7882be14d3b2d466d0fa8a58d087523d.tar.gz
Clean up `Expr::compare()` interface by
* Making `Expr::compre(const Expr&, ExprEquivSet)` private and moving
  its implementation into `Expr.cpp`.
* Document `Expr::compare(const Expr&)`.

This partially addresses #515 .
Diffstat (limited to 'lib/Expr/Expr.cpp')
-rw-r--r--lib/Expr/Expr.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp
index 182093b9..15f52184 100644
--- a/lib/Expr/Expr.cpp
+++ b/lib/Expr/Expr.cpp
@@ -83,6 +83,13 @@ ref<Expr> Expr::createTempRead(const Array *array, Expr::Width w) {
   }
 }
 
+int Expr::compare(const Expr &b) const {
+  static ExprEquivSet equivs;
+  int r = compare(b, equivs);
+  equivs.clear();
+  return r;
+}
+
 // returns 0 if b is structurally equal to *this
 int Expr::compare(const Expr &b, ExprEquivSet &equivs) const {
   if (this == &b) return 0;