about summary refs log tree commit diff homepage
path: root/lib/Expr/ArrayExprVisitor.cpp
diff options
context:
space:
mode:
authorMartin Nowack <m.nowack@imperial.ac.uk>2018-10-18 13:51:21 +0100
committerCristian Cadar <c.cadar@imperial.ac.uk>2018-10-23 18:53:46 +0300
commit8bfd97d583e932973f0d363f8cfd695ecb5e002e (patch)
treef8791168bf0771df1ab3596e942e80fb751e0e7d /lib/Expr/ArrayExprVisitor.cpp
parente13f4d5ea1201361ec96aa96afec7b5604c52082 (diff)
downloadklee-8bfd97d583e932973f0d363f8cfd695ecb5e002e.tar.gz
Modernize code
* use `using` instead of typdef
* use `collection.empty()` instead of size
* use `auto` if clear
* use `emplace_back` where useful
* use `nullptr` instead of NULL
* use `override` if applicable
* use `explicit` for constructor to avoid implicit conversion
Diffstat (limited to 'lib/Expr/ArrayExprVisitor.cpp')
-rw-r--r--lib/Expr/ArrayExprVisitor.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Expr/ArrayExprVisitor.cpp b/lib/Expr/ArrayExprVisitor.cpp
index 407c4c64..e4ea9a1c 100644
--- a/lib/Expr/ArrayExprVisitor.cpp
+++ b/lib/Expr/ArrayExprVisitor.cpp
@@ -30,7 +30,7 @@ ReadExpr *ArrayExprHelper::hasOrderedReads(const ConcatExpr &ce) {
   // right now, all Reads are byte reads but some
   // transformations might change this
   if (!base || base->getWidth() != Expr::Int8)
-    return NULL;
+    return nullptr;
 
   // Get stride expr in proper index width.
   Expr::Width idxWidth = base->index->getWidth();
@@ -43,13 +43,13 @@ ReadExpr *ArrayExprHelper::hasOrderedReads(const ConcatExpr &ce) {
   while (e->getKind() == Expr::Concat) {
     offset = AddExpr::create(offset, strideExpr);
     if (!isReadExprAtOffset(e->getKid(0), base, offset))
-      return NULL;
+      return nullptr;
     e = e->getKid(1);
   }
 
   offset = AddExpr::create(offset, strideExpr);
   if (!isReadExprAtOffset(e, base, offset))
-    return NULL;
+    return nullptr;
 
   return cast<ReadExpr>(e.get());
 }
@@ -268,7 +268,7 @@ ExprVisitor::Action IndexCleanerVisitor::visitMul(const MulExpr &e) {
   return Action::doChildren();
 }
 
-ExprVisitor::Action IndexCleanerVisitor::visitRead(const ReadExpr &re) {
+ExprVisitor::Action IndexCleanerVisitor::visitRead(const ReadExpr &) {
   mul = false;
   return Action::doChildren();
 }