From db158be6466ad3188c1c8010c9701dcb47ed6c32 Mon Sep 17 00:00:00 2001 From: Andrea Di Biagio Date: Mon, 22 Oct 2018 16:28:07 +0000 Subject: [PATCH] [llvm-mca] Remove a couple of using directives and a bunch of redundant namespace llvm prefixes. NFC llvm-svn: 344916 --- llvm/tools/llvm-mca/CodeRegion.cpp | 17 ++++++++--------- llvm/tools/llvm-mca/PipelinePrinter.cpp | 2 -- .../tools/llvm-mca/Views/DispatchStatistics.cpp | 2 +- .../llvm-mca/Views/RegisterFileStatistics.cpp | 2 +- .../Views/RetireControlUnitStatistics.cpp | 2 +- .../llvm-mca/Views/SchedulerStatistics.cpp | 2 +- llvm/tools/llvm-mca/Views/SummaryView.cpp | 2 +- 7 files changed, 13 insertions(+), 16 deletions(-) diff --git a/llvm/tools/llvm-mca/CodeRegion.cpp b/llvm/tools/llvm-mca/CodeRegion.cpp index c26658a6cf58..591c45feb6da 100644 --- a/llvm/tools/llvm-mca/CodeRegion.cpp +++ b/llvm/tools/llvm-mca/CodeRegion.cpp @@ -14,11 +14,9 @@ #include "CodeRegion.h" -using namespace llvm; - namespace mca { -bool CodeRegion::isLocInRange(SMLoc Loc) const { +bool CodeRegion::isLocInRange(llvm::SMLoc Loc) const { if (RangeEnd.isValid() && Loc.getPointer() > RangeEnd.getPointer()) return false; if (RangeStart.isValid() && Loc.getPointer() < RangeStart.getPointer()) @@ -26,11 +24,11 @@ bool CodeRegion::isLocInRange(SMLoc Loc) const { return true; } -void CodeRegions::beginRegion(StringRef Description, SMLoc Loc) { +void CodeRegions::beginRegion(llvm::StringRef Description, llvm::SMLoc Loc) { assert(!Regions.empty() && "Missing Default region"); const CodeRegion &CurrentRegion = *Regions.back(); if (CurrentRegion.startLoc().isValid() && !CurrentRegion.endLoc().isValid()) { - SM.PrintMessage(Loc, SourceMgr::DK_Warning, + SM.PrintMessage(Loc, llvm::SourceMgr::DK_Warning, "Ignoring invalid region start"); return; } @@ -41,19 +39,20 @@ void CodeRegions::beginRegion(StringRef Description, SMLoc Loc) { addRegion(Description, Loc); } -void CodeRegions::endRegion(SMLoc Loc) { +void CodeRegions::endRegion(llvm::SMLoc Loc) { assert(!Regions.empty() && "Missing Default region"); CodeRegion &CurrentRegion = *Regions.back(); if (CurrentRegion.endLoc().isValid()) { - SM.PrintMessage(Loc, SourceMgr::DK_Warning, "Ignoring invalid region end"); + SM.PrintMessage(Loc, llvm::SourceMgr::DK_Warning, + "Ignoring invalid region end"); return; } CurrentRegion.setEndLocation(Loc); } -void CodeRegions::addInstruction(const MCInst &Instruction) { - const SMLoc &Loc = Instruction.getLoc(); +void CodeRegions::addInstruction(const llvm::MCInst &Instruction) { + const llvm::SMLoc &Loc = Instruction.getLoc(); const auto It = std::find_if(Regions.rbegin(), Regions.rend(), [Loc](const std::unique_ptr &Region) { diff --git a/llvm/tools/llvm-mca/PipelinePrinter.cpp b/llvm/tools/llvm-mca/PipelinePrinter.cpp index 619f22cc810e..8b2157a8eb6e 100644 --- a/llvm/tools/llvm-mca/PipelinePrinter.cpp +++ b/llvm/tools/llvm-mca/PipelinePrinter.cpp @@ -17,8 +17,6 @@ namespace mca { -using namespace llvm; - void PipelinePrinter::printReport(llvm::raw_ostream &OS) const { for (const auto &V : Views) V->printView(OS); diff --git a/llvm/tools/llvm-mca/Views/DispatchStatistics.cpp b/llvm/tools/llvm-mca/Views/DispatchStatistics.cpp index cccb09a9fa7d..98adcfb450d4 100644 --- a/llvm/tools/llvm-mca/Views/DispatchStatistics.cpp +++ b/llvm/tools/llvm-mca/Views/DispatchStatistics.cpp @@ -33,7 +33,7 @@ void DispatchStatistics::onEvent(const HWInstructionEvent &Event) { NumDispatched += DE.MicroOpcodes; } -void DispatchStatistics::printDispatchHistogram(llvm::raw_ostream &OS) const { +void DispatchStatistics::printDispatchHistogram(raw_ostream &OS) const { std::string Buffer; raw_string_ostream TempStream(Buffer); TempStream << "\n\nDispatch Logic - " diff --git a/llvm/tools/llvm-mca/Views/RegisterFileStatistics.cpp b/llvm/tools/llvm-mca/Views/RegisterFileStatistics.cpp index cd540e9dc60d..2697f528a0a4 100644 --- a/llvm/tools/llvm-mca/Views/RegisterFileStatistics.cpp +++ b/llvm/tools/llvm-mca/Views/RegisterFileStatistics.cpp @@ -19,7 +19,7 @@ using namespace llvm; namespace mca { -RegisterFileStatistics::RegisterFileStatistics(const llvm::MCSubtargetInfo &sti) +RegisterFileStatistics::RegisterFileStatistics(const MCSubtargetInfo &sti) : STI(sti) { const MCSchedModel &SM = STI.getSchedModel(); RegisterFileUsage Empty = {0, 0, 0}; diff --git a/llvm/tools/llvm-mca/Views/RetireControlUnitStatistics.cpp b/llvm/tools/llvm-mca/Views/RetireControlUnitStatistics.cpp index d5aab396b4c5..a9a4ac9a33dc 100644 --- a/llvm/tools/llvm-mca/Views/RetireControlUnitStatistics.cpp +++ b/llvm/tools/llvm-mca/Views/RetireControlUnitStatistics.cpp @@ -24,7 +24,7 @@ void RetireControlUnitStatistics::onEvent(const HWInstructionEvent &Event) { ++NumRetired; } -void RetireControlUnitStatistics::printView(llvm::raw_ostream &OS) const { +void RetireControlUnitStatistics::printView(raw_ostream &OS) const { std::string Buffer; raw_string_ostream TempStream(Buffer); TempStream << "\n\nRetire Control Unit - " diff --git a/llvm/tools/llvm-mca/Views/SchedulerStatistics.cpp b/llvm/tools/llvm-mca/Views/SchedulerStatistics.cpp index bc91bf04a81c..958b3b548f47 100644 --- a/llvm/tools/llvm-mca/Views/SchedulerStatistics.cpp +++ b/llvm/tools/llvm-mca/Views/SchedulerStatistics.cpp @@ -121,7 +121,7 @@ void SchedulerStatistics::printSchedulerUsage(raw_ostream &OS) const { FOS.flush(); } -void SchedulerStatistics::printView(llvm::raw_ostream &OS) const { +void SchedulerStatistics::printView(raw_ostream &OS) const { printSchedulerStats(OS); printSchedulerUsage(OS); } diff --git a/llvm/tools/llvm-mca/Views/SummaryView.cpp b/llvm/tools/llvm-mca/Views/SummaryView.cpp index eb4c50c5d1f4..98f3410d61b2 100644 --- a/llvm/tools/llvm-mca/Views/SummaryView.cpp +++ b/llvm/tools/llvm-mca/Views/SummaryView.cpp @@ -24,7 +24,7 @@ namespace mca { using namespace llvm; -SummaryView::SummaryView(const llvm::MCSchedModel &Model, const SourceMgr &S, +SummaryView::SummaryView(const MCSchedModel &Model, const SourceMgr &S, unsigned Width) : SM(Model), Source(S), DispatchWidth(Width), TotalCycles(0), NumMicroOps(0), ProcResourceUsage(Model.getNumProcResourceKinds(), 0),