[llvm-mca] Remove a couple of using directives and a bunch of redundant namespace llvm prefixes. NFC

llvm-svn: 344916
This commit is contained in:
Andrea Di Biagio 2018-10-22 16:28:07 +00:00
parent 5f5b910495
commit db158be646
7 changed files with 13 additions and 16 deletions

View File

@ -14,11 +14,9 @@
#include "CodeRegion.h" #include "CodeRegion.h"
using namespace llvm;
namespace mca { namespace mca {
bool CodeRegion::isLocInRange(SMLoc Loc) const { bool CodeRegion::isLocInRange(llvm::SMLoc Loc) const {
if (RangeEnd.isValid() && Loc.getPointer() > RangeEnd.getPointer()) if (RangeEnd.isValid() && Loc.getPointer() > RangeEnd.getPointer())
return false; return false;
if (RangeStart.isValid() && Loc.getPointer() < RangeStart.getPointer()) if (RangeStart.isValid() && Loc.getPointer() < RangeStart.getPointer())
@ -26,11 +24,11 @@ bool CodeRegion::isLocInRange(SMLoc Loc) const {
return true; return true;
} }
void CodeRegions::beginRegion(StringRef Description, SMLoc Loc) { void CodeRegions::beginRegion(llvm::StringRef Description, llvm::SMLoc Loc) {
assert(!Regions.empty() && "Missing Default region"); assert(!Regions.empty() && "Missing Default region");
const CodeRegion &CurrentRegion = *Regions.back(); const CodeRegion &CurrentRegion = *Regions.back();
if (CurrentRegion.startLoc().isValid() && !CurrentRegion.endLoc().isValid()) { if (CurrentRegion.startLoc().isValid() && !CurrentRegion.endLoc().isValid()) {
SM.PrintMessage(Loc, SourceMgr::DK_Warning, SM.PrintMessage(Loc, llvm::SourceMgr::DK_Warning,
"Ignoring invalid region start"); "Ignoring invalid region start");
return; return;
} }
@ -41,19 +39,20 @@ void CodeRegions::beginRegion(StringRef Description, SMLoc Loc) {
addRegion(Description, Loc); addRegion(Description, Loc);
} }
void CodeRegions::endRegion(SMLoc Loc) { void CodeRegions::endRegion(llvm::SMLoc Loc) {
assert(!Regions.empty() && "Missing Default region"); assert(!Regions.empty() && "Missing Default region");
CodeRegion &CurrentRegion = *Regions.back(); CodeRegion &CurrentRegion = *Regions.back();
if (CurrentRegion.endLoc().isValid()) { 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; return;
} }
CurrentRegion.setEndLocation(Loc); CurrentRegion.setEndLocation(Loc);
} }
void CodeRegions::addInstruction(const MCInst &Instruction) { void CodeRegions::addInstruction(const llvm::MCInst &Instruction) {
const SMLoc &Loc = Instruction.getLoc(); const llvm::SMLoc &Loc = Instruction.getLoc();
const auto It = const auto It =
std::find_if(Regions.rbegin(), Regions.rend(), std::find_if(Regions.rbegin(), Regions.rend(),
[Loc](const std::unique_ptr<CodeRegion> &Region) { [Loc](const std::unique_ptr<CodeRegion> &Region) {

View File

@ -17,8 +17,6 @@
namespace mca { namespace mca {
using namespace llvm;
void PipelinePrinter::printReport(llvm::raw_ostream &OS) const { void PipelinePrinter::printReport(llvm::raw_ostream &OS) const {
for (const auto &V : Views) for (const auto &V : Views)
V->printView(OS); V->printView(OS);

View File

@ -33,7 +33,7 @@ void DispatchStatistics::onEvent(const HWInstructionEvent &Event) {
NumDispatched += DE.MicroOpcodes; NumDispatched += DE.MicroOpcodes;
} }
void DispatchStatistics::printDispatchHistogram(llvm::raw_ostream &OS) const { void DispatchStatistics::printDispatchHistogram(raw_ostream &OS) const {
std::string Buffer; std::string Buffer;
raw_string_ostream TempStream(Buffer); raw_string_ostream TempStream(Buffer);
TempStream << "\n\nDispatch Logic - " TempStream << "\n\nDispatch Logic - "

View File

@ -19,7 +19,7 @@ using namespace llvm;
namespace mca { namespace mca {
RegisterFileStatistics::RegisterFileStatistics(const llvm::MCSubtargetInfo &sti) RegisterFileStatistics::RegisterFileStatistics(const MCSubtargetInfo &sti)
: STI(sti) { : STI(sti) {
const MCSchedModel &SM = STI.getSchedModel(); const MCSchedModel &SM = STI.getSchedModel();
RegisterFileUsage Empty = {0, 0, 0}; RegisterFileUsage Empty = {0, 0, 0};

View File

@ -24,7 +24,7 @@ void RetireControlUnitStatistics::onEvent(const HWInstructionEvent &Event) {
++NumRetired; ++NumRetired;
} }
void RetireControlUnitStatistics::printView(llvm::raw_ostream &OS) const { void RetireControlUnitStatistics::printView(raw_ostream &OS) const {
std::string Buffer; std::string Buffer;
raw_string_ostream TempStream(Buffer); raw_string_ostream TempStream(Buffer);
TempStream << "\n\nRetire Control Unit - " TempStream << "\n\nRetire Control Unit - "

View File

@ -121,7 +121,7 @@ void SchedulerStatistics::printSchedulerUsage(raw_ostream &OS) const {
FOS.flush(); FOS.flush();
} }
void SchedulerStatistics::printView(llvm::raw_ostream &OS) const { void SchedulerStatistics::printView(raw_ostream &OS) const {
printSchedulerStats(OS); printSchedulerStats(OS);
printSchedulerUsage(OS); printSchedulerUsage(OS);
} }

View File

@ -24,7 +24,7 @@ namespace mca {
using namespace llvm; using namespace llvm;
SummaryView::SummaryView(const llvm::MCSchedModel &Model, const SourceMgr &S, SummaryView::SummaryView(const MCSchedModel &Model, const SourceMgr &S,
unsigned Width) unsigned Width)
: SM(Model), Source(S), DispatchWidth(Width), TotalCycles(0), : SM(Model), Source(S), DispatchWidth(Width), TotalCycles(0),
NumMicroOps(0), ProcResourceUsage(Model.getNumProcResourceKinds(), 0), NumMicroOps(0), ProcResourceUsage(Model.getNumProcResourceKinds(), 0),