llvm.org GIT mirror llvm / d7d83db
Make classes in anonymous namespaces use VISIBILITY_HIDDEN to help reduce LLVM's footprint and speed up linking. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33941 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 13 years ago
14 changed file(s) with 38 addition(s) and 19 deletion(s). Raw diff Collapse all Expand all
1616 #include "llvm/Analysis/AliasAnalysis.h"
1717 #include "llvm/Assembly/Writer.h"
1818 #include "llvm/Support/CommandLine.h"
19 #include "llvm/Support/Compiler.h"
1920 #include "llvm/Support/Streams.h"
2021 using namespace llvm;
2122
2526 cl::opt
2627 PrintAllFailures("count-aa-print-all-failed-queries", cl::ReallyHidden);
2728
28 class AliasAnalysisCounter : public ModulePass, public AliasAnalysis {
29 class VISIBILITY_HIDDEN AliasAnalysisCounter
30 : public ModulePass, public AliasAnalysis {
2931 unsigned No, May, Must;
3032 unsigned NoMR, JustRef, JustMod, MR;
3133 const char *Name;
2727 #include "llvm/Target/TargetData.h"
2828 #include "llvm/Support/InstIterator.h"
2929 #include "llvm/Support/CommandLine.h"
30 #include "llvm/Support/Compiler.h"
3031 #include "llvm/Support/Streams.h"
3132 #include
3233 using namespace llvm;
4344 cl::opt PrintRef("print-ref", cl::ReallyHidden);
4445 cl::opt PrintModRef("print-modref", cl::ReallyHidden);
4546
46 class AAEval : public FunctionPass {
47 class VISIBILITY_HIDDEN AAEval : public FunctionPass {
4748 unsigned NoAlias, MayAlias, MustAlias;
4849 unsigned NoModRef, Mod, Ref, ModRef;
4950
2222 #include "llvm/Constants.h"
2323 #include "llvm/DerivedTypes.h"
2424 #include "llvm/Analysis/AliasAnalysis.h"
25 #include "llvm/Support/Compiler.h"
2526 #include
2627 using namespace llvm;
2728
2829 namespace {
2930
30 class AliasDebugger : public ModulePass, public AliasAnalysis {
31 class VISIBILITY_HIDDEN AliasDebugger
32 : public ModulePass, public AliasAnalysis {
3133
3234 //What we do is simple. Keep track of every value the AA could
3335 //know about, and verify that queries are one of those.
1717 #include "llvm/Type.h"
1818 #include "llvm/Target/TargetData.h"
1919 #include "llvm/Assembly/Writer.h"
20 #include "llvm/Support/Compiler.h"
2021 #include "llvm/Support/InstIterator.h"
2122 #include "llvm/Support/Streams.h"
2223 using namespace llvm;
550551 //===----------------------------------------------------------------------===//
551552
552553 namespace {
553 class AliasSetPrinter : public FunctionPass {
554 class VISIBILITY_HIDDEN AliasSetPrinter : public FunctionPass {
554555 AliasSetTracker *Tracker;
555556 public:
556557 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
744744 }
745745
746746 namespace {
747 struct StringCompare {
747 struct VISIBILITY_HIDDEN StringCompare {
748748 bool operator()(const char *LHS, const char *RHS) {
749749 return strcmp(LHS, RHS) < 0;
750750 }
2222 #include "llvm/Analysis/CFGPrinter.h"
2323 #include "llvm/Assembly/Writer.h"
2424 #include "llvm/Support/CFG.h"
25 #include "llvm/Support/Compiler.h"
2526 #include "llvm/Support/GraphWriter.h"
2627 #include "llvm/Config/config.h"
2728 #include
8889 }
8990
9091 namespace {
91 struct CFGPrinter : public FunctionPass {
92 struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass {
9293 virtual bool runOnFunction(Function &F) {
9394 std::string Filename = "cfg." + F.getName() + ".dot";
9495 cerr << "Writing '" << Filename << "'...";
112113 RegisterPass P1("print-cfg",
113114 "Print CFG of function to 'dot' file");
114115
115 struct CFGOnlyPrinter : public CFGPrinter {
116 struct VISIBILITY_HIDDEN CFGOnlyPrinter : public CFGPrinter {
116117 virtual bool runOnFunction(Function &F) {
117118 bool OldCFGOnly = CFGOnly;
118119 CFGOnly = true;
5454 #include "llvm/Instructions.h"
5555 #include "llvm/Module.h"
5656 #include "llvm/Pass.h"
57 #include "llvm/Support/Compiler.h"
5758 #include "llvm/Support/InstIterator.h"
5859 #include "llvm/Support/InstVisitor.h"
5960 #include "llvm/Analysis/AliasAnalysis.h"
7071 STATISTIC(NumIndirectCallees , "Number of indirect callees found");
7172
7273 namespace {
73 class Andersens : public ModulePass, public AliasAnalysis,
74 private InstVisitor {
74 class VISIBILITY_HIDDEN Andersens : public ModulePass, public AliasAnalysis,
75 private InstVisitor {
7576 /// Node class - This class is used to represent a memory object in the
7677 /// program, and is the primitive used to build the points-to graph.
7778 class Node {
1515 #include "llvm/Module.h"
1616 #include "llvm/Instructions.h"
1717 #include "llvm/Support/CallSite.h"
18 #include "llvm/Support/Compiler.h"
1819 #include "llvm/Support/Streams.h"
1920 #include
2021 using namespace llvm;
3435 //===----------------------------------------------------------------------===//
3536 // BasicCallGraph class definition
3637 //
37 class BasicCallGraph : public CallGraph, public ModulePass {
38 class VISIBILITY_HIDDEN BasicCallGraph : public CallGraph, public ModulePass {
3839 // Root is root of the call graph, or the external node if a 'main' function
3940 // couldn't be found.
4041 //
2222 #include "llvm/DerivedTypes.h"
2323 #include "llvm/Analysis/AliasAnalysis.h"
2424 #include "llvm/Analysis/CallGraph.h"
25 #include "llvm/Support/Compiler.h"
26 #include "llvm/Support/CommandLine.h"
2527 #include "llvm/Support/InstIterator.h"
26 #include "llvm/Support/CommandLine.h"
2728 #include "llvm/ADT/Statistic.h"
2829 #include "llvm/ADT/SCCIterator.h"
2930 #include
4142 /// function in the program. Later, the entries for these functions are
4243 /// removed if the function is found to call an external function (in which
4344 /// case we know nothing about it.
44 struct FunctionRecord {
45 struct VISIBILITY_HIDDEN FunctionRecord {
4546 /// GlobalInfo - Maintain mod/ref info for all of the globals without
4647 /// addresses taken that are read or written (transitively) by this
4748 /// function.
6263 };
6364
6465 /// GlobalsModRef - The actual analysis pass.
65 class GlobalsModRef : public ModulePass, public AliasAnalysis {
66 class VISIBILITY_HIDDEN GlobalsModRef
67 : public ModulePass, public AliasAnalysis {
6668 /// NonAddressTakenGlobals - The globals that do not have their addresses
6769 /// taken.
6870 std::set NonAddressTakenGlobals;
1414 #include "llvm/Analysis/Passes.h"
1515 #include "llvm/Pass.h"
1616 #include "llvm/Function.h"
17 #include "llvm/Support/Compiler.h"
1718 #include "llvm/Support/InstVisitor.h"
1819 #include "llvm/Support/Streams.h"
1920 #include "llvm/ADT/Statistic.h"
3233
3334
3435 namespace {
35 class InstCount : public FunctionPass, public InstVisitor {
36 class VISIBILITY_HIDDEN InstCount
37 : public FunctionPass, public InstVisitor {
3638 friend class InstVisitor;
3739
3840 void visitFunction (Function &F) { ++TotalFuncs; }
3030 #include "llvm/Analysis/AliasAnalysis.h"
3131 #include "llvm/Analysis/Dominators.h"
3232 #include "llvm/Support/CFG.h"
33 #include "llvm/Support/Compiler.h"
3334 #include "llvm/Target/TargetData.h"
3435 #include
3536 #include
3738
3839 namespace {
3940 // FIXME: This should not be a FunctionPass.
40 struct LoadVN : public FunctionPass, public ValueNumbering {
41 struct VISIBILITY_HIDDEN LoadVN : public FunctionPass, public ValueNumbering {
4142
4243 /// Pass Implementation stuff. This doesn't do any analysis.
4344 ///
1515 #include "llvm/Analysis/ProfileInfo.h"
1616 #include "llvm/Pass.h"
1717 #include "llvm/Support/CFG.h"
18 #include "llvm/Support/Compiler.h"
1819 #include
1920 using namespace llvm;
2021
8182 //
8283
8384 namespace {
84 struct NoProfileInfo : public ImmutablePass, public ProfileInfo {};
85 struct VISIBILITY_HIDDEN NoProfileInfo
86 : public ImmutablePass, public ProfileInfo {};
8587
8688 // Register this pass...
8789 RegisterPass
1818 #include "llvm/Analysis/ProfileInfo.h"
1919 #include "llvm/Analysis/ProfileInfoLoader.h"
2020 #include "llvm/Support/CommandLine.h"
21 #include "llvm/Support/Compiler.h"
2122 #include "llvm/Support/Streams.h"
2223 using namespace llvm;
2324
2728 cl::value_desc("filename"),
2829 cl::desc("Profile file loaded by -profile-loader"));
2930
30 class LoaderPass : public ModulePass, public ProfileInfo {
31 class VISIBILITY_HIDDEN LoaderPass : public ModulePass, public ProfileInfo {
3132 std::string Filename;
3233 public:
3334 LoaderPass(const std::string &filename = "")
1818 #include "llvm/Instructions.h"
1919 #include "llvm/Pass.h"
2020 #include "llvm/Type.h"
21 #include "llvm/Support/Compiler.h"
2122 using namespace llvm;
2223
2324 // Register the ValueNumbering interface, providing a nice name to refer to.
4748 /// lexically identical expressions. This does not require any ahead of time
4849 /// analysis, so it is a very fast default implementation.
4950 ///
50 struct BasicVN : public ImmutablePass, public ValueNumbering {
51 struct VISIBILITY_HIDDEN BasicVN
52 : public ImmutablePass, public ValueNumbering {
5153 /// getEqualNumberNodes - Return nodes with the same value number as the
5254 /// specified Value. This fills in the argument vector with any equal
5355 /// values.
6870 /// BVNImpl - Implement BasicVN in terms of a visitor class that
6971 /// handles the different types of instructions as appropriate.
7072 ///
71 struct BVNImpl : public InstVisitor {
73 struct VISIBILITY_HIDDEN BVNImpl : public InstVisitor {
7274 std::vector &RetVals;
7375 BVNImpl(std::vector &RV) : RetVals(RV) {}
7476