[PATCH v1 00/13] Remove the global variables in app_common

Ryan Long ryan.long at oarcorp.com
Sun Aug 1 23:23:34 UTC 2021


Hi,

This is a tedious series of patches.

To remove the global variables, the process was generally:
1. Remove the global variable, reokace it with a variable in main()
2. Pass it to a constructor for the objects that were using the global
   variable and initialize a newly created member variable
3. Pass it as a parameter to any non-class or static function

For some of the newly created member variables, I had to create a get
and set function. It may look like a lot was changed because when a new
parameter needed to be added, I had to adjust the formatting of the
parameters above.

All of the global variables were pointers before, and they have been
changed to reference variables. The only exception to this is
TargetInfo.

Thanks,
Ryan


Ryan Long (13):
  Remove AllExplanations global variable
  ReportsHtml.cc: Initialize lastState_m
  Remove objdumpProcessor global variable
  Remove Verbose global variable
  Remove dynamicLibrary global variable
  Remove projectName global variable
  Remove outputDirectory global variable
  Remove input buffer global variables
  Remove SymbolsToAnalyze global variable
  Remove BranchInfoAvailable global variable
  Remove TargetInfo global variable
  app_common: Remove functions and macros
  Remove app_common and all references to it

 tester/covoar/CoverageReaderBase.cc |  10 +++
 tester/covoar/CoverageReaderBase.h  |  22 +++++
 tester/covoar/CoverageReaderQEMU.cc |   7 +-
 tester/covoar/CoverageReaderTSIM.cc |   5 +-
 tester/covoar/DesiredSymbols.cc     |  28 +++---
 tester/covoar/DesiredSymbols.h      |  28 ++++--
 tester/covoar/ExecutableInfo.cc     |  23 ++---
 tester/covoar/ExecutableInfo.h      |  17 +++-
 tester/covoar/Explanations.cc       |  21 ++---
 tester/covoar/GcovData.cc           |   7 +-
 tester/covoar/GcovData.h            |  12 ++-
 tester/covoar/GcovFunctionData.cc   |  15 ++--
 tester/covoar/GcovFunctionData.h    |   6 +-
 tester/covoar/Makefile              |   6 +-
 tester/covoar/ObjdumpProcessor.cc   |  66 +++++++++-----
 tester/covoar/ObjdumpProcessor.h    | 113 +++++++++++++++---------
 tester/covoar/ReportsBase.cc        | 166 +++++++++++++++++++++++-------------
 tester/covoar/ReportsBase.h         |  69 +++++++++++++--
 tester/covoar/ReportsHtml.cc        |  64 +++++++++-----
 tester/covoar/ReportsHtml.h         |  10 ++-
 tester/covoar/ReportsText.cc        |  28 ++++--
 tester/covoar/ReportsText.h         |  10 ++-
 tester/covoar/SymbolTable.cc        |   1 -
 tester/covoar/TraceConverter.cc     |  39 ++++++---
 tester/covoar/TraceReaderBase.h     |   7 +-
 tester/covoar/TraceReaderLogQEMU.cc |  25 +++++-
 tester/covoar/TraceReaderLogQEMU.h  |   6 +-
 tester/covoar/TraceWriterBase.cc    |   5 ++
 tester/covoar/TraceWriterBase.h     |  16 +++-
 tester/covoar/TraceWriterQEMU.cc    |  12 +--
 tester/covoar/TraceWriterQEMU.h     |   4 +-
 tester/covoar/app_common.cc         | 118 -------------------------
 tester/covoar/app_common.h          |  34 --------
 tester/covoar/coverage_converter.cc |   1 -
 tester/covoar/covmerge.cc           |   8 +-
 tester/covoar/covoar.cc             | 124 ++++++++++++++++++---------
 tester/covoar/wscript               |   3 +-
 37 files changed, 681 insertions(+), 455 deletions(-)
 delete mode 100644 tester/covoar/app_common.cc
 delete mode 100644 tester/covoar/app_common.h

-- 
1.8.3.1



More information about the devel mailing list