Round 2 of dead private variable removal.
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 6 Jun 2012 19:47:08 +0000 (19:47 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 6 Jun 2012 19:47:08 +0000 (19:47 +0000)
LLVM is now -Wunused-private-field clean except for
- lib/MC/MCDisassembler/Disassembler.h. Not sure why it keeps all those unaccessible fields.
- gtest.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158096 91177308-0d34-0410-b5e6-96231b3b80d8

18 files changed:
include/llvm/Analysis/ProfileInfoLoader.h
lib/Analysis/ProfileInfoLoader.cpp
lib/Analysis/ProfileInfoLoaderPass.cpp
lib/CodeGen/InlineSpiller.cpp
lib/CodeGen/RegAllocGreedy.cpp
lib/ExecutionEngine/MCJIT/MCJIT.cpp
lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
lib/Target/CellSPU/SPUHazardRecognizers.cpp
lib/Target/CellSPU/SPUHazardRecognizers.h
lib/Target/CellSPU/SPUISelLowering.h
lib/Target/NVPTX/NVPTXRegisterInfo.cpp
lib/Target/NVPTX/NVPTXRegisterInfo.h
lib/Target/Sparc/SparcFrameLowering.h
lib/Target/XCore/XCoreFrameLowering.cpp
lib/Target/XCore/XCoreFrameLowering.h
tools/llvm-prof/llvm-prof.cpp
unittests/Support/TypeBuilderTest.cpp
utils/TableGen/DAGISelEmitter.h

index 9e0c393c428fbc873bc2e8991557bb9881abe172..4539757b7860f67e9198bd6756fcc3402870690b 100644 (file)
@@ -28,7 +28,6 @@ class BasicBlock;
 
 class ProfileInfoLoader {
   const std::string &Filename;
-  Module &M;
   std::vector<std::string> CommandLines;
   std::vector<unsigned>    FunctionCounts;
   std::vector<unsigned>    BlockCounts;
@@ -39,8 +38,7 @@ class ProfileInfoLoader {
 public:
   // ProfileInfoLoader ctor - Read the specified profiling data file, exiting
   // the program if the file is invalid or broken.
-  ProfileInfoLoader(const char *ToolName, const std::string &Filename,
-                    Module &M);
+  ProfileInfoLoader(const char *ToolName, const std::string &Filename);
 
   static const unsigned Uncounted;
 
index eaa38dad16a1c918e041a201bd1ecf1543ebc029..027116e7ed2f9c4784c874f23bfd650d366ae30f 100644 (file)
@@ -83,10 +83,8 @@ const unsigned ProfileInfoLoader::Uncounted = ~0U;
 // program if the file is invalid or broken.
 //
 ProfileInfoLoader::ProfileInfoLoader(const char *ToolName,
-                                     const std::string &Filename,
-                                     Module &TheModule) :
-                                     Filename(Filename), 
-                                     M(TheModule), Warned(false) {
+                                     const std::string &Filename)
+  : Filename(Filename), Warned(false) {
   FILE *F = fopen(Filename.c_str(), "rb");
   if (F == 0) {
     errs() << ToolName << ": Error opening '" << Filename << "': ";
index c4da8079a511be59d6194a0d42d87e0df65222ec..5ecf052a1a24b72701dab0ce287a97ccce096589 100644 (file)
@@ -152,7 +152,7 @@ void LoaderPass::readEdge(ProfileInfo::Edge e,
 }
 
 bool LoaderPass::runOnModule(Module &M) {
-  ProfileInfoLoader PIL("profile-loader", Filename, M);
+  ProfileInfoLoader PIL("profile-loader", Filename);
 
   EdgeInformation.clear();
   std::vector<unsigned> Counters = PIL.getRawEdgeCounts();
index c1d9d2757ab706a70cfc72674b8c17a61b7450d0..9833097c8dd93e5ed61f9e5a8af656bdc802153f 100644 (file)
@@ -52,7 +52,6 @@ static cl::opt<bool> DisableHoisting("disable-spill-hoist", cl::Hidden,
 
 namespace {
 class InlineSpiller : public Spiller {
-  MachineFunctionPass &Pass;
   MachineFunction &MF;
   LiveIntervals &LIS;
   LiveStacks &LSS;
@@ -137,8 +136,7 @@ public:
   InlineSpiller(MachineFunctionPass &pass,
                 MachineFunction &mf,
                 VirtRegMap &vrm)
-    : Pass(pass),
-      MF(mf),
+    : MF(mf),
       LIS(pass.getAnalysis<LiveIntervals>()),
       LSS(pass.getAnalysis<LiveStacks>()),
       AA(&pass.getAnalysis<AliasAnalysis>()),
index bb00603f4d0f06ff0ca300080c2d873e2b9f7738..f4f1bf2bf02a0eec32e095c800343f14ff23e91e 100644 (file)
@@ -73,7 +73,6 @@ class RAGreedy : public MachineFunctionPass,
 
   // analyses
   SlotIndexes *Indexes;
-  LiveStacks *LS;
   MachineDominatorTree *DomTree;
   MachineLoopInfo *Loops;
   EdgeBundles *Bundles;
index 7d2fabb3f1f47ce6bf54a72aa0fc448733654e11..84274c071c8ad4a8e8e665cc043b239a003f04ae 100644 (file)
@@ -45,7 +45,7 @@ ExecutionEngine *MCJIT::createJIT(Module *M,
 
   // If the target supports JIT code generation, create the JIT.
   if (TargetJITInfo *TJ = TM->getJITInfo())
-    return new MCJIT(M, TM, *TJ, new MCJITMemoryManager(JMM, M), GVsWithCode);
+    return new MCJIT(M, TM, *TJ, new MCJITMemoryManager(JMM), GVsWithCode);
 
   if (ErrorStr)
     *ErrorStr = "target does not support JIT code generation";
index 084f9a8eadea5e9786883a5eb281955efb1f28cb..441aaeb5ecac3d5a928eb597736d4d039772e3bf 100644 (file)
@@ -22,15 +22,11 @@ namespace llvm {
 // matching LLVM IR counterparts in the module(s) being compiled.
 class MCJITMemoryManager : public RTDyldMemoryManager {
   virtual void anchor();
-  JITMemoryManager *JMM;
+  OwningPtr<JITMemoryManager> JMM;
 
-  // FIXME: Multiple modules.
-  Module *M;
 public:
-  MCJITMemoryManager(JITMemoryManager *jmm, Module *m) :
-    JMM(jmm?jmm:JITMemoryManager::CreateDefaultMemManager()), M(m) {}
-  // We own the JMM, so make sure to delete it.
-  ~MCJITMemoryManager() { delete JMM; }
+  MCJITMemoryManager(JITMemoryManager *jmm) :
+    JMM(jmm?jmm:JITMemoryManager::CreateDefaultMemManager()) {}
 
   uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
                                unsigned SectionID) {
index 403d7ef1fd9ef4fc6b4ab57b544a8f27b05a2df0..67a83f16a649955a11cf9bde4d64afd60787c0c8 100644 (file)
@@ -30,12 +30,6 @@ using namespace llvm;
 // very little right now.
 //===----------------------------------------------------------------------===//
 
-SPUHazardRecognizer::SPUHazardRecognizer(const TargetInstrInfo &tii) :
-  TII(tii),
-  EvenOdd(0)
-{
-}
-
 /// Return the pipeline hazard type encountered or generated by this
 /// instruction. Currently returns NoHazard.
 ///
index 675632cc7f13e4803df64394dd82cae23d6e385b..30acaeaa36fb0d3ed60188e1405b8f82fca9c3d3 100644 (file)
@@ -24,12 +24,8 @@ class TargetInstrInfo;
 /// SPUHazardRecognizer
 class SPUHazardRecognizer : public ScheduleHazardRecognizer
 {
-private:
-  const TargetInstrInfo &TII;
-  int EvenOdd;
-
 public:
-  SPUHazardRecognizer(const TargetInstrInfo &TII);
+  SPUHazardRecognizer(const TargetInstrInfo &/*TII*/) {}
   virtual HazardType getHazardType(SUnit *SU, int Stalls);
   virtual void EmitInstruction(SUnit *SU);
   virtual void AdvanceCycle();
index e7d0976ca58e17798c4c3a7cdbf3b3ec7d1716a5..9f1599fa6fed39f689963a287b678ff97beb3f8a 100644 (file)
@@ -86,7 +86,6 @@ namespace llvm {
   class SPUTargetLowering :
     public TargetLowering
   {
-    int VarArgsFrameIndex;            // FrameIndex for start of varargs area.
     SPUTargetMachine &SPUTM;
 
   public:
index 99b40a86f4b594472c49ba360500a3c26addbc1c..e3cd46f063bfcc0c6134c13bdfbf04084ea4c76c 100644 (file)
@@ -250,12 +250,8 @@ int getNVPTXVectorSize(TargetRegisterClass const *RC) {
 
 NVPTXRegisterInfo::NVPTXRegisterInfo(const TargetInstrInfo &tii,
                                      const NVPTXSubtarget &st)
-: NVPTXGenRegisterInfo(0),
-  TII(tii),
-  ST(st) {
-  Is64Bit = st.is64Bit();
-}
-
+  : NVPTXGenRegisterInfo(0),
+    Is64Bit(st.is64Bit()) {}
 
 #define GET_REGINFO_TARGET_DESC
 #include "NVPTXGenRegisterInfo.inc"
index e8b587ce16eab834197b5d713ad775710e1a1652..595178335ae25be0d17dda16433c81f61caeda67 100644 (file)
@@ -31,8 +31,6 @@ class NVPTXSubtarget;
 
 class NVPTXRegisterInfo : public NVPTXGenRegisterInfo {
 private:
-  const TargetInstrInfo &TII;
-  const NVPTXSubtarget &ST;
   bool Is64Bit;
   // Hold Strings that can be free'd all together with NVPTXRegisterInfo
   ManagedStringPool     ManagedStrPool;
index 210705e2d47a72a41654eb2bebca7222405b6d37..6b593c95bb10e89fa9128a436cdaae6948f4252c 100644 (file)
@@ -22,10 +22,9 @@ namespace llvm {
   class SparcSubtarget;
 
 class SparcFrameLowering : public TargetFrameLowering {
-  const SparcSubtarget &STI;
 public:
-  explicit SparcFrameLowering(const SparcSubtarget &sti)
-    : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 8, 0), STI(sti) {
+  explicit SparcFrameLowering(const SparcSubtarget &/*sti*/)
+    : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 8, 0) {
   }
 
   /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
index 1e82abf381d0c0ee4ad8a1ded101b9d9d428bf2a..3dbc3b9ee548a6a1179e2c9579229462acf4a6dc 100644 (file)
@@ -78,8 +78,7 @@ static void storeToStack(MachineBasicBlock &MBB,
 //===----------------------------------------------------------------------===//
 
 XCoreFrameLowering::XCoreFrameLowering(const XCoreSubtarget &sti)
-  : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 4, 0),
-    STI(sti) {
+  : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 4, 0) {
   // Do nothing
 }
 
index 4c51aa5e79ccc9e132eb6cf5951cc9564adb1a7f..afa2773180f2b81764a3c2eb2b75c37578f980ff 100644 (file)
@@ -22,7 +22,6 @@ namespace llvm {
   class XCoreSubtarget;
 
   class XCoreFrameLowering: public TargetFrameLowering {
-    const XCoreSubtarget &STI;
   public:
     XCoreFrameLowering(const XCoreSubtarget &STI);
 
index d9b671336407e96e2f4f95f936711a3b0ac57738..81e9503abe25b93b511549bc1cab5594a099772c 100644 (file)
@@ -281,7 +281,7 @@ int main(int argc, char **argv) {
   // using the standard profile info provider pass, but for now this gives us
   // access to additional information not exposed via the ProfileInfo
   // interface.
-  ProfileInfoLoader PIL(argv[0], ProfileDataFile, *M);
+  ProfileInfoLoader PIL(argv[0], ProfileDataFile);
 
   // Run the printer pass.
   PassManager PassMgr;
index 20d0e739147d6baac7aa8a7ddc62907b2d05d043..1d3225726e995a681d8903e73246a0d84a3c9bac 100644 (file)
@@ -167,13 +167,13 @@ TEST(TypeBuilderTest, Context) {
             &(TypeBuilder<types::i<1>, true>::get(context2))->getContext());
 }
 
-class MyType {
+struct MyType {
   int a;
   int *b;
   void *array[1];
 };
 
-class MyPortableType {
+struct MyPortableType {
   int32_t a;
   int32_t *b;
   void *array[1];
index 9c9fe4273fedfdb1ffdfd472f09d240397dd0bef..5204bb135dccf2d2d7f0c8aeeb6ca04f34e178d1 100644 (file)
@@ -23,10 +23,9 @@ namespace llvm {
 /// and emission of the instruction selector.
 ///
 class DAGISelEmitter : public TableGenBackend {
-  RecordKeeper &Records;
   CodeGenDAGPatterns CGP;
 public:
-  explicit DAGISelEmitter(RecordKeeper &R) : Records(R), CGP(R) {}
+  explicit DAGISelEmitter(RecordKeeper &R) : CGP(R) {}
 
   // run - Output the isel, returning true on failure.
   void run(raw_ostream &OS);