Use hidden visibility to make symbols in an anonymous namespace get
authorChris Lattner <sabre@nondot.org>
Wed, 28 Jun 2006 23:17:24 +0000 (23:17 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 28 Jun 2006 23:17:24 +0000 (23:17 +0000)
dropped.  This shrinks libllvmgcc.dylib another 67K

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

16 files changed:
lib/Analysis/BasicAliasAnalysis.cpp
lib/Analysis/ScalarEvolution.cpp
lib/CodeGen/PHIElimination.cpp
lib/CodeGen/RegAllocLocal.cpp
lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/CodeGen/UnreachableBlockElim.cpp
lib/Target/PowerPC/PPCAsmPrinter.cpp
lib/Target/PowerPC/PPCBranchSelector.cpp
lib/Target/PowerPC/PPCCodeEmitter.cpp
lib/Transforms/Scalar/LoopStrengthReduce.cpp
lib/Transforms/Scalar/ScalarReplAggregates.cpp
lib/Transforms/Utils/BreakCriticalEdges.cpp
lib/Transforms/Utils/LoopSimplify.cpp
lib/Transforms/Utils/LowerAllocations.cpp
lib/Transforms/Utils/PromoteMemoryToRegister.cpp

index fa4a029648f84684d4a1d4404dd54308afb53feb..57eda0fd40e26797055c581d36862e1b71c6c796 100644 (file)
@@ -23,6 +23,7 @@
 #include "llvm/Pass.h"
 #include "llvm/Target/TargetData.h"
 #include "llvm/Support/GetElementPtrTypeIterator.h"
+#include "llvm/Support/Visibility.h"
 #include <algorithm>
 using namespace llvm;
 
@@ -32,7 +33,7 @@ namespace {
   /// implementations, in that it does not chain to a previous analysis.  As
   /// such it doesn't follow many of the rules that other alias analyses must.
   ///
-  struct NoAA : public ImmutablePass, public AliasAnalysis {
+  struct VISIBILITY_HIDDEN NoAA : public ImmutablePass, public AliasAnalysis {
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.addRequired<TargetData>();
     }
@@ -84,7 +85,7 @@ namespace {
   /// BasicAliasAnalysis - This is the default alias analysis implementation.
   /// Because it doesn't chain to a previous alias analysis (like -no-aa), it
   /// derives from the NoAA class.
-  struct BasicAliasAnalysis : public NoAA {
+  struct VISIBILITY_HIDDEN BasicAliasAnalysis : public NoAA {
     AliasResult alias(const Value *V1, unsigned V1Size,
                       const Value *V2, unsigned V2Size);
 
index c6e32c53ab7c4bbbf530307b7d31e75b8b42058b..a83d2ee1c69d1e5d0f9079d8f3e4966d5a14ca2e 100644 (file)
 #include "llvm/Assembly/Writer.h"
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Support/CFG.h"
+#include "llvm/Support/CommandLine.h"
 #include "llvm/Support/ConstantRange.h"
 #include "llvm/Support/InstIterator.h"
-#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Visibility.h"
 #include "llvm/ADT/Statistic.h"
 #include <cmath>
 #include <iostream>
@@ -393,7 +394,7 @@ namespace {
   /// SCEVComplexityCompare - Return true if the complexity of the LHS is less
   /// than the complexity of the RHS.  This comparator is used to canonicalize
   /// expressions.
-  struct SCEVComplexityCompare {
+  struct VISIBILITY_HIDDEN SCEVComplexityCompare {
     bool operator()(SCEV *LHS, SCEV *RHS) {
       return LHS->getSCEVType() < RHS->getSCEVType();
     }
@@ -1062,7 +1063,7 @@ SCEVHandle SCEVUnknown::get(Value *V) {
 /// evolution code.
 ///
 namespace {
-  struct ScalarEvolutionsImpl {
+  struct VISIBILITY_HIDDEN ScalarEvolutionsImpl {
     /// F - The function we are analyzing.
     ///
     Function &F;
index 58ab82e032313420a2ee5c66476b91a1d6035e8b..5b8798f982950b2845e04a3a4487c7c6c858ce42 100644 (file)
@@ -23,6 +23,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/Statistic.h"
+#include "llvm/Support/Visibility.h"
 #include <set>
 #include <algorithm>
 using namespace llvm;
@@ -31,7 +32,7 @@ namespace {
   Statistic<> NumAtomic("phielim", "Number of atomic phis lowered");
   Statistic<> NumSimple("phielim", "Number of simple phis lowered");
   
-  struct PNE : public MachineFunctionPass {
+  struct VISIBILITY_HIDDEN PNE : public MachineFunctionPass {
     bool runOnMachineFunction(MachineFunction &Fn) {
       bool Changed = false;
 
index 55d412960c220b0be52fecd78cd904f8f64743a3..891ee3c0f38a1306a7ca8800e47958cfbab2de0f 100644 (file)
@@ -23,6 +23,7 @@
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Support/Visibility.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/Statistic.h"
 #include <algorithm>
@@ -34,7 +35,7 @@ namespace {
   Statistic<> NumLoads ("ra-local", "Number of loads added");
   Statistic<> NumFolded("ra-local", "Number of loads/stores folded into "
                         "instructions");
-  class RA : public MachineFunctionPass {
+  class VISIBILITY_HIDDEN RA : public MachineFunctionPass {
     const TargetMachine *TM;
     MachineFunction *MF;
     const MRegisterInfo *RegInfo;
index 0ef246b8eba56fe94b1c890f40f711d021ba5959..b6c2d352b358c928becb6f7789882fe068d57843 100644 (file)
@@ -430,7 +430,8 @@ namespace {
 
 namespace {
   template<class SF>
-  class RegReductionPriorityQueue : public SchedulingPriorityQueue {
+  class VISIBILITY_HIDDEN RegReductionPriorityQueue
+   : public SchedulingPriorityQueue {
     std::priority_queue<SUnit*, std::vector<SUnit*>, SF> Queue;
 
   public:
@@ -463,7 +464,8 @@ namespace {
   };
 
   template<class SF>
-  class BURegReductionPriorityQueue : public RegReductionPriorityQueue<SF> {
+  class VISIBILITY_HIDDEN BURegReductionPriorityQueue
+   : public RegReductionPriorityQueue<SF> {
     // SUnits - The SUnits for the current graph.
     const std::vector<SUnit> *SUnits;
     
index c7e4315bbd64d3479f16d666e9dc7f83b088413f..3968c38fa48ed7a4612e343c2b72388885fddb69 100644 (file)
@@ -42,6 +42,7 @@
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Support/Visibility.h"
 #include <map>
 #include <set>
 #include <iostream>
@@ -101,7 +102,7 @@ namespace {
   /// particular value is assigned and the type information about the value.
   /// This is needed because values can be promoted into larger registers and
   /// expanded into multiple smaller registers than the value.
-  struct RegsForValue {
+  struct VISIBILITY_HIDDEN RegsForValue {
     /// Regs - This list hold the register (for legal and promoted values)
     /// or register set (for expanded values) that the value should be assigned
     /// to.
index 1d4e5304f3b08313d6488fb571b24b7835a9a001..e4fc9f8148dfd340a5441682934316b71dac8453 100644 (file)
 #include "llvm/Pass.h"
 #include "llvm/Type.h"
 #include "llvm/Support/CFG.h"
+#include "llvm/Support/Visibility.h"
 #include "llvm/ADT/DepthFirstIterator.h"
 using namespace llvm;
 
 namespace {
-  class UnreachableBlockElim : public FunctionPass {
+  class VISIBILITY_HIDDEN UnreachableBlockElim : public FunctionPass {
     virtual bool runOnFunction(Function &F);
   };
   RegisterOpt<UnreachableBlockElim>
index 2a0104d477007536d48111cecc03480c695d226e..bb008430946ff02f85d06c0fb9299952e595894d 100644 (file)
@@ -241,7 +241,7 @@ namespace {
 
   /// DarwinDwarfWriter - Dwarf debug info writer customized for Darwin/Mac OS X
   ///
-  struct DarwinDwarfWriter : public DwarfWriter {
+  struct VISIBILITY_HIDDEN DarwinDwarfWriter : public DwarfWriter {
     // Ctor.
     DarwinDwarfWriter(std::ostream &o, AsmPrinter *ap)
     : DwarfWriter(o, ap)
@@ -265,7 +265,7 @@ namespace {
 
   /// DarwinAsmPrinter - PowerPC assembly printer, customized for Darwin/Mac OS
   /// X
-  struct DarwinAsmPrinter : public PPCAsmPrinter {
+  struct VISIBILITY_HIDDEN DarwinAsmPrinter : public PPCAsmPrinter {
   
     DarwinDwarfWriter DW;
 
@@ -309,7 +309,7 @@ namespace {
 
   /// AIXAsmPrinter - PowerPC assembly printer, customized for AIX
   ///
-  struct AIXAsmPrinter : public PPCAsmPrinter {
+  struct VISIBILITY_HIDDEN AIXAsmPrinter : public PPCAsmPrinter {
     /// Map for labels corresponding to global variables
     ///
     std::map<const GlobalVariable*,std::string> GVToLabelMap;
index 36f68058f8f153906a0c9835607f931d8387a643..b3d100cf5e59cd11364aeb5b7d51d8b06916a4d1 100644 (file)
 #include "PPCInstrBuilder.h"
 #include "PPCInstrInfo.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/Support/Visibility.h"
 #include <map>
 using namespace llvm;
 
 namespace {
-  struct PPCBSel : public MachineFunctionPass {
+  struct VISIBILITY_HIDDEN PPCBSel : public MachineFunctionPass {
     // OffsetMap - Mapping between BB and byte offset from start of function
     std::map<MachineBasicBlock*, unsigned> OffsetMap;
 
index f1c0e07a048560c3b3ef8264c7a9045607540a59..bc0772231f5fb2c7954c576dd9cdfdfa91099a81 100644 (file)
 #include "llvm/CodeGen/MachineInstrBuilder.h"
 #include "llvm/CodeGen/Passes.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Support/Visibility.h"
 #include "llvm/Target/TargetOptions.h"
 #include <iostream>
 using namespace llvm;
 
 namespace {
-  class PPCCodeEmitter : public MachineFunctionPass {
+  class VISIBILITY_HIDDEN PPCCodeEmitter : public MachineFunctionPass {
     TargetMachine &TM;
     MachineCodeEmitter &MCE;
 
index 6e4460b509e8ab92a606302933fb028c0e3e5333..ec15b646c73968d074fa38d7c45a6410ac3c8984 100644 (file)
@@ -31,6 +31,7 @@
 #include "llvm/Target/TargetData.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Support/Visibility.h"
 #include "llvm/Target/TargetLowering.h"
 #include <algorithm>
 #include <iostream>
@@ -104,7 +105,7 @@ namespace {
     }
   };
 
-  class LoopStrengthReduce : public FunctionPass {
+  class VISIBILITY_HIDDEN LoopStrengthReduce : public FunctionPass {
     LoopInfo *LI;
     ETForest *EF;
     ScalarEvolution *SE;
index f5bab8d8520f820c6a2fe6382f2557899196e7da..843c908ba4408fcfb3ce7b35543302b8f713a475 100644 (file)
 #include "llvm/Analysis/Dominators.h"
 #include "llvm/Target/TargetData.h"
 #include "llvm/Transforms/Utils/PromoteMemToReg.h"
+#include "llvm/Support/Debug.h"
 #include "llvm/Support/GetElementPtrTypeIterator.h"
 #include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Debug.h"
+#include "llvm/Support/Visibility.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/ADT/StringExtras.h"
 #include <iostream>
@@ -42,7 +43,7 @@ namespace {
   Statistic<> NumConverted("scalarrepl",
                            "Number of aggregates converted to scalar");
 
-  struct SROA : public FunctionPass {
+  struct VISIBILITY_HIDDEN SROA : public FunctionPass {
     bool runOnFunction(Function &F);
 
     bool performScalarRepl(Function &F);
index 5bb7d46908c56bcd0744663935e7d4f6608e7c47..7b00de6681fe8a3d4aebd5cea369088252ea1f8a 100644 (file)
 #include "llvm/Instructions.h"
 #include "llvm/Type.h"
 #include "llvm/Support/CFG.h"
+#include "llvm/Support/Visibility.h"
 #include "llvm/ADT/Statistic.h"
 using namespace llvm;
 
 namespace {
   Statistic<> NumBroken("break-crit-edges", "Number of blocks inserted");
 
-  struct BreakCriticalEdges : public FunctionPass {
+  struct VISIBILITY_HIDDEN BreakCriticalEdges : public FunctionPass {
     virtual bool runOnFunction(Function &F);
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
index 3188f123b7fb86769dd6f046aef443ceba8bb9c6..dcad43fc2bfcc95b7c8603d5e01c693dd038516f 100644 (file)
@@ -41,6 +41,7 @@
 #include "llvm/Analysis/Dominators.h"
 #include "llvm/Analysis/LoopInfo.h"
 #include "llvm/Support/CFG.h"
+#include "llvm/Support/Visibility.h"
 #include "llvm/ADT/SetOperations.h"
 #include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/Statistic.h"
@@ -53,7 +54,7 @@ namespace {
   Statistic<>
   NumNested("loopsimplify", "Number of nested loops split out");
 
-  struct LoopSimplify : public FunctionPass {
+  struct VISIBILITY_HIDDEN LoopSimplify : public FunctionPass {
     // AA - If we have an alias analysis object to update, this is it, otherwise
     // this is null.
     AliasAnalysis *AA;
index dab8084c4c8a45deb4b02d745df362accb067b0f..eab64681e574626c6dd4f760b77681fd864464ea 100644 (file)
@@ -21,6 +21,7 @@
 #include "llvm/Pass.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/Target/TargetData.h"
+#include "llvm/Support/Visibility.h"
 using namespace llvm;
 
 namespace {
@@ -29,7 +30,7 @@ namespace {
   /// LowerAllocations - Turn malloc and free instructions into %malloc and
   /// %free calls.
   ///
-  class LowerAllocations : public BasicBlockPass {
+  class VISIBILITY_HIDDEN LowerAllocations : public BasicBlockPass {
     Function *MallocFunc;   // Functions in the module we are processing
     Function *FreeFunc;     // Initialized by doInitialization
     bool LowerMallocArgToInteger;
index e433e6d4a29cf3422541d8a55abe057e9958b7ad..f748770f8da20e32946ddf82a7c59b94564b8e9d 100644 (file)
@@ -26,6 +26,7 @@
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/CFG.h"
 #include "llvm/Support/StableBasicBlockNumbering.h"
+#include "llvm/Support/Visibility.h"
 #include <algorithm>
 using namespace llvm;
 
@@ -52,7 +53,7 @@ bool llvm::isAllocaPromotable(const AllocaInst *AI, const TargetData &TD) {
 }
 
 namespace {
-  struct PromoteMem2Reg {
+  struct VISIBILITY_HIDDEN PromoteMem2Reg {
     /// Allocas - The alloca instructions being promoted.
     ///
     std::vector<AllocaInst*> Allocas;