[llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp EdgeProfiling.cpp EmitFunctions.cpp RSProfiling.cpp TraceBasicBlocks.cpp

Reid Spencer reid at x10sys.com
Mon Feb 5 15:32:29 PST 2007



Changes in directory llvm/lib/Transforms/Instrumentation:

BlockProfiling.cpp updated: 1.21 -> 1.22
EdgeProfiling.cpp updated: 1.11 -> 1.12
EmitFunctions.cpp updated: 1.28 -> 1.29
RSProfiling.cpp updated: 1.18 -> 1.19
TraceBasicBlocks.cpp updated: 1.22 -> 1.23
---
Log message:

Apply the VISIBILITY_HIDDEN field to the remaining anonymous classes in
the Transforms library. This reduces debug library size by 132 KB, debug
binary size by 376 KB, and reduces link time for llvm tools slightly.


---
Diffs of the changes:  (+15 -10)

 BlockProfiling.cpp   |    3 ++-
 EdgeProfiling.cpp    |    3 ++-
 EmitFunctions.cpp    |    3 ++-
 RSProfiling.cpp      |   13 +++++++------
 TraceBasicBlocks.cpp |    3 ++-
 5 files changed, 15 insertions(+), 10 deletions(-)


Index: llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp
diff -u llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.21 llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.22
--- llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.21	Mon Feb  5 15:19:13 2007
+++ llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp	Mon Feb  5 17:32:05 2007
@@ -23,6 +23,7 @@
 #include "llvm/DerivedTypes.h"
 #include "llvm/Module.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Streams.h"
 #include "llvm/Transforms/Instrumentation.h"
 #include "RSProfiling.h"
@@ -30,7 +31,7 @@
 using namespace llvm;
 
 namespace {
-  class FunctionProfiler : public RSProfilers_std {
+  class VISIBILITY_HIDDEN FunctionProfiler : public RSProfilers_std {
     bool runOnModule(Module &M);
   };
 


Index: llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp
diff -u llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp:1.11 llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp:1.12
--- llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp:1.11	Mon Feb  5 15:19:13 2007
+++ llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp	Mon Feb  5 17:32:05 2007
@@ -22,6 +22,7 @@
 #include "llvm/DerivedTypes.h"
 #include "llvm/Module.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Streams.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #include "llvm/Transforms/Instrumentation.h"
@@ -29,7 +30,7 @@
 using namespace llvm;
 
 namespace {
-  class EdgeProfiler : public ModulePass {
+  class VISIBILITY_HIDDEN EdgeProfiler : public ModulePass {
     bool runOnModule(Module &M);
   };
 


Index: llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp
diff -u llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp:1.28 llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp:1.29
--- llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp:1.28	Tue Jan 30 14:08:38 2007
+++ llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp	Mon Feb  5 17:32:05 2007
@@ -24,6 +24,7 @@
 #include "llvm/Module.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/CFG.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Transforms/Instrumentation.h"
 using namespace llvm;
 
@@ -36,7 +37,7 @@
     BLACK
   };
 
-  struct EmitFunctionTable : public ModulePass {
+  struct VISIBILITY_HIDDEN EmitFunctionTable : public ModulePass {
     bool runOnModule(Module &M);
   };
 


Index: llvm/lib/Transforms/Instrumentation/RSProfiling.cpp
diff -u llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.18 llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.19
--- llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.18	Tue Jan 30 14:08:38 2007
+++ llvm/lib/Transforms/Instrumentation/RSProfiling.cpp	Mon Feb  5 17:32:05 2007
@@ -40,6 +40,7 @@
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Transforms/Instrumentation.h"
 #include "RSProfiling.h"
@@ -66,7 +67,7 @@
   /// NullProfilerRS - The basic profiler that does nothing.  It is the default
   /// profiler and thus terminates RSProfiler chains.  It is useful for 
   /// measuring framework overhead
-  class NullProfilerRS : public RSProfilers {
+  class VISIBILITY_HIDDEN NullProfilerRS : public RSProfilers {
   public:
     bool isProfiling(Value* v) {
       return false;
@@ -85,7 +86,7 @@
   static RegisterAnalysisGroup<RSProfilers, true> NPT(NP);
 
   /// Chooser - Something that chooses when to make a sample of the profiled code
-  class Chooser {
+  class VISIBILITY_HIDDEN Chooser {
   public:
     /// ProcessChoicePoint - is called for each basic block inserted to choose 
     /// between normal and sample code
@@ -99,7 +100,7 @@
   //Things that implement sampling policies
   //A global value that is read-mod-stored to choose when to sample.
   //A sample is taken when the global counter hits 0
-  class GlobalRandomCounter : public Chooser {
+  class VISIBILITY_HIDDEN GlobalRandomCounter : public Chooser {
     GlobalVariable* Counter;
     Value* ResetValue;
     const Type* T;
@@ -111,7 +112,7 @@
   };
 
   //Same is GRC, but allow register allocation of the global counter
-  class GlobalRandomCounterOpt : public Chooser {
+  class VISIBILITY_HIDDEN GlobalRandomCounterOpt : public Chooser {
     GlobalVariable* Counter;
     Value* ResetValue;
     AllocaInst* AI;
@@ -125,7 +126,7 @@
 
   //Use the cycle counter intrinsic as a source of pseudo randomness when
   //deciding when to sample.
-  class CycleCounter : public Chooser {
+  class VISIBILITY_HIDDEN CycleCounter : public Chooser {
     uint64_t rm;
     Constant *F;
   public:
@@ -136,7 +137,7 @@
   };
 
   /// ProfilerRS - Insert the random sampling framework
-  struct ProfilerRS : public FunctionPass {
+  struct VISIBILITY_HIDDEN ProfilerRS : public FunctionPass {
     std::map<Value*, Value*> TransCache;
     std::set<BasicBlock*> ChoicePoints;
     Chooser* c;


Index: llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp
diff -u llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp:1.22 llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp:1.23
--- llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp:1.22	Mon Feb  5 15:19:13 2007
+++ llvm/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp	Mon Feb  5 17:32:05 2007
@@ -21,12 +21,13 @@
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #include "llvm/Transforms/Instrumentation.h"
 #include "llvm/Instructions.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include <set>
 using namespace llvm;
 
 namespace {
-  class TraceBasicBlocks : public ModulePass {
+  class VISIBILITY_HIDDEN TraceBasicBlocks : public ModulePass {
     bool runOnModule(Module &M);
   };
 






More information about the llvm-commits mailing list