[llvm-mca] Add descriptive names for the TimelineView report characters. NFC.

Summary:
This change makes the TimelineView source simpler to read and easier to modify in the future.
This patch introduces a class of static chars used as the display values in the TimelineView report, this change just eliminates a few magic characters.

Reviewers: andreadb, courbet, RKSimon

Reviewed By: andreadb

Subscribers: tschuett, gbedwell, llvm-commits

Differential Revision: https://reviews.llvm.org/D46409

llvm-svn: 331540
diff --git a/llvm/tools/llvm-mca/TimelineView.cpp b/llvm/tools/llvm-mca/TimelineView.cpp
index 840d4db..01fb84e 100644
--- a/llvm/tools/llvm-mca/TimelineView.cpp
+++ b/llvm/tools/llvm-mca/TimelineView.cpp
@@ -153,28 +153,28 @@
   OS << '[' << Iteration << ',' << SourceIndex << "]\t";
   for (unsigned I = 0, E = Entry.CycleDispatched; I < E; ++I)
     OS << ((I % 5 == 0) ? '.' : ' ');
-  OS << 'D';
+  OS << TimelineView::DisplayChar::Dispatched;
   if (Entry.CycleDispatched != Entry.CycleExecuted) {
     // Zero latency instructions have the same value for CycleDispatched,
     // CycleIssued and CycleExecuted.
     for (unsigned I = Entry.CycleDispatched + 1, E = Entry.CycleIssued; I < E;
          ++I)
-      OS << '=';
+      OS << TimelineView::DisplayChar::Waiting;
     if (Entry.CycleIssued == Entry.CycleExecuted)
-      OS << 'E';
+      OS << TimelineView::DisplayChar::DisplayChar::Executed;
     else {
       if (Entry.CycleDispatched != Entry.CycleIssued)
-        OS << 'e';
+        OS << TimelineView::DisplayChar::Executing;
       for (unsigned I = Entry.CycleIssued + 1, E = Entry.CycleExecuted; I < E;
            ++I)
-        OS << 'e';
-      OS << 'E';
+        OS << TimelineView::DisplayChar::Executing;
+      OS << TimelineView::DisplayChar::Executed;
     }
   }
 
   for (unsigned I = Entry.CycleExecuted + 1, E = Entry.CycleRetired; I < E; ++I)
-    OS << '-';
-  OS << 'R';
+    OS << TimelineView::DisplayChar::RetireLag;
+  OS << TimelineView::DisplayChar::Retired;
 
   // Skip other columns.
   for (unsigned I = Entry.CycleRetired + 1, E = LastCycle; I <= E; ++I)
diff --git a/llvm/tools/llvm-mca/TimelineView.h b/llvm/tools/llvm-mca/TimelineView.h
index 09dc990..af73ce0 100644
--- a/llvm/tools/llvm-mca/TimelineView.h
+++ b/llvm/tools/llvm-mca/TimelineView.h
@@ -152,6 +152,16 @@
 
   void initialize(unsigned MaxIterations);
 
+  // Display characters for the TimelineView report output.
+  struct DisplayChar {
+    static const char Dispatched = 'D';
+    static const char Executed = 'E';
+    static const char Retired = 'R';
+    static const char Waiting = '='; // Instruction is waiting in the scheduler.
+    static const char Executing = 'e';
+    static const char RetireLag = '-'; // The instruction is waiting to retire.
+  };
+
 public:
   TimelineView(const llvm::MCSubtargetInfo &sti, llvm::MCInstPrinter &Printer,
                const SourceMgr &Sequence, unsigned MaxIterations,