From 012b058d685bd101a4326344812d8e94977f52cd Mon Sep 17 00:00:00 2001 From: Derek Bruening Date: Thu, 2 Nov 2017 10:13:32 -0400 Subject: [PATCH] i#2006 drcachesim generalization: make subclassing easier (#2685) Marks the file_reader_t::is_complete() and analyzer_t::init_file_reader() methods as virtual to provide more flexibility in subclassing. Cleans up some now-stale comments about drcachesim optimizations. Issue: #2006 --- clients/drcachesim/reader/compressed_file_reader.h | 2 +- clients/drcachesim/reader/file_reader.h | 4 ++-- clients/drcachesim/tools/histogram.h | 1 - clients/drcachesim/tools/reuse_distance.h | 1 - 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/clients/drcachesim/reader/compressed_file_reader.h b/clients/drcachesim/reader/compressed_file_reader.h index 3fc92f128c2..cef0c4d9911 100644 --- a/clients/drcachesim/reader/compressed_file_reader.h +++ b/clients/drcachesim/reader/compressed_file_reader.h @@ -47,7 +47,7 @@ class compressed_file_reader_t : public reader_t explicit compressed_file_reader_t(const char *file_name); virtual ~compressed_file_reader_t(); virtual bool init(); - bool is_complete(); + virtual bool is_complete(); protected: virtual trace_entry_t * read_next_entry(); diff --git a/clients/drcachesim/reader/file_reader.h b/clients/drcachesim/reader/file_reader.h index 6054380f6e9..c44d4e31b0d 100644 --- a/clients/drcachesim/reader/file_reader.h +++ b/clients/drcachesim/reader/file_reader.h @@ -1,5 +1,5 @@ /* ********************************************************** - * Copyright (c) 2016 Google, Inc. All rights reserved. + * Copyright (c) 2016-2017 Google, Inc. All rights reserved. * **********************************************************/ /* @@ -50,7 +50,7 @@ class file_reader_t : public reader_t explicit file_reader_t(const char *file_name); virtual ~file_reader_t(); virtual bool init(); - bool is_complete(); + virtual bool is_complete(); protected: virtual trace_entry_t * read_next_entry(); diff --git a/clients/drcachesim/tools/histogram.h b/clients/drcachesim/tools/histogram.h index 872a5dc2dd1..2c32b8c82ce 100644 --- a/clients/drcachesim/tools/histogram.h +++ b/clients/drcachesim/tools/histogram.h @@ -52,7 +52,6 @@ class histogram_t : public analysis_tool_t virtual bool print_results(); protected: - /* FIXME i#2020: use unsorted_map (C++11) for faster lookup */ std::unordered_map icache_map; std::unordered_map dcache_map; diff --git a/clients/drcachesim/tools/reuse_distance.h b/clients/drcachesim/tools/reuse_distance.h index 822ba1e2eb0..bda6279a7f8 100644 --- a/clients/drcachesim/tools/reuse_distance.h +++ b/clients/drcachesim/tools/reuse_distance.h @@ -74,7 +74,6 @@ class reuse_distance_t : public analysis_tool_t static unsigned int knob_verbose; protected: - /* XXX i#2020: use unsorted_map (C++11) for faster lookup */ std::unordered_map cache_map; // This is our reuse distance histogram. std::unordered_map dist_map;