Index: tools/llvm-mca/CodeRegion.h =================================================================== --- tools/llvm-mca/CodeRegion.h +++ tools/llvm-mca/CodeRegion.h @@ -40,6 +40,7 @@ #include "llvm/Support/SourceMgr.h" #include +namespace llvm { namespace mca { /// A region of assembly code. @@ -127,5 +128,6 @@ }; } // namespace mca +} // namespace llvm #endif Index: tools/llvm-mca/CodeRegion.cpp =================================================================== --- tools/llvm-mca/CodeRegion.cpp +++ tools/llvm-mca/CodeRegion.cpp @@ -14,8 +14,7 @@ #include "CodeRegion.h" -using namespace llvm; - +namespace llvm { namespace mca { bool CodeRegion::isLocInRange(SMLoc Loc) const { @@ -64,3 +63,4 @@ } } // namespace mca +} // namespace llvm Index: tools/llvm-mca/PipelinePrinter.h =================================================================== --- tools/llvm-mca/PipelinePrinter.h +++ tools/llvm-mca/PipelinePrinter.h @@ -24,6 +24,7 @@ #define DEBUG_TYPE "llvm-mca" +namespace llvm { namespace mca { /// A printer class that knows how to collects statistics on the @@ -48,5 +49,6 @@ void printReport(llvm::raw_ostream &OS) const; }; } // namespace mca +} // namespace llvm #endif // LLVM_TOOLS_LLVM_MCA_PIPELINEPRINTER_H Index: tools/llvm-mca/PipelinePrinter.cpp =================================================================== --- tools/llvm-mca/PipelinePrinter.cpp +++ tools/llvm-mca/PipelinePrinter.cpp @@ -15,12 +15,12 @@ #include "PipelinePrinter.h" #include "Views/View.h" +namespace llvm { namespace mca { -using namespace llvm; - void PipelinePrinter::printReport(llvm::raw_ostream &OS) const { for (const auto &V : Views) V->printView(OS); } } // namespace mca. +} // namespace llvm Index: tools/llvm-mca/Views/DispatchStatistics.h =================================================================== --- tools/llvm-mca/Views/DispatchStatistics.h +++ tools/llvm-mca/Views/DispatchStatistics.h @@ -39,6 +39,7 @@ #include "llvm/MC/MCSubtargetInfo.h" #include +namespace llvm { namespace mca { class DispatchStatistics : public View { @@ -80,5 +81,6 @@ } }; } // namespace mca +} // namespace llvm #endif Index: tools/llvm-mca/Views/DispatchStatistics.cpp =================================================================== --- tools/llvm-mca/Views/DispatchStatistics.cpp +++ tools/llvm-mca/Views/DispatchStatistics.cpp @@ -16,8 +16,7 @@ #include "Views/DispatchStatistics.h" #include "llvm/Support/Format.h" -using namespace llvm; - +namespace llvm { namespace mca { void DispatchStatistics::onEvent(const HWStallEvent &Event) { @@ -84,3 +83,4 @@ } } // namespace mca +} // namespace llvm Index: tools/llvm-mca/Views/InstructionInfoView.h =================================================================== --- tools/llvm-mca/Views/InstructionInfoView.h +++ tools/llvm-mca/Views/InstructionInfoView.h @@ -44,6 +44,7 @@ #define DEBUG_TYPE "llvm-mca" +namespace llvm { namespace mca { /// A view that prints out generic instruction information. @@ -62,5 +63,6 @@ void printView(llvm::raw_ostream &OS) const override; }; } // namespace mca +} // namespace llvm #endif Index: tools/llvm-mca/Views/InstructionInfoView.cpp =================================================================== --- tools/llvm-mca/Views/InstructionInfoView.cpp +++ tools/llvm-mca/Views/InstructionInfoView.cpp @@ -14,10 +14,9 @@ #include "Views/InstructionInfoView.h" +namespace llvm { namespace mca { -using namespace llvm; - void InstructionInfoView::printView(raw_ostream &OS) const { std::string Buffer; raw_string_ostream TempStream(Buffer); @@ -89,3 +88,4 @@ OS << Buffer; } } // namespace mca. +} // namespace llvm Index: tools/llvm-mca/Views/RegisterFileStatistics.h =================================================================== --- tools/llvm-mca/Views/RegisterFileStatistics.h +++ tools/llvm-mca/Views/RegisterFileStatistics.h @@ -36,6 +36,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCSubtargetInfo.h" +namespace llvm { namespace mca { class RegisterFileStatistics : public View { @@ -58,5 +59,6 @@ void printView(llvm::raw_ostream &OS) const override; }; } // namespace mca +} // namespace llvm #endif Index: tools/llvm-mca/Views/RegisterFileStatistics.cpp =================================================================== --- tools/llvm-mca/Views/RegisterFileStatistics.cpp +++ tools/llvm-mca/Views/RegisterFileStatistics.cpp @@ -15,8 +15,7 @@ #include "Views/RegisterFileStatistics.h" #include "llvm/Support/Format.h" -using namespace llvm; - +namespace llvm { namespace mca { RegisterFileStatistics::RegisterFileStatistics(const llvm::MCSubtargetInfo &sti) @@ -106,3 +105,4 @@ } } // namespace mca +} // namespace llvm Index: tools/llvm-mca/Views/ResourcePressureView.h =================================================================== --- tools/llvm-mca/Views/ResourcePressureView.h +++ tools/llvm-mca/Views/ResourcePressureView.h @@ -65,6 +65,7 @@ #include "llvm/MC/MCSubtargetInfo.h" #include +namespace llvm { namespace mca { /// This class collects resource pressure statistics and it is able to print @@ -105,5 +106,6 @@ } }; } // namespace mca +} // namespace llvm #endif Index: tools/llvm-mca/Views/ResourcePressureView.cpp =================================================================== --- tools/llvm-mca/Views/ResourcePressureView.cpp +++ tools/llvm-mca/Views/ResourcePressureView.cpp @@ -16,10 +16,9 @@ #include "llvm/Support/FormattedStream.h" #include "llvm/Support/raw_ostream.h" +namespace llvm { namespace mca { -using namespace llvm; - void ResourcePressureView::initialize() { // Populate the map of resource descriptors. unsigned R2VIndex = 0; @@ -170,3 +169,4 @@ } } } // namespace mca +} // namespace llvm Index: tools/llvm-mca/Views/RetireControlUnitStatistics.h =================================================================== --- tools/llvm-mca/Views/RetireControlUnitStatistics.h +++ tools/llvm-mca/Views/RetireControlUnitStatistics.h @@ -30,6 +30,7 @@ #include "llvm/MC/MCSubtargetInfo.h" #include +namespace llvm { namespace mca { class RetireControlUnitStatistics : public View { @@ -56,5 +57,6 @@ void printView(llvm::raw_ostream &OS) const override; }; } // namespace mca +} // namespace llvm #endif Index: tools/llvm-mca/Views/RetireControlUnitStatistics.cpp =================================================================== --- tools/llvm-mca/Views/RetireControlUnitStatistics.cpp +++ tools/llvm-mca/Views/RetireControlUnitStatistics.cpp @@ -15,8 +15,7 @@ #include "Views/RetireControlUnitStatistics.h" #include "llvm/Support/Format.h" -using namespace llvm; - +namespace llvm { namespace mca { void RetireControlUnitStatistics::onEvent(const HWInstructionEvent &Event) { @@ -47,3 +46,4 @@ } } // namespace mca +} // namespace llvm Index: tools/llvm-mca/Views/SchedulerStatistics.h =================================================================== --- tools/llvm-mca/Views/SchedulerStatistics.h +++ tools/llvm-mca/Views/SchedulerStatistics.h @@ -42,6 +42,7 @@ #include "llvm/MC/MCSubtargetInfo.h" #include +namespace llvm { namespace mca { class SchedulerStatistics final : public View { @@ -88,5 +89,6 @@ void printView(llvm::raw_ostream &OS) const override; }; } // namespace mca +} // namespace llvm #endif Index: tools/llvm-mca/Views/SchedulerStatistics.cpp =================================================================== --- tools/llvm-mca/Views/SchedulerStatistics.cpp +++ tools/llvm-mca/Views/SchedulerStatistics.cpp @@ -16,8 +16,7 @@ #include "llvm/Support/Format.h" #include "llvm/Support/FormattedStream.h" -using namespace llvm; - +namespace llvm { namespace mca { void SchedulerStatistics::onEvent(const HWInstructionEvent &Event) { @@ -127,3 +126,4 @@ } } // namespace mca +} // namespace llvm Index: tools/llvm-mca/Views/SummaryView.h =================================================================== --- tools/llvm-mca/Views/SummaryView.h +++ tools/llvm-mca/Views/SummaryView.h @@ -35,6 +35,7 @@ #include "llvm/MC/MCSchedule.h" #include "llvm/Support/raw_ostream.h" +namespace llvm { namespace mca { /// A view that collects and prints a few performance numbers. @@ -72,5 +73,6 @@ void printView(llvm::raw_ostream &OS) const override; }; } // namespace mca +} // namespace llvm #endif Index: tools/llvm-mca/Views/SummaryView.cpp =================================================================== --- tools/llvm-mca/Views/SummaryView.cpp +++ tools/llvm-mca/Views/SummaryView.cpp @@ -18,12 +18,11 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Format.h" +namespace llvm { namespace mca { #define DEBUG_TYPE "llvm-mca" -using namespace llvm; - SummaryView::SummaryView(const llvm::MCSchedModel &Model, const SourceMgr &S, unsigned Width) : SM(Model), Source(S), DispatchWidth(Width), TotalCycles(0), @@ -85,3 +84,4 @@ OS << Buffer; } } // namespace mca. +} // namespace llvm Index: tools/llvm-mca/Views/TimelineView.h =================================================================== --- tools/llvm-mca/Views/TimelineView.h +++ tools/llvm-mca/Views/TimelineView.h @@ -107,6 +107,7 @@ #include "llvm/Support/FormattedStream.h" #include "llvm/Support/raw_ostream.h" +namespace llvm { namespace mca { /// This class listens to instruction state transition events @@ -184,5 +185,6 @@ } }; } // namespace mca +} // namespace llvm #endif Index: tools/llvm-mca/Views/TimelineView.cpp =================================================================== --- tools/llvm-mca/Views/TimelineView.cpp +++ tools/llvm-mca/Views/TimelineView.cpp @@ -14,8 +14,7 @@ #include "Views/TimelineView.h" -using namespace llvm; - +namespace llvm { namespace mca { TimelineView::TimelineView(const MCSubtargetInfo &sti, MCInstPrinter &Printer, @@ -288,3 +287,4 @@ } } } // namespace mca +} // namespace llvm Index: tools/llvm-mca/Views/View.h =================================================================== --- tools/llvm-mca/Views/View.h +++ tools/llvm-mca/Views/View.h @@ -19,6 +19,7 @@ #include "HWEventListener.h" #include "llvm/Support/raw_ostream.h" +namespace llvm { namespace mca { class View : public HWEventListener { @@ -28,5 +29,6 @@ void anchor() override; }; } // namespace mca +} // namespace llvm #endif Index: tools/llvm-mca/Views/View.cpp =================================================================== --- tools/llvm-mca/Views/View.cpp +++ tools/llvm-mca/Views/View.cpp @@ -14,7 +14,9 @@ #include "Views/View.h" +namespace llvm { namespace mca { void View::anchor() {} } // namespace mca +} // namespace llvm Index: tools/llvm-mca/include/Context.h =================================================================== --- tools/llvm-mca/include/Context.h +++ tools/llvm-mca/include/Context.h @@ -25,6 +25,7 @@ #include "llvm/MC/MCSubtargetInfo.h" #include +namespace llvm { namespace mca { /// This is a convenience struct to hold the parameters necessary for creating @@ -64,4 +65,5 @@ }; } // namespace mca +} // namespace llvm #endif // LLVM_TOOLS_LLVM_MCA_CONTEXT_H Index: tools/llvm-mca/include/HWEventListener.h =================================================================== --- tools/llvm-mca/include/HWEventListener.h +++ tools/llvm-mca/include/HWEventListener.h @@ -19,6 +19,7 @@ #include "Support.h" #include "llvm/ADT/ArrayRef.h" +namespace llvm { namespace mca { // An HWInstructionEvent represents state changes of instructions that @@ -151,5 +152,6 @@ virtual void anchor(); }; } // namespace mca +} // namespace llvm #endif Index: tools/llvm-mca/include/HardwareUnits/HardwareUnit.h =================================================================== --- tools/llvm-mca/include/HardwareUnits/HardwareUnit.h +++ tools/llvm-mca/include/HardwareUnits/HardwareUnit.h @@ -16,6 +16,7 @@ #ifndef LLVM_TOOLS_LLVM_MCA_HARDWAREUNIT_H #define LLVM_TOOLS_LLVM_MCA_HARDWAREUNIT_H +namespace llvm { namespace mca { class HardwareUnit { @@ -28,4 +29,5 @@ }; } // namespace mca +} // namespace llvm #endif // LLVM_TOOLS_LLVM_MCA_HARDWAREUNIT_H Index: tools/llvm-mca/include/HardwareUnits/LSUnit.h =================================================================== --- tools/llvm-mca/include/HardwareUnits/LSUnit.h +++ tools/llvm-mca/include/HardwareUnits/LSUnit.h @@ -19,6 +19,7 @@ #include "HardwareUnits/HardwareUnit.h" #include +namespace llvm { namespace mca { class InstRef; @@ -156,5 +157,6 @@ }; } // namespace mca +} // namespace llvm #endif Index: tools/llvm-mca/include/HardwareUnits/RegisterFile.h =================================================================== --- tools/llvm-mca/include/HardwareUnits/RegisterFile.h +++ tools/llvm-mca/include/HardwareUnits/RegisterFile.h @@ -24,6 +24,7 @@ #include "llvm/MC/MCSchedule.h" #include "llvm/Support/Error.h" +namespace llvm { namespace mca { class ReadState; @@ -225,5 +226,6 @@ }; } // namespace mca +} // namespace llvm #endif // LLVM_TOOLS_LLVM_MCA_REGISTER_FILE_H Index: tools/llvm-mca/include/HardwareUnits/ResourceManager.h =================================================================== --- tools/llvm-mca/include/HardwareUnits/ResourceManager.h +++ tools/llvm-mca/include/HardwareUnits/ResourceManager.h @@ -23,6 +23,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCSchedule.h" +namespace llvm { namespace mca { /// Used to notify the internal state of a processor resource. @@ -357,5 +358,6 @@ #endif }; } // namespace mca +} // namespace llvm #endif // LLVM_TOOLS_LLVM_MCA_RESOURCE_MANAGER_H Index: tools/llvm-mca/include/HardwareUnits/RetireControlUnit.h =================================================================== --- tools/llvm-mca/include/HardwareUnits/RetireControlUnit.h +++ tools/llvm-mca/include/HardwareUnits/RetireControlUnit.h @@ -20,6 +20,7 @@ #include "llvm/MC/MCSchedule.h" #include +namespace llvm { namespace mca { /// This class tracks which instructions are in-flight (i.e., dispatched but not @@ -98,5 +99,6 @@ }; } // namespace mca +} // namespace llvm #endif // LLVM_TOOLS_LLVM_MCA_RETIRE_CONTROL_UNIT_H Index: tools/llvm-mca/include/HardwareUnits/Scheduler.h =================================================================== --- tools/llvm-mca/include/HardwareUnits/Scheduler.h +++ tools/llvm-mca/include/HardwareUnits/Scheduler.h @@ -22,6 +22,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCSchedule.h" +namespace llvm { namespace mca { class SchedulerStrategy { @@ -209,5 +210,6 @@ #endif // !NDEBUG }; } // namespace mca +} // namespace llvm #endif // LLVM_TOOLS_LLVM_MCA_SCHEDULER_H Index: tools/llvm-mca/include/InstrBuilder.h =================================================================== --- tools/llvm-mca/include/InstrBuilder.h +++ tools/llvm-mca/include/InstrBuilder.h @@ -24,6 +24,7 @@ #include "llvm/MC/MCSubtargetInfo.h" #include "llvm/Support/Error.h" +namespace llvm { namespace mca { /// A builder class that knows how to construct Instruction objects. @@ -86,5 +87,6 @@ createInstruction(const llvm::MCInst &MCI); }; } // namespace mca +} // namespace llvm #endif Index: tools/llvm-mca/include/Instruction.h =================================================================== --- tools/llvm-mca/include/Instruction.h +++ tools/llvm-mca/include/Instruction.h @@ -27,6 +27,7 @@ #include #include +namespace llvm { namespace mca { constexpr int UNKNOWN_CYCLES = -512; @@ -503,5 +504,6 @@ }; } // namespace mca +} // namespace llvm #endif Index: tools/llvm-mca/include/Pipeline.h =================================================================== --- tools/llvm-mca/include/Pipeline.h +++ tools/llvm-mca/include/Pipeline.h @@ -21,6 +21,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Error.h" +namespace llvm { namespace mca { class HWEventListener; @@ -70,5 +71,6 @@ void addEventListener(HWEventListener *Listener); }; } // namespace mca +} // namespace llvm #endif // LLVM_TOOLS_LLVM_MCA_PIPELINE_H Index: tools/llvm-mca/include/SourceMgr.h =================================================================== --- tools/llvm-mca/include/SourceMgr.h +++ tools/llvm-mca/include/SourceMgr.h @@ -19,6 +19,7 @@ #include "llvm/MC/MCInst.h" #include +namespace llvm { namespace mca { typedef std::pair SourceRef; @@ -60,5 +61,6 @@ bool isEmpty() const { return size() == 0; } }; } // namespace mca +} // namespace llvm #endif Index: tools/llvm-mca/include/Stages/DispatchStage.h =================================================================== --- tools/llvm-mca/include/Stages/DispatchStage.h +++ tools/llvm-mca/include/Stages/DispatchStage.h @@ -27,6 +27,7 @@ #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCSubtargetInfo.h" +namespace llvm { namespace mca { // Implements the hardware dispatch logic. @@ -92,5 +93,6 @@ #endif }; } // namespace mca +} // namespace llvm #endif // LLVM_TOOLS_LLVM_MCA_DISPATCH_STAGE_H Index: tools/llvm-mca/include/Stages/ExecuteStage.h =================================================================== --- tools/llvm-mca/include/Stages/ExecuteStage.h +++ tools/llvm-mca/include/Stages/ExecuteStage.h @@ -23,6 +23,7 @@ #include "Stages/Stage.h" #include "llvm/ADT/ArrayRef.h" +namespace llvm { namespace mca { class ExecuteStage final : public Stage { @@ -74,5 +75,6 @@ }; } // namespace mca +} // namespace llvm #endif // LLVM_TOOLS_LLVM_MCA_EXECUTE_STAGE_H Index: tools/llvm-mca/include/Stages/FetchStage.h =================================================================== --- tools/llvm-mca/include/Stages/FetchStage.h +++ tools/llvm-mca/include/Stages/FetchStage.h @@ -21,6 +21,7 @@ #include "Stages/Stage.h" #include +namespace llvm { namespace mca { class FetchStage final : public Stage { @@ -48,5 +49,6 @@ }; } // namespace mca +} // namespace llvm #endif // LLVM_TOOLS_LLVM_MCA_FETCH_STAGE_H Index: tools/llvm-mca/include/Stages/InstructionTables.h =================================================================== --- tools/llvm-mca/include/Stages/InstructionTables.h +++ tools/llvm-mca/include/Stages/InstructionTables.h @@ -23,6 +23,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCSchedule.h" +namespace llvm { namespace mca { class InstructionTables final : public Stage { @@ -38,5 +39,6 @@ llvm::Error execute(InstRef &IR) override; }; } // namespace mca +} // namespace llvm #endif Index: tools/llvm-mca/include/Stages/RetireStage.h =================================================================== --- tools/llvm-mca/include/Stages/RetireStage.h +++ tools/llvm-mca/include/Stages/RetireStage.h @@ -21,6 +21,7 @@ #include "HardwareUnits/RetireControlUnit.h" #include "Stages/Stage.h" +namespace llvm { namespace mca { class RetireStage final : public Stage { @@ -42,5 +43,6 @@ }; } // namespace mca +} // namespace llvm #endif // LLVM_TOOLS_LLVM_MCA_RETIRE_STAGE_H Index: tools/llvm-mca/include/Stages/Stage.h =================================================================== --- tools/llvm-mca/include/Stages/Stage.h +++ tools/llvm-mca/include/Stages/Stage.h @@ -20,6 +20,7 @@ #include "llvm/Support/Error.h" #include +namespace llvm { namespace mca { class InstRef; @@ -83,4 +84,5 @@ }; } // namespace mca +} // namespace llvm #endif // LLVM_TOOLS_LLVM_MCA_STAGE_H Index: tools/llvm-mca/include/Support.h =================================================================== --- tools/llvm-mca/include/Support.h +++ tools/llvm-mca/include/Support.h @@ -19,6 +19,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCSchedule.h" +namespace llvm { namespace mca { /// This class represents the number of cycles per resource (fractions of @@ -94,5 +95,6 @@ unsigned DispatchWidth, unsigned NumMicroOps, llvm::ArrayRef ProcResourceUsage); } // namespace mca +} // namespace llvm #endif Index: tools/llvm-mca/lib/Context.cpp =================================================================== --- tools/llvm-mca/lib/Context.cpp +++ tools/llvm-mca/lib/Context.cpp @@ -24,10 +24,9 @@ #include "Stages/FetchStage.h" #include "Stages/RetireStage.h" +namespace llvm { namespace mca { -using namespace llvm; - std::unique_ptr Context::createDefaultPipeline(const PipelineOptions &Opts, InstrBuilder &IB, SourceMgr &SrcMgr) { @@ -63,3 +62,4 @@ } } // namespace mca +} // namespace llvm Index: tools/llvm-mca/lib/HWEventListener.cpp =================================================================== --- tools/llvm-mca/lib/HWEventListener.cpp +++ tools/llvm-mca/lib/HWEventListener.cpp @@ -14,8 +14,10 @@ #include "HWEventListener.h" +namespace llvm { namespace mca { // Anchor the vtable here. void HWEventListener::anchor() {} } // namespace mca +} // namespace llvm Index: tools/llvm-mca/lib/HardwareUnits/HardwareUnit.cpp =================================================================== --- tools/llvm-mca/lib/HardwareUnits/HardwareUnit.cpp +++ tools/llvm-mca/lib/HardwareUnits/HardwareUnit.cpp @@ -15,9 +15,11 @@ #include "HardwareUnits/HardwareUnit.h" +namespace llvm { namespace mca { // Pin the vtable with this method. HardwareUnit::~HardwareUnit() = default; } // namespace mca +} // namespace llvm Index: tools/llvm-mca/lib/HardwareUnits/LSUnit.cpp =================================================================== --- tools/llvm-mca/lib/HardwareUnits/LSUnit.cpp +++ tools/llvm-mca/lib/HardwareUnits/LSUnit.cpp @@ -17,10 +17,9 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" -using namespace llvm; - #define DEBUG_TYPE "llvm-mca" +namespace llvm { namespace mca { #ifndef NDEBUG @@ -164,3 +163,4 @@ } } } // namespace mca +} // namespace llvm Index: tools/llvm-mca/lib/HardwareUnits/RegisterFile.cpp =================================================================== --- tools/llvm-mca/lib/HardwareUnits/RegisterFile.cpp +++ tools/llvm-mca/lib/HardwareUnits/RegisterFile.cpp @@ -18,10 +18,9 @@ #include "Instruction.h" #include "llvm/Support/Debug.h" -using namespace llvm; - #define DEBUG_TYPE "llvm-mca" +namespace llvm { namespace mca { RegisterFile::RegisterFile(const MCSchedModel &SM, const MCRegisterInfo &mri, @@ -469,3 +468,4 @@ #endif } // namespace mca +} // namespace llvm Index: tools/llvm-mca/lib/HardwareUnits/ResourceManager.cpp =================================================================== --- tools/llvm-mca/lib/HardwareUnits/ResourceManager.cpp +++ tools/llvm-mca/lib/HardwareUnits/ResourceManager.cpp @@ -18,10 +18,9 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" +namespace llvm { namespace mca { -using namespace llvm; - #define DEBUG_TYPE "llvm-mca" ResourceStrategy::~ResourceStrategy() = default; @@ -307,3 +306,4 @@ } } // namespace mca +} // namespace llvm Index: tools/llvm-mca/lib/HardwareUnits/RetireControlUnit.cpp =================================================================== --- tools/llvm-mca/lib/HardwareUnits/RetireControlUnit.cpp +++ tools/llvm-mca/lib/HardwareUnits/RetireControlUnit.cpp @@ -15,10 +15,9 @@ #include "HardwareUnits/RetireControlUnit.h" #include "llvm/Support/Debug.h" -using namespace llvm; - #define DEBUG_TYPE "llvm-mca" +namespace llvm { namespace mca { RetireControlUnit::RetireControlUnit(const MCSchedModel &SM) @@ -85,3 +84,4 @@ #endif } // namespace mca +} // namespace llvm Index: tools/llvm-mca/lib/HardwareUnits/Scheduler.cpp =================================================================== --- tools/llvm-mca/lib/HardwareUnits/Scheduler.cpp +++ tools/llvm-mca/lib/HardwareUnits/Scheduler.cpp @@ -15,10 +15,9 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" +namespace llvm { namespace mca { -using namespace llvm; - #define DEBUG_TYPE "llvm-mca" void Scheduler::initializeStrategy(std::unique_ptr S) { @@ -243,3 +242,4 @@ } } // namespace mca +} // namespace llvm Index: tools/llvm-mca/lib/InstrBuilder.cpp =================================================================== --- tools/llvm-mca/lib/InstrBuilder.cpp +++ tools/llvm-mca/lib/InstrBuilder.cpp @@ -22,10 +22,9 @@ #define DEBUG_TYPE "llvm-mca" +namespace llvm { namespace mca { -using namespace llvm; - static void initializeUsedResources(InstrDesc &ID, const MCSchedClassDesc &SCDesc, const MCSubtargetInfo &STI, @@ -544,3 +543,4 @@ return std::move(NewIS); } } // namespace mca +} // namespace llvm Index: tools/llvm-mca/lib/Instruction.cpp =================================================================== --- tools/llvm-mca/lib/Instruction.cpp +++ tools/llvm-mca/lib/Instruction.cpp @@ -16,10 +16,9 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" +namespace llvm { namespace mca { -using namespace llvm; - void ReadState::writeStartEvent(unsigned Cycles) { assert(DependentWrites); assert(CyclesLeft == UNKNOWN_CYCLES); @@ -181,3 +180,4 @@ const unsigned WriteRef::INVALID_IID = std::numeric_limits::max(); } // namespace mca +} // namespace llvm Index: tools/llvm-mca/lib/Pipeline.cpp =================================================================== --- tools/llvm-mca/lib/Pipeline.cpp +++ tools/llvm-mca/lib/Pipeline.cpp @@ -17,12 +17,11 @@ #include "HWEventListener.h" #include "llvm/Support/Debug.h" +namespace llvm { namespace mca { #define DEBUG_TYPE "llvm-mca" -using namespace llvm; - void Pipeline::addEventListener(HWEventListener *Listener) { if (Listener) Listeners.insert(Listener); @@ -94,3 +93,4 @@ Listener->onCycleEnd(); } } // namespace mca. +} // namespace llvm Index: tools/llvm-mca/lib/Stages/DispatchStage.cpp =================================================================== --- tools/llvm-mca/lib/Stages/DispatchStage.cpp +++ tools/llvm-mca/lib/Stages/DispatchStage.cpp @@ -21,10 +21,9 @@ #include "HardwareUnits/Scheduler.h" #include "llvm/Support/Debug.h" -using namespace llvm; - #define DEBUG_TYPE "llvm-mca" +namespace llvm { namespace mca { void DispatchStage::notifyInstructionDispatched(const InstRef &IR, @@ -186,3 +185,4 @@ } #endif } // namespace mca +} // namespace llvm Index: tools/llvm-mca/lib/Stages/ExecuteStage.cpp =================================================================== --- tools/llvm-mca/lib/Stages/ExecuteStage.cpp +++ tools/llvm-mca/lib/Stages/ExecuteStage.cpp @@ -21,10 +21,9 @@ #define DEBUG_TYPE "llvm-mca" +namespace llvm { namespace mca { -using namespace llvm; - HWStallEvent::GenericEventType toHWStallEventType(Scheduler::Status Status) { switch (Status) { case Scheduler::SC_LOAD_QUEUE_FULL: @@ -219,3 +218,4 @@ } } // namespace mca +} // namespace llvm Index: tools/llvm-mca/lib/Stages/FetchStage.cpp =================================================================== --- tools/llvm-mca/lib/Stages/FetchStage.cpp +++ tools/llvm-mca/lib/Stages/FetchStage.cpp @@ -15,6 +15,7 @@ #include "Stages/FetchStage.h" +namespace llvm { namespace mca { bool FetchStage::hasWorkToComplete() const { @@ -80,3 +81,4 @@ } } // namespace mca +} // namespace llvm Index: tools/llvm-mca/lib/Stages/InstructionTables.cpp =================================================================== --- tools/llvm-mca/lib/Stages/InstructionTables.cpp +++ tools/llvm-mca/lib/Stages/InstructionTables.cpp @@ -17,10 +17,9 @@ #include "Stages/InstructionTables.h" +namespace llvm { namespace mca { -using namespace llvm; - Error InstructionTables::execute(InstRef &IR) { ArrayRef Masks = IB.getProcResourceMasks(); const InstrDesc &Desc = IR.getInstruction()->getDesc(); @@ -68,3 +67,4 @@ } } // namespace mca +} // namespace llvm Index: tools/llvm-mca/lib/Stages/RetireStage.cpp =================================================================== --- tools/llvm-mca/lib/Stages/RetireStage.cpp +++ tools/llvm-mca/lib/Stages/RetireStage.cpp @@ -20,6 +20,7 @@ #define DEBUG_TYPE "llvm-mca" +namespace llvm { namespace mca { llvm::Error RetireStage::cycleStart() { @@ -58,3 +59,4 @@ } } // namespace mca +} // namespace llvm Index: tools/llvm-mca/lib/Stages/Stage.cpp =================================================================== --- tools/llvm-mca/lib/Stages/Stage.cpp +++ tools/llvm-mca/lib/Stages/Stage.cpp @@ -15,6 +15,7 @@ #include "Stages/Stage.h" +namespace llvm { namespace mca { // Pin the vtable here in the implementation file. @@ -25,3 +26,4 @@ } } // namespace mca +} // namespace llvm Index: tools/llvm-mca/lib/Support.cpp =================================================================== --- tools/llvm-mca/lib/Support.cpp +++ tools/llvm-mca/lib/Support.cpp @@ -16,10 +16,9 @@ #include "Support.h" #include "llvm/MC/MCSchedule.h" +namespace llvm { namespace mca { -using namespace llvm; - void computeProcResourceMasks(const MCSchedModel &SM, SmallVectorImpl &Masks) { unsigned ProcResourceID = 0; @@ -77,3 +76,4 @@ } } // namespace mca +} // namespace llvm