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/AMDGPUInstrInfo.cpp b/lib/Target/R600/AMDGPUInstrInfo.cpp
index 30f736c..45d886d 100644
--- a/lib/Target/R600/AMDGPUInstrInfo.cpp
+++ b/lib/Target/R600/AMDGPUInstrInfo.cpp
@@ -99,27 +99,6 @@
return false;
}
-MachineBasicBlock::iterator skipFlowControl(MachineBasicBlock *MBB) {
- MachineBasicBlock::iterator tmp = MBB->end();
- if (!MBB->size()) {
- return MBB->end();
- }
- while (--tmp) {
- if (tmp->getOpcode() == AMDGPU::ENDLOOP
- || tmp->getOpcode() == AMDGPU::ENDIF
- || tmp->getOpcode() == AMDGPU::ELSE) {
- if (tmp == MBB->begin()) {
- return tmp;
- } else {
- continue;
- }
- } else {
- return ++tmp;
- }
- }
- return MBB->end();
-}
-
void
AMDGPUInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI,
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);
}
diff --git a/lib/Target/R600/MCTargetDesc/AMDGPUAsmBackend.cpp b/lib/Target/R600/MCTargetDesc/AMDGPUAsmBackend.cpp
index a3397f3..9a36903 100644
--- a/lib/Target/R600/MCTargetDesc/AMDGPUAsmBackend.cpp
+++ b/lib/Target/R600/MCTargetDesc/AMDGPUAsmBackend.cpp
@@ -82,6 +82,8 @@
// ELFAMDGPUAsmBackend class
//===----------------------------------------------------------------------===//
+namespace {
+
class ELFAMDGPUAsmBackend : public AMDGPUAsmBackend {
public:
ELFAMDGPUAsmBackend(const Target &T) : AMDGPUAsmBackend(T) { }
@@ -91,6 +93,8 @@
}
};
+} // end anonymous namespace
+
MCAsmBackend *llvm::createAMDGPUAsmBackend(const Target &T, StringRef TT,
StringRef CPU) {
return new ELFAMDGPUAsmBackend(T);
diff --git a/lib/Target/R600/SIISelLowering.cpp b/lib/Target/R600/SIISelLowering.cpp
index fb06889..383f881 100644
--- a/lib/Target/R600/SIISelLowering.cpp
+++ b/lib/Target/R600/SIISelLowering.cpp
@@ -706,7 +706,7 @@
}
/// \brief Helper function for adjustWritemask
-unsigned SubIdx2Lane(unsigned Idx) {
+static unsigned SubIdx2Lane(unsigned Idx) {
switch (Idx) {
default: return 0;
case AMDGPU::sub0: return 0;