[llvm-commits] [llvm] r51017 - in /llvm/trunk/lib: Analysis/ Analysis/IPA/ Archive/ Bitcode/Writer/ CodeGen/ CodeGen/SelectionDAG/ ExecutionEngine/Interpreter/ ExecutionEngine/JIT/ Support/ System/Unix/ Target/ Target/ARM/ Target/Alpha/ Target/CBackend/ Target/CellSPU/ Target/CppBackend/ Target/IA64/ Target/MSIL/ Target/Mips/ Target/PowerPC/ Target/Sparc/ Target/X86/ Transforms/Hello/ Transforms/IPO/ Transforms/Instrumentation/ Transforms/Scalar/ Transforms/Utils/ VMCore/
Dan Gohman
gohman at apple.com
Mon May 12 17:00:26 PDT 2008
Author: djg
Date: Mon May 12 19:00:25 2008
New Revision: 51017
URL: http://llvm.org/viewvc/llvm-project?rev=51017&view=rev
Log:
Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static
but not intended to be global.
Modified:
llvm/trunk/lib/Analysis/AliasAnalysis.cpp
llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp
llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp
llvm/trunk/lib/Analysis/AliasDebugger.cpp
llvm/trunk/lib/Analysis/AliasSetTracker.cpp
llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
llvm/trunk/lib/Analysis/CFGPrinter.cpp
llvm/trunk/lib/Analysis/IPA/Andersens.cpp
llvm/trunk/lib/Analysis/IPA/CallGraph.cpp
llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp
llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp
llvm/trunk/lib/Analysis/InstCount.cpp
llvm/trunk/lib/Analysis/LoadValueNumbering.cpp
llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
llvm/trunk/lib/Analysis/ProfileInfo.cpp
llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
llvm/trunk/lib/Analysis/ValueNumbering.cpp
llvm/trunk/lib/Archive/ArchiveReader.cpp
llvm/trunk/lib/Archive/ArchiveWriter.cpp
llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp
llvm/trunk/lib/CodeGen/BranchFolding.cpp
llvm/trunk/lib/CodeGen/CollectorMetadata.cpp
llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
llvm/trunk/lib/CodeGen/MachineDominators.cpp
llvm/trunk/lib/CodeGen/MachineLICM.cpp
llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp
llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp
llvm/trunk/lib/CodeGen/MachineSink.cpp
llvm/trunk/lib/CodeGen/OcamlCollector.cpp
llvm/trunk/lib/CodeGen/PHIElimination.cpp
llvm/trunk/lib/CodeGen/Passes.cpp
llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp
llvm/trunk/lib/CodeGen/RegAllocLocal.cpp
llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
llvm/trunk/lib/CodeGen/ShadowStackCollector.cpp
llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp
llvm/trunk/lib/CodeGen/VirtRegMap.cpp
llvm/trunk/lib/ExecutionEngine/Interpreter/Interpreter.cpp
llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp
llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp
llvm/trunk/lib/Support/Statistic.cpp
llvm/trunk/lib/System/Unix/Unix.h
llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp
llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp
llvm/trunk/lib/Target/CBackend/CBackend.cpp
llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp
llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp
llvm/trunk/lib/Target/MSIL/MSILWriter.cpp
llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp
llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp
llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp
llvm/trunk/lib/Target/TargetData.cpp
llvm/trunk/lib/Target/TargetMachine.cpp
llvm/trunk/lib/Target/X86/X86Subtarget.cpp
llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
llvm/trunk/lib/Transforms/Hello/Hello.cpp
llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp
llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp
llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp
llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp
llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp
llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp
llvm/trunk/lib/Transforms/IPO/IndMemRemoval.cpp
llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp
llvm/trunk/lib/Transforms/IPO/Inliner.cpp
llvm/trunk/lib/Transforms/IPO/Internalize.cpp
llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp
llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp
llvm/trunk/lib/Transforms/IPO/PruneEH.cpp
llvm/trunk/lib/Transforms/IPO/RaiseAllocations.cpp
llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp
llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp
llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp
llvm/trunk/lib/Transforms/Instrumentation/BlockProfiling.cpp
llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp
llvm/trunk/lib/Transforms/Instrumentation/RSProfiling.cpp
llvm/trunk/lib/Transforms/Scalar/ADCE.cpp
llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp
llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp
llvm/trunk/lib/Transforms/Scalar/CondPropagate.cpp
llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp
llvm/trunk/lib/Transforms/Scalar/DCE.cpp
llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp
llvm/trunk/lib/Transforms/Scalar/GCSE.cpp
llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp
llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
llvm/trunk/lib/Transforms/Scalar/LICM.cpp
llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp
llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp
llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp
llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp
llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp
llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp
llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp
llvm/trunk/lib/Transforms/Scalar/SCCP.cpp
llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp
llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp
llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp
llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp
llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp
llvm/trunk/lib/Transforms/Utils/LCSSA.cpp
llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp
llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp
llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp
llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp
llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp
llvm/trunk/lib/VMCore/Constants.cpp
llvm/trunk/lib/VMCore/PassManager.cpp
llvm/trunk/lib/VMCore/Type.cpp
llvm/trunk/lib/VMCore/Verifier.cpp
Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Mon May 12 19:00:25 2008
@@ -34,9 +34,7 @@
using namespace llvm;
// Register the AliasAnalysis interface, providing a nice name to refer to.
-namespace {
- RegisterAnalysisGroup<AliasAnalysis> Z("Alias Analysis");
-}
+static RegisterAnalysisGroup<AliasAnalysis> Z("Alias Analysis");
char AliasAnalysis::ID = 0;
//===----------------------------------------------------------------------===//
Modified: llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp (original)
+++ llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp Mon May 12 19:00:25 2008
@@ -21,12 +21,12 @@
#include "llvm/Support/Streams.h"
using namespace llvm;
-namespace {
- static cl::opt<bool>
- PrintAll("count-aa-print-all-queries", cl::ReallyHidden);
- static cl::opt<bool>
- PrintAllFailures("count-aa-print-all-failed-queries", cl::ReallyHidden);
+static cl::opt<bool>
+PrintAll("count-aa-print-all-queries", cl::ReallyHidden);
+static cl::opt<bool>
+PrintAllFailures("count-aa-print-all-failed-queries", cl::ReallyHidden);
+namespace {
class VISIBILITY_HIDDEN AliasAnalysisCounter
: public ModulePass, public AliasAnalysis {
unsigned No, May, Must;
@@ -113,13 +113,13 @@
return AliasAnalysis::getModRefInfo(CS1,CS2);
}
};
-
- char AliasAnalysisCounter::ID = 0;
- RegisterPass<AliasAnalysisCounter>
- X("count-aa", "Count Alias Analysis Query Responses", false, true);
- RegisterAnalysisGroup<AliasAnalysis> Y(X);
}
+char AliasAnalysisCounter::ID = 0;
+static RegisterPass<AliasAnalysisCounter>
+X("count-aa", "Count Alias Analysis Query Responses", false, true);
+static RegisterAnalysisGroup<AliasAnalysis> Y(X);
+
ModulePass *llvm::createAliasAnalysisCounterPass() {
return new AliasAnalysisCounter();
}
Modified: llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp (original)
+++ llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp Mon May 12 19:00:25 2008
@@ -34,19 +34,18 @@
#include <sstream>
using namespace llvm;
-namespace {
- static cl::opt<bool>
- PrintAll("print-all-alias-modref-info", cl::ReallyHidden);
+static cl::opt<bool> PrintAll("print-all-alias-modref-info", cl::ReallyHidden);
- static cl::opt<bool> PrintNoAlias("print-no-aliases", cl::ReallyHidden);
- static cl::opt<bool> PrintMayAlias("print-may-aliases", cl::ReallyHidden);
- static cl::opt<bool> PrintMustAlias("print-must-aliases", cl::ReallyHidden);
-
- static cl::opt<bool> PrintNoModRef("print-no-modref", cl::ReallyHidden);
- static cl::opt<bool> PrintMod("print-mod", cl::ReallyHidden);
- static cl::opt<bool> PrintRef("print-ref", cl::ReallyHidden);
- static cl::opt<bool> PrintModRef("print-modref", cl::ReallyHidden);
+static cl::opt<bool> PrintNoAlias("print-no-aliases", cl::ReallyHidden);
+static cl::opt<bool> PrintMayAlias("print-may-aliases", cl::ReallyHidden);
+static cl::opt<bool> PrintMustAlias("print-must-aliases", cl::ReallyHidden);
+
+static cl::opt<bool> PrintNoModRef("print-no-modref", cl::ReallyHidden);
+static cl::opt<bool> PrintMod("print-mod", cl::ReallyHidden);
+static cl::opt<bool> PrintRef("print-ref", cl::ReallyHidden);
+static cl::opt<bool> PrintModRef("print-modref", cl::ReallyHidden);
+namespace {
class VISIBILITY_HIDDEN AAEval : public FunctionPass {
unsigned NoAlias, MayAlias, MustAlias;
unsigned NoModRef, Mod, Ref, ModRef;
@@ -74,12 +73,12 @@
bool runOnFunction(Function &F);
bool doFinalization(Module &M);
};
-
- char AAEval::ID = 0;
- static RegisterPass<AAEval>
- X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator", false, true);
}
+char AAEval::ID = 0;
+static RegisterPass<AAEval>
+X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator", false, true);
+
FunctionPass *llvm::createAAEvalPass() { return new AAEval(); }
static void PrintResults(const char *Msg, bool P, const Value *V1, const Value *V2,
Modified: llvm/trunk/lib/Analysis/AliasDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasDebugger.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/AliasDebugger.cpp (original)
+++ llvm/trunk/lib/Analysis/AliasDebugger.cpp Mon May 12 19:00:25 2008
@@ -121,11 +121,12 @@
}
};
-
- char AliasDebugger::ID = 0;
- RegisterPass<AliasDebugger> X("debug-aa", "AA use debugger", false, true);
- RegisterAnalysisGroup<AliasAnalysis> Y(X);
}
+char AliasDebugger::ID = 0;
+static RegisterPass<AliasDebugger>
+X("debug-aa", "AA use debugger", false, true);
+static RegisterAnalysisGroup<AliasAnalysis> Y(X);
+
Pass *llvm::createAliasDebugger() { return new AliasDebugger(); }
Modified: llvm/trunk/lib/Analysis/AliasSetTracker.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasSetTracker.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/AliasSetTracker.cpp (original)
+++ llvm/trunk/lib/Analysis/AliasSetTracker.cpp Mon May 12 19:00:25 2008
@@ -585,6 +585,8 @@
return false;
}
};
- char AliasSetPrinter::ID = 0;
- RegisterPass<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer", false, true);
}
+
+char AliasSetPrinter::ID = 0;
+static RegisterPass<AliasSetPrinter>
+X("print-alias-sets", "Alias Set Printer", false, true);
Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Mon May 12 19:00:25 2008
@@ -79,15 +79,15 @@
virtual void deleteValue(Value *V) {}
virtual void copyValue(Value *From, Value *To) {}
};
+} // End of anonymous namespace
- // Register this pass...
- char NoAA::ID = 0;
- RegisterPass<NoAA>
- U("no-aa", "No Alias Analysis (always returns 'may' alias)", true, true);
+// Register this pass...
+char NoAA::ID = 0;
+static RegisterPass<NoAA>
+U("no-aa", "No Alias Analysis (always returns 'may' alias)", true, true);
- // Declare that we implement the AliasAnalysis interface
- RegisterAnalysisGroup<AliasAnalysis> V(U);
-} // End of anonymous namespace
+// Declare that we implement the AliasAnalysis interface
+static RegisterAnalysisGroup<AliasAnalysis> V(U);
ImmutablePass *llvm::createNoAAPass() { return new NoAA(); }
@@ -124,15 +124,15 @@
const Type *BasePtr2Ty,
Value **GEP2Ops, unsigned NumGEP2Ops, unsigned G2Size);
};
+} // End of anonymous namespace
- // Register this pass...
- char BasicAliasAnalysis::ID = 0;
- RegisterPass<BasicAliasAnalysis>
- X("basicaa", "Basic Alias Analysis (default AA impl)", false, true);
+// Register this pass...
+char BasicAliasAnalysis::ID = 0;
+static RegisterPass<BasicAliasAnalysis>
+X("basicaa", "Basic Alias Analysis (default AA impl)", false, true);
- // Declare that we implement the AliasAnalysis interface
- RegisterAnalysisGroup<AliasAnalysis, true> Y(X);
-} // End of anonymous namespace
+// Declare that we implement the AliasAnalysis interface
+static RegisterAnalysisGroup<AliasAnalysis, true> Y(X);
ImmutablePass *llvm::createBasicAliasAnalysisPass() {
return new BasicAliasAnalysis();
Modified: llvm/trunk/lib/Analysis/CFGPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFGPrinter.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CFGPrinter.cpp (original)
+++ llvm/trunk/lib/Analysis/CFGPrinter.cpp Mon May 12 19:00:25 2008
@@ -105,11 +105,13 @@
AU.setPreservesAll();
}
};
+}
- char CFGViewer::ID = 0;
- RegisterPass<CFGViewer> V0("view-cfg",
- "View CFG of function", false, true);
+char CFGViewer::ID = 0;
+static RegisterPass<CFGViewer>
+V0("view-cfg", "View CFG of function", false, true);
+namespace {
struct VISIBILITY_HIDDEN CFGOnlyViewer : public FunctionPass {
static char ID; // Pass identifcation, replacement for typeid
CFGOnlyViewer() : FunctionPass((intptr_t)&ID) {}
@@ -127,11 +129,14 @@
AU.setPreservesAll();
}
};
+}
- char CFGOnlyViewer::ID = 0;
- RegisterPass<CFGOnlyViewer> V1("view-cfg-only",
- "View CFG of function (with no function bodies)", false, true);
+char CFGOnlyViewer::ID = 0;
+static RegisterPass<CFGOnlyViewer>
+V1("view-cfg-only",
+ "View CFG of function (with no function bodies)", false, true);
+namespace {
struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass {
static char ID; // Pass identification, replacement for typeid
CFGPrinter() : FunctionPass((intptr_t)&ID) {}
@@ -156,11 +161,13 @@
AU.setPreservesAll();
}
};
+}
- char CFGPrinter::ID = 0;
- RegisterPass<CFGPrinter> P1("print-cfg",
- "Print CFG of function to 'dot' file", false, true);
+char CFGPrinter::ID = 0;
+static RegisterPass<CFGPrinter>
+P1("print-cfg", "Print CFG of function to 'dot' file", false, true);
+namespace {
struct VISIBILITY_HIDDEN CFGOnlyPrinter : public CFGPrinter {
static char ID; // Pass identification, replacement for typeid
CFGOnlyPrinter() : CFGPrinter((intptr_t)&ID) {}
@@ -177,13 +184,13 @@
AU.setPreservesAll();
}
};
-
- char CFGOnlyPrinter::ID = 0;
- RegisterPass<CFGOnlyPrinter>
- P2("print-cfg-only",
- "Print CFG of function to 'dot' file (with no function bodies)", false, true);
}
+char CFGOnlyPrinter::ID = 0;
+static RegisterPass<CFGOnlyPrinter>
+P2("print-cfg-only",
+ "Print CFG of function to 'dot' file (with no function bodies)", false, true);
+
/// viewCFG - This function is meant for use from the debugger. You can just
/// say 'call F->viewCFG()' and a ghostview window should pop up from the
/// program, displaying the CFG of the current function. This depends on there
Modified: llvm/trunk/lib/Analysis/IPA/Andersens.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/Andersens.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/IPA/Andersens.cpp (original)
+++ llvm/trunk/lib/Analysis/IPA/Andersens.cpp Mon May 12 19:00:25 2008
@@ -89,14 +89,14 @@
STATISTIC(NumUnified , "Number of variables unified");
STATISTIC(NumErased , "Number of redundant constraints erased");
-namespace {
- const unsigned SelfRep = (unsigned)-1;
- const unsigned Unvisited = (unsigned)-1;
- // Position of the function return node relative to the function node.
- const unsigned CallReturnPos = 1;
- // Position of the function call node relative to the function node.
- const unsigned CallFirstArgPos = 2;
+static const unsigned SelfRep = (unsigned)-1;
+static const unsigned Unvisited = (unsigned)-1;
+// Position of the function return node relative to the function node.
+static const unsigned CallReturnPos = 1;
+// Position of the function call node relative to the function node.
+static const unsigned CallFirstArgPos = 2;
+namespace {
struct BitmapKeyInfo {
static inline SparseBitVector<> *getEmptyKey() {
return reinterpret_cast<SparseBitVector<> *>(-1);
@@ -608,16 +608,15 @@
PrintPointsToGraph();
}
};
+}
- char Andersens::ID = 0;
- RegisterPass<Andersens> X("anders-aa",
- "Andersen's Interprocedural Alias Analysis", false,
- true);
- RegisterAnalysisGroup<AliasAnalysis> Y(X);
+char Andersens::ID = 0;
+static RegisterPass<Andersens>
+X("anders-aa", "Andersen's Interprocedural Alias Analysis", false, true);
+static RegisterAnalysisGroup<AliasAnalysis> Y(X);
- // Initialize Timestamp Counter (static).
- unsigned Andersens::Node::Counter = 0;
-}
+// Initialize Timestamp Counter (static).
+unsigned Andersens::Node::Counter = 0;
ModulePass *llvm::createAndersensPass() { return new Andersens(); }
Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraph.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/IPA/CallGraph.cpp (original)
+++ llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Mon May 12 19:00:25 2008
@@ -190,12 +190,13 @@
}
};
-RegisterAnalysisGroup<CallGraph> X("Call Graph");
-RegisterPass<BasicCallGraph> Y("basiccg", "Basic CallGraph Construction", false, true);
-RegisterAnalysisGroup<CallGraph, true> Z(Y);
-
} //End anonymous namespace
+static RegisterAnalysisGroup<CallGraph> X("Call Graph");
+static RegisterPass<BasicCallGraph>
+Y("basiccg", "Basic CallGraph Construction", false, true);
+static RegisterAnalysisGroup<CallGraph, true> Z(Y);
+
char CallGraph::ID = 0;
char BasicCallGraph::ID = 0;
Modified: llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp (original)
+++ llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp Mon May 12 19:00:25 2008
@@ -27,6 +27,8 @@
//
/// CGPassManager manages FPPassManagers and CalLGraphSCCPasses.
+namespace {
+
class CGPassManager : public ModulePass, public PMDataManager {
public:
@@ -73,6 +75,8 @@
}
};
+}
+
char CGPassManager::ID = 0;
/// run - Execute all of the passes scheduled for execution. Keep track of
/// whether any of the passes modifies the module, and if so, return true.
Modified: llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp (original)
+++ llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp Mon May 12 19:00:25 2008
@@ -146,14 +146,13 @@
GlobalValue *OkayStoreDest = 0);
bool AnalyzeIndirectGlobalMemory(GlobalValue *GV);
};
-
- char GlobalsModRef::ID = 0;
- RegisterPass<GlobalsModRef> X("globalsmodref-aa",
- "Simple mod/ref analysis for globals", false,
- true);
- RegisterAnalysisGroup<AliasAnalysis> Y(X);
}
+char GlobalsModRef::ID = 0;
+static RegisterPass<GlobalsModRef>
+X("globalsmodref-aa", "Simple mod/ref analysis for globals", false, true);
+static RegisterAnalysisGroup<AliasAnalysis> Y(X);
+
Pass *llvm::createGlobalsModRefPass() { return new GlobalsModRef(); }
/// getUnderlyingObject - This traverses the use chain to figure out what object
Modified: llvm/trunk/lib/Analysis/InstCount.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstCount.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/InstCount.cpp (original)
+++ llvm/trunk/lib/Analysis/InstCount.cpp Mon May 12 19:00:25 2008
@@ -62,12 +62,12 @@
virtual void print(std::ostream &O, const Module *M) const {}
};
-
- char InstCount::ID = 0;
- RegisterPass<InstCount> X("instcount",
- "Counts the various types of Instructions", false, true);
}
+char InstCount::ID = 0;
+static RegisterPass<InstCount>
+X("instcount", "Counts the various types of Instructions", false, true);
+
FunctionPass *llvm::createInstCountPass() { return new InstCount(); }
// InstCount::run - This is the main Analysis entry point for a
Modified: llvm/trunk/lib/Analysis/LoadValueNumbering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoadValueNumbering.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LoadValueNumbering.cpp (original)
+++ llvm/trunk/lib/Analysis/LoadValueNumbering.cpp Mon May 12 19:00:25 2008
@@ -82,14 +82,15 @@
void getCallEqualNumberNodes(CallInst *CI,
std::vector<Value*> &RetVals) const;
};
+}
- char LoadVN::ID = 0;
- // Register this pass...
- RegisterPass<LoadVN> X("load-vn", "Load Value Numbering", false, true);
+char LoadVN::ID = 0;
+// Register this pass...
+static RegisterPass<LoadVN>
+X("load-vn", "Load Value Numbering", false, true);
- // Declare that we implement the ValueNumbering interface
- RegisterAnalysisGroup<ValueNumbering> Y(X);
-}
+// Declare that we implement the ValueNumbering interface
+static RegisterAnalysisGroup<ValueNumbering> Y(X);
FunctionPass *llvm::createLoadValueNumberingPass() { return new LoadVN(); }
Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Mon May 12 19:00:25 2008
@@ -28,14 +28,12 @@
using namespace llvm;
-namespace {
- // Control the calculation of non-local dependencies by only examining the
- // predecessors if the basic block has less than X amount (50 by default).
- static cl::opt<int>
- PredLimit("nonlocaldep-threshold", cl::Hidden, cl::init(50),
- cl::desc("Control the calculation of non-local"
- "dependencies (default = 50)"));
-}
+// Control the calculation of non-local dependencies by only examining the
+// predecessors if the basic block has less than X amount (50 by default).
+static cl::opt<int>
+PredLimit("nonlocaldep-threshold", cl::Hidden, cl::init(50),
+ cl::desc("Control the calculation of non-local"
+ "dependencies (default = 50)"));
STATISTIC(NumCacheNonlocal, "Number of cached non-local responses");
STATISTIC(NumUncacheNonlocal, "Number of uncached non-local responses");
Modified: llvm/trunk/lib/Analysis/ProfileInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfo.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ProfileInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/ProfileInfo.cpp Mon May 12 19:00:25 2008
@@ -21,9 +21,7 @@
using namespace llvm;
// Register the ProfileInfo interface, providing a nice name to refer to.
-namespace {
- RegisterAnalysisGroup<ProfileInfo> Z("Profile Information");
-}
+static RegisterAnalysisGroup<ProfileInfo> Z("Profile Information");
char ProfileInfo::ID = 0;
ProfileInfo::~ProfileInfo() {}
@@ -89,14 +87,14 @@
static char ID; // Class identification, replacement for typeinfo
NoProfileInfo() : ImmutablePass((intptr_t)&ID) {}
};
+} // End of anonymous namespace
- char NoProfileInfo::ID = 0;
- // Register this pass...
- RegisterPass<NoProfileInfo>
- X("no-profile", "No Profile Information", false, true);
+char NoProfileInfo::ID = 0;
+// Register this pass...
+static RegisterPass<NoProfileInfo>
+X("no-profile", "No Profile Information", false, true);
- // Declare that we implement the ProfileInfo interface
- RegisterAnalysisGroup<ProfileInfo, true> Y(X);
-} // End of anonymous namespace
+// Declare that we implement the ProfileInfo interface
+static RegisterAnalysisGroup<ProfileInfo, true> Y(X);
ImmutablePass *llvm::createNoProfileInfoPass() { return new NoProfileInfo(); }
Modified: llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp (original)
+++ llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp Mon May 12 19:00:25 2008
@@ -23,12 +23,12 @@
#include "llvm/Support/Streams.h"
using namespace llvm;
-namespace {
- static cl::opt<std::string>
- ProfileInfoFilename("profile-info-file", cl::init("llvmprof.out"),
- cl::value_desc("filename"),
- cl::desc("Profile file loaded by -profile-loader"));
+static cl::opt<std::string>
+ProfileInfoFilename("profile-info-file", cl::init("llvmprof.out"),
+ cl::value_desc("filename"),
+ cl::desc("Profile file loaded by -profile-loader"));
+namespace {
class VISIBILITY_HIDDEN LoaderPass : public ModulePass, public ProfileInfo {
std::string Filename;
public:
@@ -49,13 +49,13 @@
/// run - Load the profile information from the specified file.
virtual bool runOnModule(Module &M);
};
+} // End of anonymous namespace
- char LoaderPass::ID = 0;
- RegisterPass<LoaderPass>
- X("profile-loader", "Load profile information from llvmprof.out", false, true);
+char LoaderPass::ID = 0;
+static RegisterPass<LoaderPass>
+X("profile-loader", "Load profile information from llvmprof.out", false, true);
- RegisterAnalysisGroup<ProfileInfo> Y(X);
-} // End of anonymous namespace
+static RegisterAnalysisGroup<ProfileInfo> Y(X);
ModulePass *llvm::createProfileLoaderPass() { return new LoaderPass(); }
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon May 12 19:00:25 2008
@@ -95,16 +95,14 @@
STATISTIC(NumBruteForceTripCountsComputed,
"Number of loops with trip counts computed by force");
-cl::opt<unsigned>
+static cl::opt<unsigned>
MaxBruteForceIterations("scalar-evolution-max-iterations", cl::ReallyHidden,
cl::desc("Maximum number of iterations SCEV will "
"symbolically execute a constant derived loop"),
cl::init(100));
-namespace {
- RegisterPass<ScalarEvolution>
- R("scalar-evolution", "Scalar Evolution Analysis", false, true);
-}
+static RegisterPass<ScalarEvolution>
+R("scalar-evolution", "Scalar Evolution Analysis", false, true);
char ScalarEvolution::ID = 0;
//===----------------------------------------------------------------------===//
Modified: llvm/trunk/lib/Analysis/ValueNumbering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueNumbering.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ValueNumbering.cpp (original)
+++ llvm/trunk/lib/Analysis/ValueNumbering.cpp Mon May 12 19:00:25 2008
@@ -24,7 +24,7 @@
char ValueNumbering::ID = 0;
// Register the ValueNumbering interface, providing a nice name to refer to.
-static RegisterAnalysisGroup<ValueNumbering> X("Value Numbering");
+static RegisterAnalysisGroup<ValueNumbering> V("Value Numbering");
/// ValueNumbering destructor: DO NOT move this to the header file for
/// ValueNumbering or else clients of the ValueNumbering class may not depend on
@@ -64,15 +64,17 @@
virtual void getEqualNumberNodes(Value *V1,
std::vector<Value*> &RetVals) const;
};
+}
- char BasicVN::ID = 0;
- // Register this pass...
- RegisterPass<BasicVN>
- X("basicvn", "Basic Value Numbering (default GVN impl)", false, true);
+char BasicVN::ID = 0;
+// Register this pass...
+static RegisterPass<BasicVN>
+X("basicvn", "Basic Value Numbering (default GVN impl)", false, true);
- // Declare that we implement the ValueNumbering interface
- RegisterAnalysisGroup<ValueNumbering, true> Y(X);
+// Declare that we implement the ValueNumbering interface
+static RegisterAnalysisGroup<ValueNumbering, true> Y(X);
+namespace {
/// BVNImpl - Implement BasicVN in terms of a visitor class that
/// handles the different types of instructions as appropriate.
///
Modified: llvm/trunk/lib/Archive/ArchiveReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Archive/ArchiveReader.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Archive/ArchiveReader.cpp (original)
+++ llvm/trunk/lib/Archive/ArchiveReader.cpp Mon May 12 19:00:25 2008
@@ -19,7 +19,7 @@
using namespace llvm;
/// Read a variable-bit-rate encoded unsigned integer
-inline unsigned readInteger(const char*&At, const char*End){
+static inline unsigned readInteger(const char*&At, const char*End) {
unsigned Shift = 0;
unsigned Result = 0;
Modified: llvm/trunk/lib/Archive/ArchiveWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Archive/ArchiveWriter.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Archive/ArchiveWriter.cpp (original)
+++ llvm/trunk/lib/Archive/ArchiveWriter.cpp Mon May 12 19:00:25 2008
@@ -25,7 +25,7 @@
// Write an integer using variable bit rate encoding. This saves a few bytes
// per entry in the symbol table.
-inline void writeInteger(unsigned num, std::ofstream& ARFile) {
+static inline void writeInteger(unsigned num, std::ofstream& ARFile) {
while (1) {
if (num < 0x80) { // done?
ARFile << (unsigned char)num;
@@ -41,7 +41,7 @@
// Compute how many bytes are taken by a given VBR encoded value. This is needed
// to pre-compute the size of the symbol table.
-inline unsigned numVbrBytes(unsigned num) {
+static inline unsigned numVbrBytes(unsigned num) {
// Note that the following nested ifs are somewhat equivalent to a binary
// search. We split it in half by comparing against 2^14 first. This allows
Modified: llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp Mon May 12 19:00:25 2008
@@ -114,19 +114,21 @@
}
// Optimize constant ordering.
-struct CstSortPredicate {
- ValueEnumerator &VE;
- CstSortPredicate(ValueEnumerator &ve) : VE(ve) {}
- bool operator()(const std::pair<const Value*, unsigned> &LHS,
- const std::pair<const Value*, unsigned> &RHS) {
- // Sort by plane.
- if (LHS.first->getType() != RHS.first->getType())
- return VE.getTypeID(LHS.first->getType()) <
- VE.getTypeID(RHS.first->getType());
- // Then by frequency.
- return LHS.second > RHS.second;
- }
-};
+namespace {
+ struct CstSortPredicate {
+ ValueEnumerator &VE;
+ explicit CstSortPredicate(ValueEnumerator &ve) : VE(ve) {}
+ bool operator()(const std::pair<const Value*, unsigned> &LHS,
+ const std::pair<const Value*, unsigned> &RHS) {
+ // Sort by plane.
+ if (LHS.first->getType() != RHS.first->getType())
+ return VE.getTypeID(LHS.first->getType()) <
+ VE.getTypeID(RHS.first->getType());
+ // Then by frequency.
+ return LHS.second > RHS.second;
+ }
+ };
+}
/// OptimizeConstants - Reorder constant pool for denser encoding.
void ValueEnumerator::OptimizeConstants(unsigned CstStart, unsigned CstEnd) {
Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original)
+++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Mon May 12 19:00:25 2008
@@ -38,13 +38,13 @@
STATISTIC(NumTailMerge , "Number of block tails merged");
static cl::opt<cl::boolOrDefault> FlagEnableTailMerge("enable-tail-merge",
cl::init(cl::BOU_UNSET), cl::Hidden);
-namespace {
- // Throttle for huge numbers of predecessors (compile speed problems)
- static cl::opt<unsigned>
- TailMergeThreshold("tail-merge-threshold",
- cl::desc("Max number of predecessors to consider tail merging"),
- cl::init(100), cl::Hidden);
+// Throttle for huge numbers of predecessors (compile speed problems)
+static cl::opt<unsigned>
+TailMergeThreshold("tail-merge-threshold",
+ cl::desc("Max number of predecessors to consider tail merging"),
+ cl::init(100), cl::Hidden);
+namespace {
struct VISIBILITY_HIDDEN BranchFolder : public MachineFunctionPass {
static char ID;
explicit BranchFolder(bool defaultEnableTailMerge) :
Modified: llvm/trunk/lib/CodeGen/CollectorMetadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CollectorMetadata.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/CollectorMetadata.cpp (original)
+++ llvm/trunk/lib/CodeGen/CollectorMetadata.cpp Mon May 12 19:00:25 2008
@@ -51,11 +51,11 @@
bool doFinalization(Module &M);
};
- RegisterPass<CollectorModuleMetadata>
- X("collector-metadata", "Create Garbage Collector Module Metadata");
-
}
+static RegisterPass<CollectorModuleMetadata>
+X("collector-metadata", "Create Garbage Collector Module Metadata");
+
// -----------------------------------------------------------------------------
CollectorMetadata::CollectorMetadata(const Function &F, Collector &C)
Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Mon May 12 19:00:25 2008
@@ -36,16 +36,14 @@
#include <cmath>
using namespace llvm;
-namespace {
- // Hidden options for help debugging.
- static cl::opt<bool> DisableReMat("disable-rematerialization",
- cl::init(false), cl::Hidden);
-
- static cl::opt<bool> SplitAtBB("split-intervals-at-bb",
- cl::init(true), cl::Hidden);
- static cl::opt<int> SplitLimit("split-limit",
- cl::init(-1), cl::Hidden);
-}
+// Hidden options for help debugging.
+static cl::opt<bool> DisableReMat("disable-rematerialization",
+ cl::init(false), cl::Hidden);
+
+static cl::opt<bool> SplitAtBB("split-intervals-at-bb",
+ cl::init(true), cl::Hidden);
+static cl::opt<int> SplitLimit("split-limit",
+ cl::init(-1), cl::Hidden);
STATISTIC(numIntervals, "Number of original intervals");
STATISTIC(numIntervalsAfter, "Number of intervals after coalescing");
@@ -53,9 +51,7 @@
STATISTIC(numSplits , "Number of intervals split");
char LiveIntervals::ID = 0;
-namespace {
- RegisterPass<LiveIntervals> X("liveintervals", "Live Interval Analysis");
-}
+static RegisterPass<LiveIntervals> X("liveintervals", "Live Interval Analysis");
void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const {
AU.addPreserved<LiveVariables>();
@@ -1078,20 +1074,22 @@
/// RewriteInfo - Keep track of machine instrs that will be rewritten
/// during spilling.
-struct RewriteInfo {
- unsigned Index;
- MachineInstr *MI;
- bool HasUse;
- bool HasDef;
- RewriteInfo(unsigned i, MachineInstr *mi, bool u, bool d)
- : Index(i), MI(mi), HasUse(u), HasDef(d) {}
-};
-
-struct RewriteInfoCompare {
- bool operator()(const RewriteInfo &LHS, const RewriteInfo &RHS) const {
- return LHS.Index < RHS.Index;
- }
-};
+namespace {
+ struct RewriteInfo {
+ unsigned Index;
+ MachineInstr *MI;
+ bool HasUse;
+ bool HasDef;
+ RewriteInfo(unsigned i, MachineInstr *mi, bool u, bool d)
+ : Index(i), MI(mi), HasUse(u), HasDef(d) {}
+ };
+
+ struct RewriteInfoCompare {
+ bool operator()(const RewriteInfo &LHS, const RewriteInfo &RHS) const {
+ return LHS.Index < RHS.Index;
+ }
+ };
+}
void LiveIntervals::
rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit,
Modified: llvm/trunk/lib/CodeGen/MachineDominators.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineDominators.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineDominators.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineDominators.cpp Mon May 12 19:00:25 2008
@@ -22,9 +22,7 @@
char MachineDominatorTree::ID = 0;
-namespace {
- RegisterPass<MachineDominatorTree>
- E("machinedomtree", "MachineDominator Tree Construction", true);
-}
+static RegisterPass<MachineDominatorTree>
+E("machinedomtree", "MachineDominator Tree Construction", true);
const PassInfo *llvm::MachineDominatorsID = E.getPassInfo();
Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Mon May 12 19:00:25 2008
@@ -150,12 +150,12 @@
///
void Hoist(MachineInstr &MI);
};
-
- char MachineLICM::ID = 0;
- RegisterPass<MachineLICM> X("machine-licm",
- "Machine Loop Invariant Code Motion");
} // end anonymous namespace
+char MachineLICM::ID = 0;
+static RegisterPass<MachineLICM>
+X("machine-licm", "Machine Loop Invariant Code Motion");
+
FunctionPass *llvm::createMachineLICMPass() { return new MachineLICM(); }
/// Hoist expressions out of the specified loop. Note, alias info for inner loop
Modified: llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp Mon May 12 19:00:25 2008
@@ -23,10 +23,8 @@
TEMPLATE_INSTANTIATION(class LoopInfoBase<MachineBasicBlock>);
char MachineLoopInfo::ID = 0;
-namespace {
- RegisterPass<MachineLoopInfo>
- X("machine-loops", "Machine Natural Loop Construction", true);
-}
+static RegisterPass<MachineLoopInfo>
+X("machine-loops", "Machine Natural Loop Construction", true);
const PassInfo *llvm::MachineLoopInfoID = X.getPassInfo();
Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Mon May 12 19:00:25 2008
@@ -27,9 +27,8 @@
using namespace llvm::dwarf;
// Handle the Pass registration stuff necessary to use TargetData's.
-namespace {
- RegisterPass<MachineModuleInfo> X("machinemoduleinfo", "Module Information");
-}
+static RegisterPass<MachineModuleInfo>
+X("machinemoduleinfo", "Module Information");
char MachineModuleInfo::ID = 0;
//===----------------------------------------------------------------------===//
@@ -160,6 +159,8 @@
DD->ApplyToFields(this);
}
+namespace {
+
//===----------------------------------------------------------------------===//
/// DICountVisitor - This DIVisitor counts all the fields in the supplied debug
/// the supplied DebugInfoDesc.
@@ -479,6 +480,7 @@
}
};
+}
//===----------------------------------------------------------------------===//
Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineSink.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineSink.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineSink.cpp Mon May 12 19:00:25 2008
@@ -50,10 +50,11 @@
bool SinkInstruction(MachineInstr *MI, bool &SawStore);
bool AllUsesDominatedByBlock(unsigned Reg, MachineBasicBlock *MBB) const;
};
-
- char MachineSinking::ID = 0;
- RegisterPass<MachineSinking> X("machine-sink", "Machine code sinking");
} // end anonymous namespace
+
+char MachineSinking::ID = 0;
+static RegisterPass<MachineSinking>
+X("machine-sink", "Machine code sinking");
FunctionPass *llvm::createMachineSinkingPass() { return new MachineSinking(); }
Modified: llvm/trunk/lib/CodeGen/OcamlCollector.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/OcamlCollector.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/OcamlCollector.cpp (original)
+++ llvm/trunk/lib/CodeGen/OcamlCollector.cpp Mon May 12 19:00:25 2008
@@ -35,11 +35,11 @@
const TargetAsmInfo &TAI);
};
- CollectorRegistry::Add<OcamlCollector>
- X("ocaml", "ocaml 3.10-compatible collector");
-
}
+static CollectorRegistry::Add<OcamlCollector>
+X("ocaml", "ocaml 3.10-compatible collector");
+
// -----------------------------------------------------------------------------
static void EmitCamlGlobal(const Module &M, std::ostream &OS, AsmPrinter &AP,
Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PHIElimination.cpp (original)
+++ llvm/trunk/lib/CodeGen/PHIElimination.cpp Mon May 12 19:00:25 2008
@@ -73,12 +73,12 @@
// Defs of PHI sources which are implicit_def.
SmallPtrSet<MachineInstr*, 4> ImpDefs;
};
-
- char PNE::ID = 0;
- RegisterPass<PNE> X("phi-node-elimination",
- "Eliminate PHI nodes for register allocation");
}
+char PNE::ID = 0;
+static RegisterPass<PNE>
+X("phi-node-elimination", "Eliminate PHI nodes for register allocation");
+
const PassInfo *llvm::PHIEliminationID = X.getPassInfo();
bool PNE::runOnMachineFunction(MachineFunction &Fn) {
Modified: llvm/trunk/lib/CodeGen/Passes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/Passes.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/Passes.cpp (original)
+++ llvm/trunk/lib/CodeGen/Passes.cpp Mon May 12 19:00:25 2008
@@ -30,14 +30,11 @@
/// RegAlloc command line options.
///
//===---------------------------------------------------------------------===//
-namespace {
- static
- cl::opt<RegisterRegAlloc::FunctionPassCtor, false,
- RegisterPassParser<RegisterRegAlloc> >
- RegAlloc("regalloc",
- cl::init(&createLinearScanRegisterAllocator),
- cl::desc("Register allocator to use: (default = linearscan)"));
-}
+static cl::opt<RegisterRegAlloc::FunctionPassCtor, false,
+ RegisterPassParser<RegisterRegAlloc> >
+RegAlloc("regalloc",
+ cl::init(&createLinearScanRegisterAllocator),
+ cl::desc("Register allocator to use: (default = linearscan)"));
//===---------------------------------------------------------------------===//
Modified: llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp Mon May 12 19:00:25 2008
@@ -52,11 +52,11 @@
STATISTIC(NumLoads , "Number of loads added");
STATISTIC(NumFolded, "Number of loads/stores folded into instructions");
-namespace {
- static RegisterRegAlloc
- bigBlockRegAlloc("bigblock", " Big-block register allocator",
- createBigBlockRegisterAllocator);
+static RegisterRegAlloc
+ bigBlockRegAlloc("bigblock", " Big-block register allocator",
+ createBigBlockRegisterAllocator);
+namespace {
/// VRegKeyInfo - Defines magic values required to use VirtRegs as DenseMap
/// keys.
struct VRegKeyInfo {
Modified: llvm/trunk/lib/CodeGen/RegAllocLocal.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLocal.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocLocal.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocLocal.cpp Mon May 12 19:00:25 2008
@@ -37,12 +37,11 @@
STATISTIC(NumStores, "Number of stores added");
STATISTIC(NumLoads , "Number of loads added");
-namespace {
- static RegisterRegAlloc
- localRegAlloc("local", " local register allocator",
- createLocalRegisterAllocator);
-
+static RegisterRegAlloc
+ localRegAlloc("local", " local register allocator",
+ createLocalRegisterAllocator);
+namespace {
class VISIBILITY_HIDDEN RALocal : public MachineFunctionPass {
public:
static char ID;
Modified: llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Mon May 12 19:00:25 2008
@@ -22,9 +22,7 @@
using namespace llvm;
// Register the RegisterCoalescer interface, providing a nice name to refer to.
-namespace {
- RegisterAnalysisGroup<RegisterCoalescer> Z("Register Coalescer");
-}
+static RegisterAnalysisGroup<RegisterCoalescer> Z("Register Coalescer");
char RegisterCoalescer::ID = 0;
// RegisterCoalescer destructor: DO NOT move this to the header file
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon May 12 19:00:25 2008
@@ -318,7 +318,7 @@
/// AddNodeIDValueTypes - Value type lists are intern'd so we can represent them
/// solely with their pointer.
-void AddNodeIDValueTypes(FoldingSetNodeID &ID, SDVTList VTList) {
+static void AddNodeIDValueTypes(FoldingSetNodeID &ID, SDVTList VTList) {
ID.AddPointer(VTList.VTs);
}
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon May 12 19:00:25 2008
@@ -74,18 +74,16 @@
/// ISHeuristic command line option for instruction schedulers.
///
//===---------------------------------------------------------------------===//
-namespace {
- static cl::opt<RegisterScheduler::FunctionPassCtor, false,
- RegisterPassParser<RegisterScheduler> >
- ISHeuristic("pre-RA-sched",
- cl::init(&createDefaultScheduler),
- cl::desc("Instruction schedulers available (before register"
- " allocation):"));
-
- static RegisterScheduler
- defaultListDAGScheduler("default", " Best scheduler for the target",
- createDefaultScheduler);
-} // namespace
+static cl::opt<RegisterScheduler::FunctionPassCtor, false,
+ RegisterPassParser<RegisterScheduler> >
+ISHeuristic("pre-RA-sched",
+ cl::init(&createDefaultScheduler),
+ cl::desc("Instruction schedulers available (before register"
+ " allocation):"));
+
+static RegisterScheduler
+defaultListDAGScheduler("default", " Best scheduler for the target",
+ createDefaultScheduler);
namespace { struct SDISelAsmOperandInfo; }
Modified: llvm/trunk/lib/CodeGen/ShadowStackCollector.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ShadowStackCollector.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ShadowStackCollector.cpp (original)
+++ llvm/trunk/lib/CodeGen/ShadowStackCollector.cpp Mon May 12 19:00:25 2008
@@ -66,11 +66,14 @@
static GetElementPtrInst *CreateGEP(IRBuilder &B, Value *BasePtr,
int Idx1, int Idx2, const char *Name);
};
+
+}
- CollectorRegistry::Add<ShadowStackCollector>
- Y("shadow-stack",
- "Very portable collector for uncooperative code generators");
+static CollectorRegistry::Add<ShadowStackCollector>
+Y("shadow-stack",
+ "Very portable collector for uncooperative code generators");
+namespace {
/// EscapeEnumerator - This is a little algorithm to find all escape points
/// from a function so that "finally"-style code can be inserted. In addition
/// to finding the existing return and unwind instructions, it also (if
Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
+++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Mon May 12 19:00:25 2008
@@ -42,23 +42,21 @@
STATISTIC(numAborts , "Number of times interval joining aborted");
char SimpleRegisterCoalescing::ID = 0;
-namespace {
- static cl::opt<bool>
- EnableJoining("join-liveintervals",
- cl::desc("Coalesce copies (default=true)"),
- cl::init(true));
-
- static cl::opt<bool>
- NewHeuristic("new-coalescer-heuristic",
- cl::desc("Use new coalescer heuristic"),
- cl::init(false));
+static cl::opt<bool>
+EnableJoining("join-liveintervals",
+ cl::desc("Coalesce copies (default=true)"),
+ cl::init(true));
+
+static cl::opt<bool>
+NewHeuristic("new-coalescer-heuristic",
+ cl::desc("Use new coalescer heuristic"),
+ cl::init(false));
- RegisterPass<SimpleRegisterCoalescing>
- X("simple-register-coalescing", "Simple Register Coalescing");
+static RegisterPass<SimpleRegisterCoalescing>
+X("simple-register-coalescing", "Simple Register Coalescing");
- // Declare that we implement the RegisterCoalescer interface
- RegisterAnalysisGroup<RegisterCoalescer, true/*The Default*/> V(X);
-}
+// Declare that we implement the RegisterCoalescer interface
+static RegisterAnalysisGroup<RegisterCoalescer, true/*The Default*/> V(X);
const PassInfo *llvm::SimpleRegisterCoalescingID = X.getPassInfo();
Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original)
+++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Mon May 12 19:00:25 2008
@@ -140,12 +140,13 @@
SmallPtrSet<MachineBasicBlock*, 16>& v);
void mergeLiveIntervals(unsigned primary, unsigned secondary, unsigned VN);
};
-
- char StrongPHIElimination::ID = 0;
- RegisterPass<StrongPHIElimination> X("strong-phi-node-elimination",
- "Eliminate PHI nodes for register allocation, intelligently");
}
+char StrongPHIElimination::ID = 0;
+static RegisterPass<StrongPHIElimination>
+X("strong-phi-node-elimination",
+ "Eliminate PHI nodes for register allocation, intelligently");
+
const PassInfo *llvm::StrongPHIEliminationID = X.getPassInfo();
/// computeDFS - Computes the DFS-in and DFS-out numbers of the dominator tree
@@ -192,6 +193,8 @@
}
}
+namespace {
+
/// PreorderSorter - a helper class that is used to sort registers
/// according to the preorder number of their defining blocks
class PreorderSorter {
@@ -219,6 +222,8 @@
}
};
+}
+
/// computeDomForest - compute the subforest of the DomTree corresponding
/// to the defining blocks of the registers in question
std::vector<StrongPHIElimination::DomForestNode*>
Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original)
+++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Mon May 12 19:00:25 2008
@@ -75,12 +75,12 @@
/// runOnMachineFunction - Pass entry point.
bool runOnMachineFunction(MachineFunction&);
};
-
- char TwoAddressInstructionPass::ID = 0;
- RegisterPass<TwoAddressInstructionPass>
- X("twoaddressinstruction", "Two-Address instruction pass");
}
+char TwoAddressInstructionPass::ID = 0;
+static RegisterPass<TwoAddressInstructionPass>
+X("twoaddressinstruction", "Two-Address instruction pass");
+
const PassInfo *llvm::TwoAddressInstructionPassID = X.getPassInfo();
/// Sink3AddrInstruction - A two-address instruction has been converted to a
Modified: llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp (original)
+++ llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp Mon May 12 19:00:25 2008
@@ -38,10 +38,10 @@
static char ID; // Pass identification, replacement for typeid
UnreachableBlockElim() : FunctionPass((intptr_t)&ID) {}
};
- char UnreachableBlockElim::ID = 0;
- RegisterPass<UnreachableBlockElim>
- X("unreachableblockelim", "Remove unreachable blocks from the CFG");
}
+char UnreachableBlockElim::ID = 0;
+static RegisterPass<UnreachableBlockElim>
+X("unreachableblockelim", "Remove unreachable blocks from the CFG");
FunctionPass *llvm::createUnreachableBlockEliminationPass() {
return new UnreachableBlockElim();
Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegMap.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/VirtRegMap.cpp (original)
+++ llvm/trunk/lib/CodeGen/VirtRegMap.cpp Mon May 12 19:00:25 2008
@@ -48,17 +48,17 @@
namespace {
enum SpillerName { simple, local };
-
- static cl::opt<SpillerName>
- SpillerOpt("spiller",
- cl::desc("Spiller to use: (default: local)"),
- cl::Prefix,
- cl::values(clEnumVal(simple, " simple spiller"),
- clEnumVal(local, " local spiller"),
- clEnumValEnd),
- cl::init(local));
}
+static cl::opt<SpillerName>
+SpillerOpt("spiller",
+ cl::desc("Spiller to use: (default: local)"),
+ cl::Prefix,
+ cl::values(clEnumVal(simple, " simple spiller"),
+ clEnumVal(local, " local spiller"),
+ clEnumValEnd),
+ cl::init(local));
+
//===----------------------------------------------------------------------===//
// VirtRegMap implementation
//===----------------------------------------------------------------------===//
Modified: llvm/trunk/lib/ExecutionEngine/Interpreter/Interpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Interpreter/Interpreter.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/Interpreter/Interpreter.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/Interpreter/Interpreter.cpp Mon May 12 19:00:25 2008
@@ -21,10 +21,14 @@
#include <cstring>
using namespace llvm;
+namespace {
+
static struct RegisterInterp {
RegisterInterp() { Interpreter::Register(); }
} InterpRegistrator;
+}
+
namespace llvm {
void LinkInInterpreter() {
}
Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Mon May 12 19:00:25 2008
@@ -52,10 +52,14 @@
extern void *__dso_handle __attribute__ ((__visibility__ ("hidden")));
#endif
+namespace {
+
static struct RegisterJIT {
RegisterJIT() { JIT::Register(); }
} JITRegistrator;
+}
+
namespace llvm {
void LinkInJIT() {
}
Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp Mon May 12 19:00:25 2008
@@ -172,6 +172,8 @@
return LSize < RSize;
}
+namespace {
+
struct KeyInfo {
static inline unsigned getEmptyKey() { return -1U; }
static inline unsigned getTombstoneKey() { return -2U; }
@@ -205,6 +207,8 @@
unsigned Action;
};
+}
+
unsigned char* JITDwarfEmitter::EmitExceptionTable(MachineFunction* MF,
unsigned char* StartFunction,
unsigned char* EndFunction) const {
Modified: llvm/trunk/lib/Support/Statistic.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Statistic.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Statistic.cpp (original)
+++ llvm/trunk/lib/Support/Statistic.cpp Mon May 12 19:00:25 2008
@@ -70,6 +70,8 @@
Initialized = true;
}
+namespace {
+
struct NameCompare {
bool operator()(const Statistic *LHS, const Statistic *RHS) const {
int Cmp = std::strcmp(LHS->getName(), RHS->getName());
@@ -80,6 +82,8 @@
}
};
+}
+
// Print information when destroyed, iff command line option is specified.
StatisticInfo::~StatisticInfo() {
// Statistics not enabled?
Modified: llvm/trunk/lib/System/Unix/Unix.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Unix.h?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/System/Unix/Unix.h (original)
+++ llvm/trunk/lib/System/Unix/Unix.h Mon May 12 19:00:25 2008
@@ -70,7 +70,7 @@
/// string and the Unix error number given by \p errnum. If errnum is -1, the
/// default then the value of errno is used.
/// @brief Make an error message
-inline bool MakeErrMsg(
+static inline bool MakeErrMsg(
std::string* ErrMsg, const std::string& prefix, int errnum = -1) {
if (!ErrMsg)
return true;
Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp Mon May 12 19:00:25 2008
@@ -27,11 +27,9 @@
static cl::opt<bool> DisableIfConversion("disable-arm-if-conversion",cl::Hidden,
cl::desc("Disable if-conversion pass"));
-namespace {
- // Register the target.
- RegisterTarget<ARMTargetMachine> X("arm", " ARM");
- RegisterTarget<ThumbTargetMachine> Y("thumb", " Thumb");
-}
+// Register the target.
+static RegisterTarget<ARMTargetMachine> X("arm", " ARM");
+static RegisterTarget<ThumbTargetMachine> Y("thumb", " Thumb");
/// ThumbTargetMachine - Create an Thumb architecture model.
///
Modified: llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/Alpha/AlphaTargetMachine.cpp Mon May 12 19:00:25 2008
@@ -20,10 +20,8 @@
using namespace llvm;
-namespace {
- // Register the targets
- RegisterTarget<AlphaTargetMachine> X("alpha", " Alpha (incomplete)");
-}
+// Register the targets
+static RegisterTarget<AlphaTargetMachine> X("alpha", " Alpha (incomplete)");
const TargetAsmInfo *AlphaTargetMachine::createTargetAsmInfo() const {
return new AlphaTargetAsmInfo(*this);
Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original)
+++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Mon May 12 19:00:25 2008
@@ -47,10 +47,10 @@
#include <sstream>
using namespace llvm;
-namespace {
- // Register the target.
- RegisterTarget<CTargetMachine> X("c", " C backend");
+// Register the target.
+static RegisterTarget<CTargetMachine> X("c", " C backend");
+namespace {
/// CBackendNameAllUsedStructsAndMergeFunctions - This pass inserts names for
/// any unnamed structure types that are used by the program, and merges
/// external functions with the same name.
Modified: llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp Mon May 12 19:00:25 2008
@@ -214,6 +214,8 @@
}
}
+namespace {
+
//===--------------------------------------------------------------------===//
/// SPUDAGToDAGISel - Cell SPU-specific code to select SPU machine
/// instructions for SelectionDAG operations.
@@ -336,6 +338,8 @@
#include "SPUGenDAGISel.inc"
};
+}
+
/// InstructionSelectBasicBlock - This callback is invoked by
/// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
void
Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original)
+++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Mon May 12 19:00:25 2008
@@ -70,10 +70,10 @@
cl::desc("Specify the name of the thing to generate"),
cl::init("!bad!"));
-namespace {
- // Register the target.
- RegisterTarget<CPPTargetMachine> X("cpp", " C++ backend");
+// Register the target.
+static RegisterTarget<CPPTargetMachine> X("cpp", " C++ backend");
+namespace {
typedef std::vector<const Type*> TypeList;
typedef std::map<const Type*,std::string> TypeMap;
typedef std::map<const Value*,std::string> ValueMap;
Modified: llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/IA64/IA64TargetMachine.cpp Mon May 12 19:00:25 2008
@@ -26,9 +26,7 @@
extern "C" int IA64TargetMachineModule;
int IA64TargetMachineModule = 0;
-namespace {
- RegisterTarget<IA64TargetMachine> X("ia64", " IA-64 (Itanium)");
-}
+static RegisterTarget<IA64TargetMachine> X("ia64", " IA-64 (Itanium)");
const TargetAsmInfo *IA64TargetMachine::createTargetAsmInfo() const {
return new IA64TargetAsmInfo(*this);
Modified: llvm/trunk/lib/Target/MSIL/MSILWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSIL/MSILWriter.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MSIL/MSILWriter.cpp (original)
+++ llvm/trunk/lib/Target/MSIL/MSILWriter.cpp Mon May 12 19:00:25 2008
@@ -46,7 +46,7 @@
}
-RegisterTarget<MSILTarget> X("msil", " MSIL backend");
+static RegisterTarget<MSILTarget> X("msil", " MSIL backend");
bool MSILModule::runOnModule(Module &M) {
ModulePtr = &M;
Modified: llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsTargetMachine.cpp Mon May 12 19:00:25 2008
@@ -19,10 +19,8 @@
#include "llvm/Target/TargetMachineRegistry.h"
using namespace llvm;
-namespace {
- // Register the target.
- RegisterTarget<MipsTargetMachine> X("mips", " Mips");
-}
+// Register the target.
+static RegisterTarget<MipsTargetMachine> X("mips", " Mips");
const TargetAsmInfo *MipsTargetMachine::
createTargetAsmInfo() const
Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Mon May 12 19:00:25 2008
@@ -1920,6 +1920,8 @@
DAG.getTargetLoweringInfo().getPointerTy()).Val;
}
+namespace {
+
struct TailCallArgumentInfo {
SDOperand Arg;
SDOperand FrameIdxOp;
@@ -1928,6 +1930,8 @@
TailCallArgumentInfo() : FrameIdx(0) {}
};
+}
+
/// StoreTailCallArgumentsToStackSlot - Stores arguments to their stack slot.
static void
StoreTailCallArgumentsToStackSlot(SelectionDAG &DAG,
Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp Mon May 12 19:00:25 2008
@@ -19,13 +19,11 @@
#include "llvm/Target/TargetMachineRegistry.h"
using namespace llvm;
-namespace {
- // Register the targets
- RegisterTarget<PPC32TargetMachine>
- X("ppc32", " PowerPC 32");
- RegisterTarget<PPC64TargetMachine>
- Y("ppc64", " PowerPC 64");
-}
+// Register the targets
+static RegisterTarget<PPC32TargetMachine>
+X("ppc32", " PowerPC 32");
+static RegisterTarget<PPC64TargetMachine>
+Y("ppc64", " PowerPC 64");
const TargetAsmInfo *PPCTargetMachine::createTargetAsmInfo() const {
if (Subtarget.isDarwin())
Modified: llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcTargetMachine.cpp Mon May 12 19:00:25 2008
@@ -18,10 +18,8 @@
#include "llvm/Target/TargetMachineRegistry.h"
using namespace llvm;
-namespace {
- // Register the target.
- RegisterTarget<SparcTargetMachine> X("sparc", " SPARC");
-}
+// Register the target.
+static RegisterTarget<SparcTargetMachine> X("sparc", " SPARC");
const TargetAsmInfo *SparcTargetMachine::createTargetAsmInfo() const {
return new SparcTargetAsmInfo(*this);
Modified: llvm/trunk/lib/Target/TargetData.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetData.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetData.cpp (original)
+++ llvm/trunk/lib/Target/TargetData.cpp Mon May 12 19:00:25 2008
@@ -30,11 +30,10 @@
using namespace llvm;
// Handle the Pass registration stuff necessary to use TargetData's.
-namespace {
- // Register the default SparcV9 implementation...
- RegisterPass<TargetData> X("targetdata", "Target Data Layout", false,
- true);
-}
+
+// Register the default SparcV9 implementation...
+static RegisterPass<TargetData> X("targetdata", "Target Data Layout", false,
+ true);
char TargetData::ID = 0;
//===----------------------------------------------------------------------===//
@@ -318,6 +317,8 @@
: Alignments[BestMatchIdx].PrefAlign;
}
+namespace {
+
/// LayoutInfo - The lazy cache of structure layout information maintained by
/// TargetData. Note that the struct types must have been free'd before
/// llvm_shutdown is called (and thus this is deallocated) because all the
@@ -342,8 +343,10 @@
};
typedef DenseMap<LayoutKey, StructLayout*, DenseMapLayoutKeyInfo> LayoutInfoTy;
-static ManagedStatic<LayoutInfoTy> LayoutInfo;
+}
+
+static ManagedStatic<LayoutInfoTy> LayoutInfo;
TargetData::~TargetData() {
if (LayoutInfo.isConstructed()) {
Modified: llvm/trunk/lib/Target/TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/TargetMachine.cpp Mon May 12 19:00:25 2008
@@ -39,117 +39,116 @@
bool RealignStack;
unsigned StackAlignment;
}
-namespace {
- static cl::opt<bool, true> PrintCode("print-machineinstrs",
- cl::desc("Print generated machine code"),
- cl::location(PrintMachineCode), cl::init(false));
-
- static cl::opt<bool, true>
- DisableFPElim("disable-fp-elim",
- cl::desc("Disable frame pointer elimination optimization"),
- cl::location(NoFramePointerElim),
- cl::init(false));
- static cl::opt<bool, true>
- DisableExcessPrecision("disable-excess-fp-precision",
- cl::desc("Disable optimizations that may increase FP precision"),
- cl::location(NoExcessFPPrecision),
- cl::init(false));
- static cl::opt<bool, true>
- EnableUnsafeFPMath("enable-unsafe-fp-math",
- cl::desc("Enable optimizations that may decrease FP precision"),
- cl::location(UnsafeFPMath),
- cl::init(false));
- static cl::opt<bool, true>
- EnableFiniteOnlyFPMath("enable-finite-only-fp-math",
- cl::desc("Enable optimizations that assumes non- NaNs / +-Infs"),
- cl::location(FiniteOnlyFPMathOption),
- cl::init(false));
- static cl::opt<bool, true>
- EnableHonorSignDependentRoundingFPMath(cl::Hidden,
- "enable-sign-dependent-rounding-fp-math",
- cl::desc("Force codegen to assume rounding mode can change dynamically"),
- cl::location(HonorSignDependentRoundingFPMathOption),
- cl::init(false));
-
- static cl::opt<bool, true>
- GenerateSoftFloatCalls("soft-float",
- cl::desc("Generate software floating point library calls"),
- cl::location(UseSoftFloat),
- cl::init(false));
- static cl::opt<bool, true>
- DontPlaceZerosInBSS("nozero-initialized-in-bss",
- cl::desc("Don't place zero-initialized symbols into bss section"),
- cl::location(NoZerosInBSS),
- cl::init(false));
- static cl::opt<bool, true>
- EnableExceptionHandling("enable-eh",
- cl::desc("Emit DWARF exception handling (default if target supports)"),
- cl::location(ExceptionHandling),
- cl::init(false));
- static cl::opt<bool, true>
- EnableUnwindTables("unwind-tables",
- cl::desc("Generate unwinding tables for all functions"),
- cl::location(UnwindTablesMandatory),
- cl::init(false));
-
- static cl::opt<llvm::Reloc::Model, true>
- DefRelocationModel(
- "relocation-model",
- cl::desc("Choose relocation model"),
- cl::location(RelocationModel),
- cl::init(Reloc::Default),
- cl::values(
- clEnumValN(Reloc::Default, "default",
- " Target default relocation model"),
- clEnumValN(Reloc::Static, "static",
- " Non-relocatable code"),
- clEnumValN(Reloc::PIC_, "pic",
- " Fully relocatable, position independent code"),
- clEnumValN(Reloc::DynamicNoPIC, "dynamic-no-pic",
- " Relocatable external references, non-relocatable code"),
- clEnumValEnd));
- static cl::opt<llvm::CodeModel::Model, true>
- DefCodeModel(
- "code-model",
- cl::desc("Choose code model"),
- cl::location(CMModel),
- cl::init(CodeModel::Default),
- cl::values(
- clEnumValN(CodeModel::Default, "default",
- " Target default code model"),
- clEnumValN(CodeModel::Small, "small",
- " Small code model"),
- clEnumValN(CodeModel::Kernel, "kernel",
- " Kernel code model"),
- clEnumValN(CodeModel::Medium, "medium",
- " Medium code model"),
- clEnumValN(CodeModel::Large, "large",
- " Large code model"),
- clEnumValEnd));
-
- static cl::opt<bool, true>
- EnablePerformTailCallOpt("tailcallopt",
- cl::desc("Turn on tail call optimization."),
- cl::location(PerformTailCallOpt),
- cl::init(false));
- static cl::opt<bool, true>
- EnableOptimizeForSize("optimize-size",
- cl::desc("Optimize for size."),
- cl::location(OptimizeForSize),
- cl::init(false));
-
- static cl::opt<bool, true>
- EnableRealignStack("realign-stack",
- cl::desc("Realign stack if needed"),
- cl::location(RealignStack),
- cl::init(true));
-
- static cl::opt<unsigned, true>
- OverrideStackAlignment("stack-alignment",
- cl::desc("Override default stack alignment"),
- cl::location(StackAlignment),
- cl::init(0));
-}
+
+static cl::opt<bool, true> PrintCode("print-machineinstrs",
+ cl::desc("Print generated machine code"),
+ cl::location(PrintMachineCode), cl::init(false));
+
+static cl::opt<bool, true>
+ DisableFPElim("disable-fp-elim",
+ cl::desc("Disable frame pointer elimination optimization"),
+ cl::location(NoFramePointerElim),
+ cl::init(false));
+static cl::opt<bool, true>
+DisableExcessPrecision("disable-excess-fp-precision",
+ cl::desc("Disable optimizations that may increase FP precision"),
+ cl::location(NoExcessFPPrecision),
+ cl::init(false));
+static cl::opt<bool, true>
+EnableUnsafeFPMath("enable-unsafe-fp-math",
+ cl::desc("Enable optimizations that may decrease FP precision"),
+ cl::location(UnsafeFPMath),
+ cl::init(false));
+static cl::opt<bool, true>
+EnableFiniteOnlyFPMath("enable-finite-only-fp-math",
+ cl::desc("Enable optimizations that assumes non- NaNs / +-Infs"),
+ cl::location(FiniteOnlyFPMathOption),
+ cl::init(false));
+static cl::opt<bool, true>
+EnableHonorSignDependentRoundingFPMath(cl::Hidden,
+ "enable-sign-dependent-rounding-fp-math",
+ cl::desc("Force codegen to assume rounding mode can change dynamically"),
+ cl::location(HonorSignDependentRoundingFPMathOption),
+ cl::init(false));
+
+static cl::opt<bool, true>
+GenerateSoftFloatCalls("soft-float",
+ cl::desc("Generate software floating point library calls"),
+ cl::location(UseSoftFloat),
+ cl::init(false));
+static cl::opt<bool, true>
+DontPlaceZerosInBSS("nozero-initialized-in-bss",
+ cl::desc("Don't place zero-initialized symbols into bss section"),
+ cl::location(NoZerosInBSS),
+ cl::init(false));
+static cl::opt<bool, true>
+EnableExceptionHandling("enable-eh",
+ cl::desc("Emit DWARF exception handling (default if target supports)"),
+ cl::location(ExceptionHandling),
+ cl::init(false));
+static cl::opt<bool, true>
+EnableUnwindTables("unwind-tables",
+ cl::desc("Generate unwinding tables for all functions"),
+ cl::location(UnwindTablesMandatory),
+ cl::init(false));
+
+static cl::opt<llvm::Reloc::Model, true>
+DefRelocationModel(
+ "relocation-model",
+ cl::desc("Choose relocation model"),
+ cl::location(RelocationModel),
+ cl::init(Reloc::Default),
+ cl::values(
+ clEnumValN(Reloc::Default, "default",
+ " Target default relocation model"),
+ clEnumValN(Reloc::Static, "static",
+ " Non-relocatable code"),
+ clEnumValN(Reloc::PIC_, "pic",
+ " Fully relocatable, position independent code"),
+ clEnumValN(Reloc::DynamicNoPIC, "dynamic-no-pic",
+ " Relocatable external references, non-relocatable code"),
+ clEnumValEnd));
+static cl::opt<llvm::CodeModel::Model, true>
+DefCodeModel(
+ "code-model",
+ cl::desc("Choose code model"),
+ cl::location(CMModel),
+ cl::init(CodeModel::Default),
+ cl::values(
+ clEnumValN(CodeModel::Default, "default",
+ " Target default code model"),
+ clEnumValN(CodeModel::Small, "small",
+ " Small code model"),
+ clEnumValN(CodeModel::Kernel, "kernel",
+ " Kernel code model"),
+ clEnumValN(CodeModel::Medium, "medium",
+ " Medium code model"),
+ clEnumValN(CodeModel::Large, "large",
+ " Large code model"),
+ clEnumValEnd));
+
+static cl::opt<bool, true>
+EnablePerformTailCallOpt("tailcallopt",
+ cl::desc("Turn on tail call optimization."),
+ cl::location(PerformTailCallOpt),
+ cl::init(false));
+static cl::opt<bool, true>
+EnableOptimizeForSize("optimize-size",
+ cl::desc("Optimize for size."),
+ cl::location(OptimizeForSize),
+ cl::init(false));
+
+static cl::opt<bool, true>
+EnableRealignStack("realign-stack",
+ cl::desc("Realign stack if needed"),
+ cl::location(RealignStack),
+ cl::init(true));
+
+static cl::opt<unsigned, true>
+OverrideStackAlignment("stack-alignment",
+ cl::desc("Override default stack alignment"),
+ cl::location(StackAlignment),
+ cl::init(0));
//---------------------------------------------------------------------------
// TargetMachine Class
Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Mon May 12 19:00:25 2008
@@ -19,7 +19,7 @@
#include "llvm/Target/TargetOptions.h"
using namespace llvm;
-cl::opt<X86Subtarget::AsmWriterFlavorTy>
+static cl::opt<X86Subtarget::AsmWriterFlavorTy>
AsmWriterFlavor("x86-asm-syntax", cl::init(X86Subtarget::Unset),
cl::desc("Choose style of code to emit from X86 backend:"),
cl::values(
Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Mon May 12 19:00:25 2008
@@ -30,13 +30,11 @@
extern "C" int X86TargetMachineModule;
int X86TargetMachineModule = 0;
-namespace {
- // Register the target.
- RegisterTarget<X86_32TargetMachine>
- X("x86", " 32-bit X86: Pentium-Pro and above");
- RegisterTarget<X86_64TargetMachine>
- Y("x86-64", " 64-bit X86: EM64T and AMD64");
-}
+// Register the target.
+static RegisterTarget<X86_32TargetMachine>
+X("x86", " 32-bit X86: Pentium-Pro and above");
+static RegisterTarget<X86_64TargetMachine>
+Y("x86-64", " 64-bit X86: EM64T and AMD64");
const TargetAsmInfo *X86TargetMachine::createTargetAsmInfo() const {
return new X86TargetAsmInfo(*this);
Modified: llvm/trunk/lib/Transforms/Hello/Hello.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Hello/Hello.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Hello/Hello.cpp (original)
+++ llvm/trunk/lib/Transforms/Hello/Hello.cpp Mon May 12 19:00:25 2008
@@ -36,10 +36,12 @@
return false;
}
};
+}
- char Hello::ID = 0;
- RegisterPass<Hello> X("hello", "Hello World Pass");
+char Hello::ID = 0;
+static RegisterPass<Hello> X("hello", "Hello World Pass");
+namespace {
// Hello2 - The second implementation with getAnalysisUsage implemented.
struct Hello2 : public FunctionPass {
static char ID; // Pass identification, replacement for typeid
@@ -58,7 +60,8 @@
AU.setPreservesAll();
};
};
- char Hello2::ID = 0;
- RegisterPass<Hello2> Y("hello2",
- "Hello World Pass (with getAnalysisUsage implemented)");
}
+
+char Hello2::ID = 0;
+static RegisterPass<Hello2>
+Y("hello2", "Hello World Pass (with getAnalysisUsage implemented)");
Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Mon May 12 19:00:25 2008
@@ -77,12 +77,12 @@
/// The maximum number of elements to expand, or 0 for unlimited.
unsigned maxElements;
};
-
- char ArgPromotion::ID = 0;
- RegisterPass<ArgPromotion> X("argpromotion",
- "Promote 'by reference' arguments to scalars");
}
+char ArgPromotion::ID = 0;
+static RegisterPass<ArgPromotion>
+X("argpromotion", "Promote 'by reference' arguments to scalars");
+
Pass *llvm::createArgumentPromotionPass(unsigned maxElements) {
return new ArgPromotion(maxElements);
}
Modified: llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp Mon May 12 19:00:25 2008
@@ -38,11 +38,12 @@
//
bool runOnModule(Module &M);
};
-
- char ConstantMerge::ID = 0;
- RegisterPass<ConstantMerge>X("constmerge","Merge Duplicate Global Constants");
}
+char ConstantMerge::ID = 0;
+static RegisterPass<ConstantMerge>
+X("constmerge", "Merge Duplicate Global Constants");
+
ModulePass *llvm::createConstantMergePass() { return new ConstantMerge(); }
bool ConstantMerge::runOnModule(Module &M) {
Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Mon May 12 19:00:25 2008
@@ -97,9 +97,13 @@
void RemoveDeadArgumentsFromFunction(Function *F);
};
- char DAE::ID = 0;
- RegisterPass<DAE> X("deadargelim", "Dead Argument Elimination");
+}
+
+char DAE::ID = 0;
+static RegisterPass<DAE>
+X("deadargelim", "Dead Argument Elimination");
+namespace {
/// DAH - DeadArgumentHacking pass - Same as dead argument elimination, but
/// deletes arguments to functions which are external. This is only for use
/// by bugpoint.
@@ -107,11 +111,12 @@
static char ID;
virtual bool ShouldHackArguments() const { return true; }
};
- char DAH::ID = 0;
- RegisterPass<DAH> Y("deadarghaX0r",
- "Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)");
}
+char DAH::ID = 0;
+static RegisterPass<DAH>
+Y("deadarghaX0r", "Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)");
+
/// createDeadArgEliminationPass - This pass removes arguments from functions
/// which are not used by the body of the function.
///
Modified: llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp Mon May 12 19:00:25 2008
@@ -43,10 +43,11 @@
AU.addRequired<FindUsedTypes>();
}
};
- char DTE::ID = 0;
- RegisterPass<DTE> X("deadtypeelim", "Dead Type Elimination");
}
+char DTE::ID = 0;
+static RegisterPass<DTE> X("deadtypeelim", "Dead Type Elimination");
+
ModulePass *llvm::createDeadTypeEliminationPass() {
return new DTE();
}
Modified: llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp Mon May 12 19:00:25 2008
@@ -49,10 +49,11 @@
bool SafeToDestroyConstant(Constant* C);
bool RemoveUnusedGlobalValue(GlobalValue &GV);
};
- char GlobalDCE::ID = 0;
- RegisterPass<GlobalDCE> X("globaldce", "Dead Global Elimination");
}
+char GlobalDCE::ID = 0;
+static RegisterPass<GlobalDCE> X("globaldce", "Dead Global Elimination");
+
ModulePass *llvm::createGlobalDCEPass() { return new GlobalDCE(); }
bool GlobalDCE::runOnModule(Module &M) {
Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Mon May 12 19:00:25 2008
@@ -68,13 +68,15 @@
bool OptimizeGlobalCtorsList(GlobalVariable *&GCL);
bool ProcessInternalGlobal(GlobalVariable *GV,Module::global_iterator &GVI);
};
-
- char GlobalOpt::ID = 0;
- RegisterPass<GlobalOpt> X("globalopt", "Global Variable Optimizer");
}
+char GlobalOpt::ID = 0;
+static RegisterPass<GlobalOpt> X("globalopt", "Global Variable Optimizer");
+
ModulePass *llvm::createGlobalOptimizerPass() { return new GlobalOpt(); }
+namespace {
+
/// GlobalStatus - As we analyze each global, keep track of some information
/// about it. If we find out that the address of the global is taken, none of
/// this info will be accurate.
@@ -129,7 +131,7 @@
HasNonInstructionUser(false), HasPHIUser(false) {}
};
-
+}
/// ConstantIsDead - Return true if the specified constant is (transitively)
/// dead. The constant may be used by other constants (e.g. constant arrays and
Modified: llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp Mon May 12 19:00:25 2008
@@ -42,10 +42,12 @@
bool PropagateConstantsIntoArguments(Function &F);
bool PropagateConstantReturn(Function &F);
};
- char IPCP::ID = 0;
- RegisterPass<IPCP> X("ipconstprop", "Interprocedural constant propagation");
}
+char IPCP::ID = 0;
+static RegisterPass<IPCP>
+X("ipconstprop", "Interprocedural constant propagation");
+
ModulePass *llvm::createIPConstantPropagationPass() { return new IPCP(); }
bool IPCP::runOnModule(Module &M) {
Modified: llvm/trunk/lib/Transforms/IPO/IndMemRemoval.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/IndMemRemoval.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/IndMemRemoval.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/IndMemRemoval.cpp Mon May 12 19:00:25 2008
@@ -37,10 +37,11 @@
virtual bool runOnModule(Module &M);
};
- char IndMemRemPass::ID = 0;
- RegisterPass<IndMemRemPass> X("indmemrem","Indirect Malloc and Free Removal");
} // end anonymous namespace
+char IndMemRemPass::ID = 0;
+static RegisterPass<IndMemRemPass>
+X("indmemrem","Indirect Malloc and Free Removal");
bool IndMemRemPass::runOnModule(Module &M) {
//in Theory, all direct calls of malloc and free should be promoted
Modified: llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp Mon May 12 19:00:25 2008
@@ -45,10 +45,12 @@
}
virtual bool doInitialization(CallGraph &CG);
};
- char SimpleInliner::ID = 0;
- RegisterPass<SimpleInliner> X("inline", "Function Integration/Inlining");
}
+char SimpleInliner::ID = 0;
+static RegisterPass<SimpleInliner>
+X("inline", "Function Integration/Inlining");
+
Pass *llvm::createFunctionInliningPass() { return new SimpleInliner(); }
Pass *llvm::createFunctionInliningPass(int Threshold) {
Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Mon May 12 19:00:25 2008
@@ -30,11 +30,9 @@
STATISTIC(NumInlined, "Number of functions inlined");
STATISTIC(NumDeleted, "Number of functions deleted because all callers found");
-namespace {
- static cl::opt<int>
- InlineLimit("inline-threshold", cl::Hidden, cl::init(200),
+static cl::opt<int>
+InlineLimit("inline-threshold", cl::Hidden, cl::init(200),
cl::desc("Control the amount of inlining to perform (default = 200)"));
-}
Inliner::Inliner(const void *ID)
: CallGraphSCCPass((intptr_t)ID), InlineThreshold(InlineLimit) {}
Modified: llvm/trunk/lib/Transforms/IPO/Internalize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Internalize.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/Internalize.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/Internalize.cpp Mon May 12 19:00:25 2008
@@ -28,20 +28,19 @@
STATISTIC(NumFunctions, "Number of functions internalized");
STATISTIC(NumGlobals , "Number of global vars internalized");
-namespace {
-
- // APIFile - A file which contains a list of symbols that should not be marked
- // external.
- static cl::opt<std::string>
- APIFile("internalize-public-api-file", cl::value_desc("filename"),
- cl::desc("A file containing list of symbol names to preserve"));
-
- // APIList - A list of symbols that should not be marked internal.
- static cl::list<std::string>
- APIList("internalize-public-api-list", cl::value_desc("list"),
- cl::desc("A list of symbol names to preserve"),
- cl::CommaSeparated);
+// APIFile - A file which contains a list of symbols that should not be marked
+// external.
+static cl::opt<std::string>
+APIFile("internalize-public-api-file", cl::value_desc("filename"),
+ cl::desc("A file containing list of symbol names to preserve"));
+
+// APIList - A list of symbols that should not be marked internal.
+static cl::list<std::string>
+APIList("internalize-public-api-list", cl::value_desc("list"),
+ cl::desc("A list of symbol names to preserve"),
+ cl::CommaSeparated);
+namespace {
class VISIBILITY_HIDDEN InternalizePass : public ModulePass {
std::set<std::string> ExternalNames;
bool DontInternalize;
@@ -52,10 +51,12 @@
void LoadFile(const char *Filename);
virtual bool runOnModule(Module &M);
};
- char InternalizePass::ID = 0;
- RegisterPass<InternalizePass> X("internalize", "Internalize Global Symbols");
} // end anonymous namespace
+char InternalizePass::ID = 0;
+static RegisterPass<InternalizePass>
+X("internalize", "Internalize Global Symbols");
+
InternalizePass::InternalizePass(bool InternalizeEverything)
: ModulePass((intptr_t)&ID), DontInternalize(false){
if (!APIFile.empty()) // If a filename is specified, use it
Modified: llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp Mon May 12 19:00:25 2008
@@ -52,22 +52,24 @@
AU.addRequired<LoopInfo>();
}
};
+}
- char LoopExtractor::ID = 0;
- RegisterPass<LoopExtractor>
- X("loop-extract", "Extract loops into new functions");
+char LoopExtractor::ID = 0;
+static RegisterPass<LoopExtractor>
+X("loop-extract", "Extract loops into new functions");
+namespace {
/// SingleLoopExtractor - For bugpoint.
struct SingleLoopExtractor : public LoopExtractor {
static char ID; // Pass identification, replacement for typeid
SingleLoopExtractor() : LoopExtractor(1) {}
};
-
- char SingleLoopExtractor::ID = 0;
- RegisterPass<SingleLoopExtractor>
- Y("loop-extract-single", "Extract at most one loop into a new function");
} // End anonymous namespace
+char SingleLoopExtractor::ID = 0;
+static RegisterPass<SingleLoopExtractor>
+Y("loop-extract-single", "Extract at most one loop into a new function");
+
// createLoopExtractorPass - This pass extracts all natural loops from the
// program into a function if it can.
//
@@ -146,14 +148,14 @@
}
-namespace {
- // BlockFile - A file which contains a list of blocks that should not be
- // extracted.
- static cl::opt<std::string>
- BlockFile("extract-blocks-file", cl::value_desc("filename"),
- cl::desc("A file containing list of basic blocks to not extract"),
- cl::Hidden);
+// BlockFile - A file which contains a list of blocks that should not be
+// extracted.
+static cl::opt<std::string>
+BlockFile("extract-blocks-file", cl::value_desc("filename"),
+ cl::desc("A file containing list of basic blocks to not extract"),
+ cl::Hidden);
+namespace {
/// BlockExtractorPass - This pass is used by bugpoint to extract all blocks
/// from the module into their own functions except for those specified by the
/// BlocksToNotExtract list.
@@ -173,12 +175,12 @@
bool runOnModule(Module &M);
};
-
- char BlockExtractorPass::ID = 0;
- RegisterPass<BlockExtractorPass>
- XX("extract-blocks", "Extract Basic Blocks From Module (for bugpoint use)");
}
+char BlockExtractorPass::ID = 0;
+static RegisterPass<BlockExtractorPass>
+XX("extract-blocks", "Extract Basic Blocks From Module (for bugpoint use)");
+
// createBlockExtractorPass - This pass extracts all blocks (except those
// specified in the argument list) from the functions in the module.
//
Modified: llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp Mon May 12 19:00:25 2008
@@ -122,11 +122,11 @@
bool runOnModule(Module& M);
bool doInitialization(Module& M);
};
-
- char LowerSetJmp::ID = 0;
- RegisterPass<LowerSetJmp> X("lowersetjmp", "Lower Set Jump");
} // end anonymous namespace
+char LowerSetJmp::ID = 0;
+static RegisterPass<LowerSetJmp> X("lowersetjmp", "Lower Set Jump");
+
// run - Run the transformation on the program. We grab the function
// prototypes for longjmp and setjmp. If they are used in the program,
// then we can go directly to the places they're at and transform them.
Modified: llvm/trunk/lib/Transforms/IPO/PruneEH.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PruneEH.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/PruneEH.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/PruneEH.cpp Mon May 12 19:00:25 2008
@@ -43,11 +43,12 @@
bool SimplifyFunction(Function *F);
void DeleteBasicBlock(BasicBlock *BB);
};
-
- char PruneEH::ID = 0;
- RegisterPass<PruneEH> X("prune-eh", "Remove unused exception handling info");
}
+char PruneEH::ID = 0;
+static RegisterPass<PruneEH>
+X("prune-eh", "Remove unused exception handling info");
+
Pass *llvm::createPruneEHPass() { return new PruneEH(); }
Modified: llvm/trunk/lib/Transforms/IPO/RaiseAllocations.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/RaiseAllocations.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/RaiseAllocations.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/RaiseAllocations.cpp Mon May 12 19:00:25 2008
@@ -48,12 +48,11 @@
//
bool runOnModule(Module &M);
};
-
- char RaiseAllocations::ID = 0;
- RegisterPass<RaiseAllocations>
- X("raiseallocs", "Raise allocations from calls to instructions");
} // end anonymous namespace
+char RaiseAllocations::ID = 0;
+static RegisterPass<RaiseAllocations>
+X("raiseallocs", "Raise allocations from calls to instructions");
// createRaiseAllocationsPass - The interface to this file...
ModulePass *llvm::createRaiseAllocationsPass() {
Modified: llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp Mon May 12 19:00:25 2008
@@ -34,12 +34,12 @@
virtual bool runOnModule(Module &M);
};
-char StripDeadPrototypesPass::ID = 0;
-RegisterPass<StripDeadPrototypesPass> X("strip-dead-prototypes",
- "Strip Unused Function Prototypes");
-
} // end anonymous namespace
+char StripDeadPrototypesPass::ID = 0;
+static RegisterPass<StripDeadPrototypesPass>
+X("strip-dead-prototypes", "Strip Unused Function Prototypes");
+
bool StripDeadPrototypesPass::runOnModule(Module &M) {
bool MadeChange = false;
Modified: llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp Mon May 12 19:00:25 2008
@@ -46,11 +46,12 @@
AU.setPreservesAll();
}
};
-
- char StripSymbols::ID = 0;
- RegisterPass<StripSymbols> X("strip", "Strip all symbols from a module");
}
+char StripSymbols::ID = 0;
+static RegisterPass<StripSymbols>
+X("strip", "Strip all symbols from a module");
+
ModulePass *llvm::createStripSymbolsPass(bool OnlyDebugInfo) {
return new StripSymbols(OnlyDebugInfo);
}
Modified: llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp Mon May 12 19:00:25 2008
@@ -58,12 +58,12 @@
void updateCallSites(Function *F, Function *NF);
bool nestedStructType(const StructType *STy);
};
-
- char SRETPromotion::ID = 0;
- RegisterPass<SRETPromotion> X("sretpromotion",
- "Promote sret arguments to multiple ret values");
}
+char SRETPromotion::ID = 0;
+static RegisterPass<SRETPromotion>
+X("sretpromotion", "Promote sret arguments to multiple ret values");
+
Pass *llvm::createStructRetPromotionPass() {
return new SRETPromotion();
}
Modified: llvm/trunk/lib/Transforms/Instrumentation/BlockProfiling.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/BlockProfiling.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/BlockProfiling.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/BlockProfiling.cpp Mon May 12 19:00:25 2008
@@ -36,14 +36,14 @@
static char ID;
bool runOnModule(Module &M);
};
+}
- char FunctionProfiler::ID = 0;
-
- RegisterPass<FunctionProfiler> X("insert-function-profiling",
- "Insert instrumentation for function profiling");
- RegisterAnalysisGroup<RSProfilers> XG(X);
+char FunctionProfiler::ID = 0;
-}
+static RegisterPass<FunctionProfiler>
+X("insert-function-profiling",
+ "Insert instrumentation for function profiling");
+static RegisterAnalysisGroup<RSProfilers> XG(X);
ModulePass *llvm::createFunctionProfilerPass() {
return new FunctionProfiler();
@@ -86,13 +86,13 @@
public:
static char ID;
};
-
- char BlockProfiler::ID = 0;
- RegisterPass<BlockProfiler> Y("insert-block-profiling",
- "Insert instrumentation for block profiling");
- RegisterAnalysisGroup<RSProfilers> YG(Y);
}
+char BlockProfiler::ID = 0;
+static RegisterPass<BlockProfiler>
+Y("insert-block-profiling", "Insert instrumentation for block profiling");
+static RegisterAnalysisGroup<RSProfilers> YG(Y);
+
ModulePass *llvm::createBlockProfilerPass() { return new BlockProfiler(); }
bool BlockProfiler::runOnModule(Module &M) {
Modified: llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp Mon May 12 19:00:25 2008
@@ -36,12 +36,12 @@
static char ID; // Pass identification, replacement for typeid
EdgeProfiler() : ModulePass((intptr_t)&ID) {}
};
-
- char EdgeProfiler::ID = 0;
- RegisterPass<EdgeProfiler> X("insert-edge-profiling",
- "Insert instrumentation for edge profiling");
}
+char EdgeProfiler::ID = 0;
+static RegisterPass<EdgeProfiler>
+X("insert-edge-profiling", "Insert instrumentation for edge profiling");
+
ModulePass *llvm::createEdgeProfilerPass() { return new EdgeProfiler(); }
bool EdgeProfiler::runOnModule(Module &M) {
Modified: llvm/trunk/lib/Transforms/Instrumentation/RSProfiling.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/RSProfiling.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/RSProfiling.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/RSProfiling.cpp Mon May 12 19:00:25 2008
@@ -55,16 +55,18 @@
enum RandomMeth {
GBV, GBVO, HOSTCC
};
+}
- static cl::opt<RandomMeth> RandomMethod("profile-randomness",
- cl::desc("How to randomly choose to profile:"),
- cl::values(
- clEnumValN(GBV, "global", "global counter"),
- clEnumValN(GBVO, "ra_global",
- "register allocated global counter"),
- clEnumValN(HOSTCC, "rdcc", "cycle counter"),
- clEnumValEnd));
+static cl::opt<RandomMeth> RandomMethod("profile-randomness",
+ cl::desc("How to randomly choose to profile:"),
+ cl::values(
+ clEnumValN(GBV, "global", "global counter"),
+ clEnumValN(GBVO, "ra_global",
+ "register allocated global counter"),
+ clEnumValN(HOSTCC, "rdcc", "cycle counter"),
+ clEnumValEnd));
+namespace {
/// NullProfilerRS - The basic profiler that does nothing. It is the default
/// profiler and thus terminates RSProfiler chains. It is useful for
/// measuring framework overhead
@@ -81,12 +83,14 @@
AU.setPreservesAll();
}
};
+}
- static RegisterAnalysisGroup<RSProfilers> A("Profiling passes");
- static RegisterPass<NullProfilerRS> NP("insert-null-profiling-rs",
- "Measure profiling framework overhead");
- static RegisterAnalysisGroup<RSProfilers, true> NPT(NP);
+static RegisterAnalysisGroup<RSProfilers> A("Profiling passes");
+static RegisterPass<NullProfilerRS> NP("insert-null-profiling-rs",
+ "Measure profiling framework overhead");
+static RegisterAnalysisGroup<RSProfilers, true> NPT(NP);
+namespace {
/// Chooser - Something that chooses when to make a sample of the profiled code
class VISIBILITY_HIDDEN Chooser {
public:
@@ -158,11 +162,12 @@
bool doInitialization(Module &M);
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
};
-
- RegisterPass<ProfilerRS> X("insert-rs-profiling-framework",
- "Insert random sampling instrumentation framework");
}
+static RegisterPass<ProfilerRS>
+X("insert-rs-profiling-framework",
+ "Insert random sampling instrumentation framework");
+
char RSProfilers::ID = 0;
char NullProfilerRS::ID = 0;
char ProfilerRS::ID = 0;
Modified: llvm/trunk/lib/Transforms/Scalar/ADCE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ADCE.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ADCE.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ADCE.cpp Mon May 12 19:00:25 2008
@@ -106,11 +106,11 @@
markInstructionLive(const_cast<TerminatorInst*>(BB->getTerminator()));
}
};
-
- char ADCE::ID = 0;
- RegisterPass<ADCE> X("adce", "Aggressive Dead Code Elimination");
} // End of anonymous namespace
+char ADCE::ID = 0;
+static RegisterPass<ADCE> X("adce", "Aggressive Dead Code Elimination");
+
FunctionPass *llvm::createAggressiveDCEPass() { return new ADCE(); }
void ADCE::markBlockAlive(BasicBlock *BB) {
Modified: llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp Mon May 12 19:00:25 2008
@@ -72,12 +72,12 @@
/// successors.
void PlaceBlocks(BasicBlock *BB);
};
-
- char BlockPlacement::ID = 0;
- RegisterPass<BlockPlacement> X("block-placement",
- "Profile Guided Basic Block Placement");
}
+char BlockPlacement::ID = 0;
+static RegisterPass<BlockPlacement>
+X("block-placement", "Profile Guided Basic Block Placement");
+
FunctionPass *llvm::createBlockPlacementPass() { return new BlockPlacement(); }
bool BlockPlacement::runOnFunction(Function &F) {
Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Mon May 12 19:00:25 2008
@@ -483,6 +483,7 @@
}
}
+namespace {
/// ExtAddrMode - This is an extended version of TargetLowering::AddrMode which
/// holds actual Value*'s for register values.
@@ -517,6 +518,8 @@
cerr << *this << "\n";
}
+}
+
static bool TryMatchingScaledValue(Value *ScaleReg, int64_t Scale,
const Type *AccessTy, ExtAddrMode &AddrMode,
SmallVector<Instruction*, 16> &AddrModeInsts,
Modified: llvm/trunk/lib/Transforms/Scalar/CondPropagate.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CondPropagate.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/CondPropagate.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/CondPropagate.cpp Mon May 12 19:00:25 2008
@@ -48,10 +48,10 @@
void SimplifyPredecessors(SwitchInst *SI);
void RevectorBlockTo(BasicBlock *FromBB, BasicBlock *ToBB);
};
-
- char CondProp::ID = 0;
- RegisterPass<CondProp> X("condprop", "Conditional Propagation");
}
+
+char CondProp::ID = 0;
+static RegisterPass<CondProp> X("condprop", "Conditional Propagation");
FunctionPass *llvm::createCondPropagationPass() {
return new CondProp();
Modified: llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp Mon May 12 19:00:25 2008
@@ -43,12 +43,12 @@
AU.setPreservesCFG();
}
};
-
- char ConstantPropagation::ID = 0;
- RegisterPass<ConstantPropagation> X("constprop",
- "Simple constant propagation");
}
+char ConstantPropagation::ID = 0;
+static RegisterPass<ConstantPropagation>
+X("constprop", "Simple constant propagation");
+
FunctionPass *llvm::createConstantPropagationPass() {
return new ConstantPropagation();
}
Modified: llvm/trunk/lib/Transforms/Scalar/DCE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DCE.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/DCE.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/DCE.cpp Mon May 12 19:00:25 2008
@@ -52,11 +52,12 @@
AU.setPreservesCFG();
}
};
-
- char DeadInstElimination::ID = 0;
- RegisterPass<DeadInstElimination> X("die", "Dead Instruction Elimination");
}
+char DeadInstElimination::ID = 0;
+static RegisterPass<DeadInstElimination>
+X("die", "Dead Instruction Elimination");
+
Pass *llvm::createDeadInstEliminationPass() {
return new DeadInstElimination();
}
@@ -76,11 +77,11 @@
AU.setPreservesCFG();
}
};
-
- char DCE::ID = 0;
- RegisterPass<DCE> Y("dce", "Dead Code Elimination");
}
+char DCE::ID = 0;
+static RegisterPass<DCE> Y("dce", "Dead Code Elimination");
+
bool DCE::runOnFunction(Function &F) {
// Start out with all of the instructions in the worklist...
std::vector<Instruction*> WorkList;
Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Mon May 12 19:00:25 2008
@@ -92,10 +92,11 @@
AU.addPreserved<MemoryDependenceAnalysis>();
}
};
- char DSE::ID = 0;
- RegisterPass<DSE> X("dse", "Dead Store Elimination");
}
+char DSE::ID = 0;
+static RegisterPass<DSE> X("dse", "Dead Store Elimination");
+
FunctionPass *llvm::createDeadStoreEliminationPass() { return new DSE(); }
bool DSE::runOnBasicBlock(BasicBlock &BB) {
Modified: llvm/trunk/lib/Transforms/Scalar/GCSE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GCSE.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GCSE.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GCSE.cpp Mon May 12 19:00:25 2008
@@ -52,11 +52,12 @@
AU.addRequired<ValueNumbering>();
}
};
-
- char GCSE::ID = 0;
- RegisterPass<GCSE> X("gcse", "Global Common Subexpression Elimination");
}
+char GCSE::ID = 0;
+static RegisterPass<GCSE>
+X("gcse", "Global Common Subexpression Elimination");
+
// createGCSEPass - The public interface to this file...
FunctionPass *llvm::createGCSEPass() { return new GCSE(); }
Modified: llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVNPRE.cpp Mon May 12 19:00:25 2008
@@ -45,6 +45,8 @@
// ValueTable Class
//===----------------------------------------------------------------------===//
+namespace {
+
/// This class holds the mapping between values and value numbers. It is used
/// as an efficient mechanism to determine the expression-wise equivalence of
/// two values.
@@ -123,6 +125,7 @@
}
};
+}
namespace {
class VISIBILITY_HIDDEN ValueTable {
@@ -596,6 +599,8 @@
return nextValueNumber;
}
+namespace {
+
//===----------------------------------------------------------------------===//
// ValueNumberedSet Class
//===----------------------------------------------------------------------===//
@@ -652,6 +657,8 @@
}
};
+}
+
//===----------------------------------------------------------------------===//
// GVNPRE Pass
//===----------------------------------------------------------------------===//
Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Mon May 12 19:00:25 2008
@@ -94,11 +94,12 @@
void DeleteTriviallyDeadInstructions(std::set<Instruction*> &Insts);
};
-
- char IndVarSimplify::ID = 0;
- RegisterPass<IndVarSimplify> X("indvars", "Canonicalize Induction Variables");
}
+char IndVarSimplify::ID = 0;
+static RegisterPass<IndVarSimplify>
+X("indvars", "Canonicalize Induction Variables");
+
LoopPass *llvm::createIndVarSimplifyPass() {
return new IndVarSimplify();
}
Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Mon May 12 19:00:25 2008
@@ -8,8 +8,8 @@
//===----------------------------------------------------------------------===//
//
// InstructionCombining - Combine instructions to form fewer, simple
-// instructions. This pass does not modify the CFG This pass is where algebraic
-// simplification happens.
+// instructions. This pass does not modify the CFG. This pass is where
+// algebraic simplification happens.
//
// This pass combines things like:
// %Y = add i32 %X, 1
@@ -384,11 +384,12 @@
unsigned GetOrEnforceKnownAlignment(Value *V,
unsigned PrefAlign = 0);
};
-
- char InstCombiner::ID = 0;
- RegisterPass<InstCombiner> X("instcombine", "Combine redundant instructions");
}
+char InstCombiner::ID = 0;
+static RegisterPass<InstCombiner>
+X("instcombine", "Combine redundant instructions");
+
// getComplexity: Assign a complexity or rank value to LLVM Values...
// 0 -> undef, 1 -> Const, 2 -> Other, 3 -> Arg, 3 -> Unary, 4 -> OtherInst
static unsigned getComplexity(Value *V) {
@@ -2151,6 +2152,7 @@
return 0;
}
+namespace {
// AddRHS - Implements: X + X --> X << 1
struct AddRHS {
@@ -2178,6 +2180,8 @@
}
};
+}
+
static Value *FoldOperationIntoSelectOperand(Instruction &I, Value *SO,
InstCombiner *IC) {
if (CastInst *CI = dyn_cast<CastInst>(&I)) {
@@ -4635,6 +4639,8 @@
return Changed ? &I : 0;
}
+namespace {
+
// XorSelf - Implements: X ^ X --> 0
struct XorSelf {
Value *RHS;
@@ -4645,6 +4651,7 @@
}
};
+}
Instruction *InstCombiner::visitXor(BinaryOperator &I) {
bool Changed = SimplifyCommutative(I);
Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Mon May 12 19:00:25 2008
@@ -63,10 +63,12 @@
bool ProcessBranchOnLogical(Value *V, BasicBlock *BB, bool isAnd);
bool ProcessBranchOnCompare(CmpInst *Cmp, BasicBlock *BB);
};
- char JumpThreading::ID = 0;
- RegisterPass<JumpThreading> X("jump-threading", "Jump Threading");
}
+char JumpThreading::ID = 0;
+static RegisterPass<JumpThreading>
+X("jump-threading", "Jump Threading");
+
// Public interface to the Jump Threading pass
FunctionPass *llvm::createJumpThreadingPass() { return new JumpThreading(); }
Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Mon May 12 19:00:25 2008
@@ -58,11 +58,11 @@
STATISTIC(NumMovedCalls, "Number of call insts hoisted or sunk");
STATISTIC(NumPromoted , "Number of memory locations promoted to registers");
-namespace {
- static cl::opt<bool>
- DisablePromotion("disable-licm-promotion", cl::Hidden,
- cl::desc("Disable memory promotion in LICM pass"));
+static cl::opt<bool>
+DisablePromotion("disable-licm-promotion", cl::Hidden,
+ cl::desc("Disable memory promotion in LICM pass"));
+namespace {
struct VISIBILITY_HIDDEN LICM : public LoopPass {
static char ID; // Pass identification, replacement for typeid
LICM() : LoopPass((intptr_t)&ID) {}
@@ -216,11 +216,11 @@
std::vector<std::pair<AllocaInst*, Value*> > &PromotedValues,
std::map<Value*, AllocaInst*> &Val2AlMap);
};
-
- char LICM::ID = 0;
- RegisterPass<LICM> X("licm", "Loop Invariant Code Motion");
}
+char LICM::ID = 0;
+static RegisterPass<LICM> X("licm", "Loop Invariant Code Motion");
+
LoopPass *llvm::createLICMPass() { return new LICM(); }
/// Hoist expressions out of the specified loop. Note, alias info for inner
Modified: llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp Mon May 12 19:00:25 2008
@@ -52,10 +52,10 @@
AU.addPreservedID(LCSSAID);
}
};
-
- char LoopDeletion::ID = 0;
- RegisterPass<LoopDeletion> X ("loop-deletion", "Delete dead loops");
}
+
+char LoopDeletion::ID = 0;
+static RegisterPass<LoopDeletion> X("loop-deletion", "Delete dead loops");
LoopPass* llvm::createLoopDeletionPass() {
return new LoopDeletion();
Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Mon May 12 19:00:25 2008
@@ -195,11 +195,12 @@
// Induction variable's final loop exit value operand number in exit condition..
unsigned ExitValueNum;
};
-
- char LoopIndexSplit::ID = 0;
- RegisterPass<LoopIndexSplit> X ("loop-index-split", "Index Split Loops");
}
+char LoopIndexSplit::ID = 0;
+static RegisterPass<LoopIndexSplit>
+X("loop-index-split", "Index Split Loops");
+
LoopPass *llvm::createLoopIndexSplitPass() {
return new LoopIndexSplit();
}
Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp Mon May 12 19:00:25 2008
@@ -102,10 +102,10 @@
LPPassManager *LPM_Ptr;
SmallVector<RenameData, MAX_HEADER_SIZE> LoopHeaderInfo;
};
-
- char LoopRotate::ID = 0;
- RegisterPass<LoopRotate> X ("loop-rotate", "Rotate Loops");
}
+
+char LoopRotate::ID = 0;
+static RegisterPass<LoopRotate> X("loop-rotate", "Rotate Loops");
LoopPass *llvm::createLoopRotatePass() { return new LoopRotate(); }
Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon May 12 19:00:25 2008
@@ -194,10 +194,12 @@
Loop *L, bool isOnlyStride);
void DeleteTriviallyDeadInstructions(SmallPtrSet<Instruction*,16> &Insts);
};
- char LoopStrengthReduce::ID = 0;
- RegisterPass<LoopStrengthReduce> X("loop-reduce", "Loop Strength Reduction");
}
+char LoopStrengthReduce::ID = 0;
+static RegisterPass<LoopStrengthReduce>
+X("loop-reduce", "Loop Strength Reduction");
+
LoopPass *llvm::createLoopStrengthReducePass(const TargetLowering *TLI) {
return new LoopStrengthReduce(TLI);
}
Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp Mon May 12 19:00:25 2008
@@ -44,17 +44,15 @@
STATISTIC(NumCompletelyUnrolled, "Number of loops completely unrolled");
STATISTIC(NumUnrolled, "Number of loops unrolled (completely or otherwise)");
-namespace {
- static cl::opt<unsigned>
- UnrollThreshold
- ("unroll-threshold", cl::init(100), cl::Hidden,
- cl::desc("The cut-off point for automatic loop unrolling"));
-
- static cl::opt<unsigned>
- UnrollCount
- ("unroll-count", cl::init(0), cl::Hidden,
- cl::desc("Use this unroll count for all loops, for testing purposes"));
+static cl::opt<unsigned>
+UnrollThreshold("unroll-threshold", cl::init(100), cl::Hidden,
+ cl::desc("The cut-off point for automatic loop unrolling"));
+
+static cl::opt<unsigned>
+UnrollCount("unroll-count", cl::init(0), cl::Hidden,
+ cl::desc("Use this unroll count for all loops, for testing purposes"));
+namespace {
class VISIBILITY_HIDDEN LoopUnroll : public LoopPass {
LoopInfo *LI; // The current loop information
public:
@@ -81,10 +79,11 @@
AU.addPreserved<LoopInfo>();
}
};
- char LoopUnroll::ID = 0;
- RegisterPass<LoopUnroll> X("loop-unroll", "Unroll loops");
}
+char LoopUnroll::ID = 0;
+static RegisterPass<LoopUnroll> X("loop-unroll", "Unroll loops");
+
LoopPass *llvm::createLoopUnrollPass() { return new LoopUnroll(); }
/// ApproximateLoopSize - Approximate the size of the loop.
Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Mon May 12 19:00:25 2008
@@ -54,11 +54,11 @@
STATISTIC(NumTrivial , "Number of unswitches that are trivial");
STATISTIC(NumSimplify, "Number of simplifications of unswitched code");
-namespace {
- static cl::opt<unsigned>
- Threshold("loop-unswitch-threshold", cl::desc("Max loop size to unswitch"),
- cl::init(10), cl::Hidden);
+static cl::opt<unsigned>
+Threshold("loop-unswitch-threshold", cl::desc("Max loop size to unswitch"),
+ cl::init(10), cl::Hidden);
+namespace {
class VISIBILITY_HIDDEN LoopUnswitch : public LoopPass {
LoopInfo *LI; // Loop information
LPPassManager *LPM;
@@ -144,9 +144,9 @@
std::vector<Instruction*> &Worklist, Loop *l);
void RemoveLoopFromHierarchy(Loop *L);
};
- char LoopUnswitch::ID = 0;
- RegisterPass<LoopUnswitch> X("loop-unswitch", "Unswitch loops");
}
+char LoopUnswitch::ID = 0;
+static RegisterPass<LoopUnswitch> X("loop-unswitch", "Unswitch loops");
LoopPass *llvm::createLoopUnswitchPass(bool Os) {
return new LoopUnswitch(Os);
@@ -459,11 +459,11 @@
// OrigPreheader is loop pre-header before this pass started
// updating CFG. NewPrehader is loops new pre-header. However, after CFG
// manipulation, loop L may not exist. So rely on input parameter NewPreheader.
-void CloneDomInfo(BasicBlock *NewBB, BasicBlock *Orig,
- BasicBlock *NewPreheader, BasicBlock *OrigPreheader,
- BasicBlock *OrigHeader,
- DominatorTree *DT, DominanceFrontier *DF,
- DenseMap<const Value*, Value*> &VM) {
+static void CloneDomInfo(BasicBlock *NewBB, BasicBlock *Orig,
+ BasicBlock *NewPreheader, BasicBlock *OrigPreheader,
+ BasicBlock *OrigHeader,
+ DominatorTree *DT, DominanceFrontier *DF,
+ DenseMap<const Value*, Value*> &VM) {
// If NewBB alreay has found its place in domiantor tree then no need to do
// anything.
Modified: llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp Mon May 12 19:00:25 2008
@@ -2646,12 +2646,12 @@
}
}
}
-
- char PredicateSimplifier::ID = 0;
- RegisterPass<PredicateSimplifier> X("predsimplify",
- "Predicate Simplifier");
}
+char PredicateSimplifier::ID = 0;
+static RegisterPass<PredicateSimplifier>
+X("predsimplify", "Predicate Simplifier");
+
FunctionPass *llvm::createPredicateSimplifierPass() {
return new PredicateSimplifier();
}
Modified: llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp Mon May 12 19:00:25 2008
@@ -64,7 +64,7 @@
<< "," << Ops[i].Rank;
}
-namespace {
+namespace {
class VISIBILITY_HIDDEN Reassociate : public FunctionPass {
std::map<BasicBlock*, unsigned> RankMap;
std::map<Value*, unsigned> ValueRankMap;
@@ -92,11 +92,11 @@
void RemoveDeadBinaryOp(Value *V);
};
-
- char Reassociate::ID = 0;
- RegisterPass<Reassociate> X("reassociate", "Reassociate expressions");
}
+char Reassociate::ID = 0;
+static RegisterPass<Reassociate> X("reassociate", "Reassociate expressions");
+
// Public interface to the Reassociate pass
FunctionPass *llvm::createReassociatePass() { return new Reassociate(); }
Modified: llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp Mon May 12 19:00:25 2008
@@ -111,10 +111,11 @@
return false;
}
};
-
- char RegToMem::ID = 0;
- RegisterPass<RegToMem> X("reg2mem", "Demote all values to stack slots");
}
+
+char RegToMem::ID = 0;
+static RegisterPass<RegToMem>
+X("reg2mem", "Demote all values to stack slots");
// createDemoteRegisterToMemory - Provide an entry point to create this pass.
//
Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SCCP.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Mon May 12 19:00:25 2008
@@ -1435,11 +1435,11 @@
AU.setPreservesCFG();
}
};
-
- char SCCP::ID = 0;
- RegisterPass<SCCP> X("sccp", "Sparse Conditional Constant Propagation");
} // end anonymous namespace
+char SCCP::ID = 0;
+static RegisterPass<SCCP>
+X("sccp", "Sparse Conditional Constant Propagation");
// createSCCPPass - This is the public interface to this file...
FunctionPass *llvm::createSCCPPass() {
@@ -1543,12 +1543,12 @@
IPSCCP() : ModulePass((intptr_t)&ID) {}
bool runOnModule(Module &M);
};
-
- char IPSCCP::ID = 0;
- RegisterPass<IPSCCP>
- Y("ipsccp", "Interprocedural Sparse Conditional Constant Propagation");
} // end anonymous namespace
+char IPSCCP::ID = 0;
+static RegisterPass<IPSCCP>
+Y("ipsccp", "Interprocedural Sparse Conditional Constant Propagation");
+
// createIPSCCPPass - This is the public interface to this file...
ModulePass *llvm::createIPSCCPPass() {
return new IPSCCP();
Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Mon May 12 19:00:25 2008
@@ -124,11 +124,11 @@
unsigned Offset);
static Instruction *isOnlyCopiedFromConstantGlobal(AllocationInst *AI);
};
-
- char SROA::ID = 0;
- RegisterPass<SROA> X("scalarrepl", "Scalar Replacement of Aggregates");
}
+char SROA::ID = 0;
+static RegisterPass<SROA> X("scalarrepl", "Scalar Replacement of Aggregates");
+
// Public interface to the ScalarReplAggregates pass
FunctionPass *llvm::createScalarReplAggregatesPass(signed int Threshold) {
return new SROA(Threshold);
Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SimplifyCFG.cpp Mon May 12 19:00:25 2008
@@ -45,10 +45,11 @@
virtual bool runOnFunction(Function &F);
};
- char CFGSimplifyPass::ID = 0;
- RegisterPass<CFGSimplifyPass> X("simplifycfg", "Simplify the CFG");
}
+char CFGSimplifyPass::ID = 0;
+static RegisterPass<CFGSimplifyPass> X("simplifycfg", "Simplify the CFG");
+
// Public interface to the CFGSimplification pass
FunctionPass *llvm::createCFGSimplificationPass() {
return new CFGSimplifyPass();
Modified: llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp Mon May 12 19:00:25 2008
@@ -37,10 +37,11 @@
STATISTIC(NumEliminated, "Number of unconditional branches eliminated");
+static cl::opt<unsigned>
+Threshold("taildup-threshold", cl::desc("Max block size to tail duplicate"),
+ cl::init(6), cl::Hidden);
+
namespace {
- cl::opt<unsigned>
- Threshold("taildup-threshold", cl::desc("Max block size to tail duplicate"),
- cl::init(6), cl::Hidden);
class VISIBILITY_HIDDEN TailDup : public FunctionPass {
bool runOnFunction(Function &F);
public:
@@ -51,10 +52,11 @@
inline bool shouldEliminateUnconditionalBranch(TerminatorInst *TI);
inline void eliminateUnconditionalBranch(BranchInst *BI);
};
- char TailDup::ID = 0;
- RegisterPass<TailDup> X("tailduplicate", "Tail Duplication");
}
+char TailDup::ID = 0;
+static RegisterPass<TailDup> X("tailduplicate", "Tail Duplication");
+
// Public interface to the Tail Duplication pass
FunctionPass *llvm::createTailDuplicationPass() { return new TailDup(); }
Modified: llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp Mon May 12 19:00:25 2008
@@ -80,10 +80,11 @@
bool CanMoveAboveCall(Instruction *I, CallInst *CI);
Value *CanTransformAccumulatorRecursion(Instruction *I, CallInst *CI);
};
- char TailCallElim::ID = 0;
- RegisterPass<TailCallElim> X("tailcallelim", "Tail Call Elimination");
}
+char TailCallElim::ID = 0;
+static RegisterPass<TailCallElim> X("tailcallelim", "Tail Call Elimination");
+
// Public interface to the TailCallElimination pass
FunctionPass *llvm::createTailCallEliminationPass() {
return new TailCallElim();
Modified: llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp Mon May 12 19:00:25 2008
@@ -26,11 +26,9 @@
using namespace llvm;
-namespace {
- static cl::opt<unsigned>
- BasicInlineThreshold("inline-threshold", cl::Hidden, cl::init(200),
- cl::desc("Control the amount of basic inlining to perform (default = 200)"));
-}
+static cl::opt<unsigned>
+BasicInlineThreshold("inline-threshold", cl::Hidden, cl::init(200),
+ cl::desc("Control the amount of basic inlining to perform (default = 200)"));
namespace llvm {
Modified: llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp Mon May 12 19:00:25 2008
@@ -48,12 +48,12 @@
AU.addPreservedID(LoopSimplifyID);
}
};
-
- char BreakCriticalEdges::ID = 0;
- RegisterPass<BreakCriticalEdges> X("break-crit-edges",
- "Break critical edges in CFG");
}
+char BreakCriticalEdges::ID = 0;
+static RegisterPass<BreakCriticalEdges>
+X("break-crit-edges", "Break critical edges in CFG");
+
// Publically exposed interface to pass...
const PassInfo *llvm::BreakCriticalEdgesID = X.getPassInfo();
FunctionPass *llvm::createBreakCriticalEdgesPass() {
Modified: llvm/trunk/lib/Transforms/Utils/LCSSA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LCSSA.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LCSSA.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LCSSA.cpp Mon May 12 19:00:25 2008
@@ -94,10 +94,10 @@
return std::binary_search(LoopBlocks.begin(), LoopBlocks.end(), B);
}
};
-
- char LCSSA::ID = 0;
- RegisterPass<LCSSA> X("lcssa", "Loop-Closed SSA Form Pass");
}
+
+char LCSSA::ID = 0;
+static RegisterPass<LCSSA> X("lcssa", "Loop-Closed SSA Form Pass");
LoopPass *llvm::createLCSSAPass() { return new LCSSA(); }
const PassInfo *llvm::LCSSAID = X.getPassInfo();
Modified: llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp Mon May 12 19:00:25 2008
@@ -95,12 +95,12 @@
SmallVectorImpl<BasicBlock*> &SplitPreds,
Loop *L);
};
-
- char LoopSimplify::ID = 0;
- RegisterPass<LoopSimplify>
- X("loopsimplify", "Canonicalize natural loops", true);
}
+char LoopSimplify::ID = 0;
+static RegisterPass<LoopSimplify>
+X("loopsimplify", "Canonicalize natural loops", true);
+
// Publically exposed interface to pass...
const PassInfo *llvm::LoopSimplifyID = X.getPassInfo();
FunctionPass *llvm::createLoopSimplifyPass() { return new LoopSimplify(); }
Modified: llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp Mon May 12 19:00:25 2008
@@ -66,12 +66,12 @@
///
bool runOnBasicBlock(BasicBlock &BB);
};
-
- char LowerAllocations::ID = 0;
- RegisterPass<LowerAllocations>
- X("lowerallocs", "Lower allocations from instructions to calls");
}
+char LowerAllocations::ID = 0;
+static RegisterPass<LowerAllocations>
+X("lowerallocs", "Lower allocations from instructions to calls");
+
// Publically exposed interface to pass...
const PassInfo *llvm::LowerAllocationsID = X.getPassInfo();
// createLowerAllocationsPass - Interface to this file...
Modified: llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp Mon May 12 19:00:25 2008
@@ -98,12 +98,12 @@
AllocaInst *InvokeNum, SwitchInst *CatchSwitch);
bool insertExpensiveEHSupport(Function &F);
};
-
- char LowerInvoke::ID = 0;
- RegisterPass<LowerInvoke>
- X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators");
}
+char LowerInvoke::ID = 0;
+static RegisterPass<LowerInvoke>
+X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators");
+
const PassInfo *llvm::LowerInvokePassID = X.getPassInfo();
// Public Interface To the LowerInvoke pass.
Modified: llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp Mon May 12 19:00:25 2008
@@ -77,12 +77,12 @@
return CI1->getValue().slt(CI2->getValue());
}
};
-
- char LowerSwitch::ID = 0;
- RegisterPass<LowerSwitch>
- X("lowerswitch", "Lower SwitchInst's to branches");
}
+char LowerSwitch::ID = 0;
+static RegisterPass<LowerSwitch>
+X("lowerswitch", "Lower SwitchInst's to branches");
+
// Publically exposed interface to pass...
const PassInfo *llvm::LowerSwitchID = X.getPassInfo();
// createLowerSwitchPass - Interface to this file...
Modified: llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp Mon May 12 19:00:25 2008
@@ -48,11 +48,11 @@
AU.addPreservedID(LowerAllocationsID);
}
};
-
- char PromotePass::ID = 0;
- RegisterPass<PromotePass> X("mem2reg", "Promote Memory to Register");
} // end of anonymous namespace
+char PromotePass::ID = 0;
+static RegisterPass<PromotePass> X("mem2reg", "Promote Memory to Register");
+
bool PromotePass::runOnFunction(Function &F) {
std::vector<AllocaInst*> Allocas;
Modified: llvm/trunk/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Constants.cpp (original)
+++ llvm/trunk/lib/VMCore/Constants.cpp Mon May 12 19:00:25 2008
@@ -1514,6 +1514,8 @@
//---- ConstantExpr::get() implementations...
//
+namespace {
+
struct ExprMapKeyType {
explicit ExprMapKeyType(unsigned opc, std::vector<Constant*> ops,
unsigned short pred = 0) : opcode(opc), predicate(pred), operands(ops) { }
@@ -1537,6 +1539,8 @@
}
};
+}
+
namespace llvm {
template<>
struct ConstantCreator<ConstantExpr, Type, ExprMapKeyType> {
Modified: llvm/trunk/lib/VMCore/PassManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/PassManager.cpp (original)
+++ llvm/trunk/lib/VMCore/PassManager.cpp Mon May 12 19:00:25 2008
@@ -360,10 +360,10 @@
}
};
-static TimingInfo *TheTimeInfo;
-
} // End of anon namespace
+static TimingInfo *TheTimeInfo;
+
//===----------------------------------------------------------------------===//
// PMTopLevelManager implementation
Modified: llvm/trunk/lib/VMCore/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Type.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Type.cpp (original)
+++ llvm/trunk/lib/VMCore/Type.cpp Mon May 12 19:00:25 2008
@@ -550,6 +550,7 @@
}
+namespace {
/// TypePromotionGraph and graph traits - this is designed to allow us to do
/// efficient SCC processing of type graphs. This is the exact same as
@@ -560,6 +561,8 @@
TypePromotionGraph(Type *T) : Ty(T) {}
};
+}
+
namespace llvm {
template <> struct GraphTraits<TypePromotionGraph> {
typedef Type NodeType;
Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=51017&r1=51016&r2=51017&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Mon May 12 19:00:25 2008
@@ -92,11 +92,14 @@
return false;
}
};
+}
- char PreVerifier::ID = 0;
- RegisterPass<PreVerifier> PreVer("preverify", "Preliminary module verification");
- const PassInfo *PreVerifyID = PreVer.getPassInfo();
+char PreVerifier::ID = 0;
+static RegisterPass<PreVerifier>
+PreVer("preverify", "Preliminary module verification");
+static const PassInfo *PreVerifyID = PreVer.getPassInfo();
+namespace {
struct VISIBILITY_HIDDEN
Verifier : public FunctionPass, InstVisitor<Verifier> {
static char ID; // Pass ID, replacement for typeid
@@ -305,11 +308,10 @@
Broken = true;
}
};
-
- char Verifier::ID = 0;
- RegisterPass<Verifier> X("verify", "Module Verifier");
} // End anonymous namespace
+char Verifier::ID = 0;
+static RegisterPass<Verifier> X("verify", "Module Verifier");
// Assert - We know that cond should be true, if not print an error message.
#define Assert(C, M) \
More information about the llvm-commits
mailing list