R600: Hide symbols of implementation details.
Also removes an unused function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182587 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/R600/AMDILCFGStructurizer.cpp b/lib/Target/R600/AMDILCFGStructurizer.cpp
index b0cd0f9..fcb5b7e 100644
--- a/lib/Target/R600/AMDILCFGStructurizer.cpp
+++ b/lib/Target/R600/AMDILCFGStructurizer.cpp
@@ -57,7 +57,7 @@
// Miscellaneous utility for CFGStructurizer.
//
//===----------------------------------------------------------------------===//
-namespace llvmCFGStruct {
+namespace {
#define SHOWNEWINSTR(i) \
if (DEBUGME) errs() << "New instr: " << *i << "\n"
@@ -98,7 +98,7 @@
}
}
-} //end namespace llvmCFGStruct
+} // end anonymous namespace
//===----------------------------------------------------------------------===//
//
@@ -106,7 +106,7 @@
//
//===----------------------------------------------------------------------===//
-namespace llvmCFGStruct {
+namespace {
template<class PassT>
struct CFGStructTraits {
};
@@ -142,7 +142,7 @@
LandInformation() : landBlk(NULL) {}
};
-} //end of namespace llvmCFGStruct
+} // end anonymous namespace
//===----------------------------------------------------------------------===//
//
@@ -150,7 +150,7 @@
//
//===----------------------------------------------------------------------===//
-namespace llvmCFGStruct {
+namespace {
// bixia TODO: port it to BasicBlock, not just MachineBasicBlock.
template<class PassT>
class CFGStructurizer {
@@ -2446,7 +2446,7 @@
return commonDom;
} //findNearestCommonPostDom
-} //end namespace llvm
+} // end anonymous namespace
//todo: move-end
@@ -2458,9 +2458,7 @@
//===----------------------------------------------------------------------===//
-using namespace llvmCFGStruct;
-
-namespace llvm {
+namespace {
class AMDGPUCFGStructurizer : public MachineFunctionPass {
public:
typedef MachineInstr InstructionType;
@@ -2480,12 +2478,9 @@
public:
AMDGPUCFGStructurizer(char &pid, TargetMachine &tm);
const TargetInstrInfo *getTargetInstrInfo() const;
-
-private:
-
};
-} //end of namespace llvm
+} // end anonymous namespace
AMDGPUCFGStructurizer::AMDGPUCFGStructurizer(char &pid, TargetMachine &tm)
: MachineFunctionPass(pid), TM(tm), TII(tm.getInstrInfo()),
TRI(static_cast<const AMDGPURegisterInfo *>(tm.getRegisterInfo())) {
@@ -2501,9 +2496,7 @@
//===----------------------------------------------------------------------===//
-using namespace llvmCFGStruct;
-
-namespace llvm {
+namespace {
class AMDGPUCFGPrepare : public AMDGPUCFGStructurizer {
public:
static char ID;
@@ -2515,13 +2508,10 @@
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
bool runOnMachineFunction(MachineFunction &F);
-
-private:
-
};
char AMDGPUCFGPrepare::ID = 0;
-} //end of namespace llvm
+} // end anonymous namespace
AMDGPUCFGPrepare::AMDGPUCFGPrepare(TargetMachine &tm)
: AMDGPUCFGStructurizer(ID, tm ) {
@@ -2545,9 +2535,7 @@
//===----------------------------------------------------------------------===//
-using namespace llvmCFGStruct;
-
-namespace llvm {
+namespace {
class AMDGPUCFGPerform : public AMDGPUCFGStructurizer {
public:
static char ID;
@@ -2557,13 +2545,10 @@
virtual const char *getPassName() const;
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
bool runOnMachineFunction(MachineFunction &F);
-
-private:
-
};
char AMDGPUCFGPerform::ID = 0;
-} //end of namespace llvm
+} // end anonymous namespace
AMDGPUCFGPerform::AMDGPUCFGPerform(TargetMachine &tm)
: AMDGPUCFGStructurizer(ID, tm) {
@@ -2587,7 +2572,7 @@
//
//===----------------------------------------------------------------------===//
-namespace llvmCFGStruct {
+namespace {
// this class is tailor to the AMDGPU backend
template<>
struct CFGStructTraits<AMDGPUCFGStructurizer> {
@@ -3024,28 +3009,22 @@
return &pass.getAnalysis<MachineLoopInfo>();
}
}; // template class CFGStructTraits
-} //end of namespace llvm
+} // end anonymous namespace
// createAMDGPUCFGPreparationPass- Returns a pass
-FunctionPass *llvm::createAMDGPUCFGPreparationPass(TargetMachine &tm
- ) {
- return new AMDGPUCFGPrepare(tm );
+FunctionPass *llvm::createAMDGPUCFGPreparationPass(TargetMachine &tm) {
+ return new AMDGPUCFGPrepare(tm);
}
bool AMDGPUCFGPrepare::runOnMachineFunction(MachineFunction &func) {
- return llvmCFGStruct::CFGStructurizer<AMDGPUCFGStructurizer>().prepare(func,
- *this,
- TRI);
+ return CFGStructurizer<AMDGPUCFGStructurizer>().prepare(func, *this, TRI);
}
// createAMDGPUCFGStructurizerPass- Returns a pass
-FunctionPass *llvm::createAMDGPUCFGStructurizerPass(TargetMachine &tm
- ) {
- return new AMDGPUCFGPerform(tm );
+FunctionPass *llvm::createAMDGPUCFGStructurizerPass(TargetMachine &tm) {
+ return new AMDGPUCFGPerform(tm);
}
bool AMDGPUCFGPerform::runOnMachineFunction(MachineFunction &func) {
- return llvmCFGStruct::CFGStructurizer<AMDGPUCFGStructurizer>().run(func,
- *this,
- TRI);
+ return CFGStructurizer<AMDGPUCFGStructurizer>().run(func, *this, TRI);
}