[Lldb-commits] [PATCH] D77790: [NFC] Add a test for the inferior memory cache (mainly L1)

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 9 05:23:27 PDT 2020


labath added a comment.

Thanks for splitting this up. This looks fine to me, modulo some nits, but lets wait  @clayborg has to say.



================
Comment at: lldb/source/Target/Memory.cpp:63
     if (pos != m_L1_cache.begin()) {
-      --pos;
+      pos--;
     }
----------------
I guess this is a leftover from splitting the patches?

Speaking of post-increment the [[ http://llvm.org/docs/CodingStandards.html#prefer-preincrement | llvm rule ]] is to use pre-increment whereever possible. I see the test uses post-increment exclusively for no good reason.


================
Comment at: lldb/unittests/Target/MemoryCacheTest.cpp:30
+  MemoryCacheTest()
+      : m_cache(*this, k_cache_line_size), m_inferior_read_count(0) {
+    // Fill memory from [0x0 - 0x256) with byte values that match the index. We
----------------
You can move setting of `m_inferior_read_count` into the initializer.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77790/new/

https://reviews.llvm.org/D77790





More information about the lldb-commits mailing list