Finegrainify namespacification
authorChris Lattner <sabre@nondot.org>
Fri, 21 Nov 2003 21:54:22 +0000 (21:54 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 21 Nov 2003 21:54:22 +0000 (21:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10138 91177308-0d34-0410-b5e6-96231b3b80d8

12 files changed:
lib/Analysis/DataStructure/Parallelize.cpp
lib/Transforms/IPO/ConstantMerge.cpp
lib/Transforms/IPO/DeadArgumentElimination.cpp
lib/Transforms/IPO/DeadTypeElimination.cpp
lib/Transforms/IPO/ExtractFunction.cpp
lib/Transforms/IPO/GlobalDCE.cpp
lib/Transforms/IPO/IPConstantPropagation.cpp
lib/Transforms/IPO/Internalize.cpp
lib/Transforms/IPO/LowerSetJmp.cpp
lib/Transforms/IPO/Parallelize.cpp
lib/Transforms/IPO/PruneEH.cpp
lib/Transforms/IPO/RaiseAllocations.cpp

index fd39b6b12a5e0786f135435df65c25883ca515d7..e22c86cb7fe47bedfe6d22b6ff291529d8fed247 100644 (file)
@@ -52,8 +52,7 @@
 #include "Support/hash_map"
 #include <functional>
 #include <algorithm>
-
-namespace llvm {
+using namespace llvm;
 
 //---------------------------------------------------------------------------- 
 // Global constants used in marking Cilk functions and function calls.
@@ -538,4 +537,3 @@ bool Parallelize::run(Module& M)
   return true;
 }
 
-} // End llvm namespace
index 498cd7bb1424bec911b87209d2e627f421128930..2ae61fac6e05cbc34e431705241ad867e12ba311 100644 (file)
@@ -21,8 +21,7 @@
 #include "llvm/Module.h"
 #include "llvm/Pass.h"
 #include "Support/Statistic.h"
-
-namespace llvm {
+using namespace llvm;
 
 namespace {
   Statistic<> NumMerged("constmerge", "Number of global constants merged");
@@ -37,7 +36,7 @@ namespace {
   RegisterOpt<ConstantMerge> X("constmerge","Merge Duplicate Global Constants");
 }
 
-Pass *createConstantMergePass() { return new ConstantMerge(); }
+Pass *llvm::createConstantMergePass() { return new ConstantMerge(); }
 
 bool ConstantMerge::run(Module &M) {
   std::map<Constant*, GlobalVariable*> CMap;
@@ -80,4 +79,3 @@ bool ConstantMerge::run(Module &M) {
   return MadeChanges;
 }
 
-} // End llvm namespace
index 197710d65027c18007ff99fd204fde4fbc305f16..f90960fc04eb6687e79ffd5d1c4f1bd939f73434 100644 (file)
@@ -29,8 +29,7 @@
 #include "Support/Statistic.h"
 #include "Support/iterator"
 #include <set>
-
-namespace llvm {
+using namespace llvm;
 
 namespace {
   Statistic<> NumArgumentsEliminated("deadargelim",
@@ -108,8 +107,8 @@ namespace {
 /// createDeadArgEliminationPass - This pass removes arguments from functions
 /// which are not used by the body of the function.
 ///
-Pass *createDeadArgEliminationPass() { return new DAE(); }
-Pass *createDeadArgHackingPass() { return new DAH(); }
+Pass *llvm::createDeadArgEliminationPass() { return new DAE(); }
+Pass *llvm::createDeadArgHackingPass() { return new DAH(); }
 
 static inline bool CallPassesValueThoughVararg(Instruction *Call,
                                                const Value *Arg) {
@@ -578,6 +577,3 @@ bool DAE::run(Module &M) {
     RemoveDeadArgumentsFromFunction(*DeadRetVal.begin());
   return true;
 }
-
-} // End llvm namespace
-
index 126991d3e694e111b87aee9c418dc43be0d75dd8..8849a025a0a312bf64328705f4cec3d8e70ccf47 100644 (file)
@@ -18,8 +18,7 @@
 #include "llvm/SymbolTable.h"
 #include "llvm/DerivedTypes.h"
 #include "Support/Statistic.h"
-
-namespace llvm {
+using namespace llvm;
 
 namespace {
   struct DTE : public Pass {
@@ -42,7 +41,7 @@ namespace {
   NumKilled("deadtypeelim", "Number of unused typenames removed from symtab");
 }
 
-Pass *createDeadTypeEliminationPass() {
+Pass *llvm::createDeadTypeEliminationPass() {
   return new DTE();
 }
 
@@ -96,5 +95,3 @@ bool DTE::run(Module &M) {
 
   return Changed;
 }
-
-} // End llvm namespace
index 4e61a3433a0de4db92b851ae346eaf98a3b3ead4..f98c6197dcaccff3f289ce15e5c2067e14ee5feb 100644 (file)
@@ -6,11 +6,11 @@
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
 // 
 //===----------------------------------------------------------------------===//
+
 #include "llvm/Transforms/IPO.h"
 #include "llvm/Pass.h"
 #include "llvm/Module.h"
-
-namespace llvm {
+using namespace llvm;
 
 namespace {
   class FunctionExtractorPass : public Pass {
@@ -89,8 +89,6 @@ namespace {
   RegisterPass<FunctionExtractorPass> X("extract", "Function Extractor");
 }
 
-Pass *createFunctionExtractionPass(Function *F) {
+Pass *llvm::createFunctionExtractionPass(Function *F) {
   return new FunctionExtractorPass(F);
 }
-
-} // End llvm namespace
index 8e7920dc1b681231d3b0c3f8559358faee108b60..8444a452af235e62dcd4d491e25740ff7ee2518e 100644 (file)
@@ -21,8 +21,7 @@
 #include "llvm/Pass.h"
 #include "Support/Statistic.h"
 #include <set>
-
-namespace llvm {
+using namespace llvm;
 
 namespace {
   Statistic<> NumFunctions("globaldce","Number of functions removed");
@@ -49,7 +48,7 @@ namespace {
   RegisterOpt<GlobalDCE> X("globaldce", "Dead Global Elimination");
 }
 
-Pass *createGlobalDCEPass() { return new GlobalDCE(); }
+Pass *llvm::createGlobalDCEPass() { return new GlobalDCE(); }
 
 bool GlobalDCE::run(Module &M) {
   bool Changed = false;
@@ -198,4 +197,3 @@ bool GlobalDCE::SafeToDestroyConstant(Constant *C) {
   return true;
 }
 
-} // End llvm namespace
index b0135d153114dcf16c39b2b6f53b06e8882cc930..026dbe3e803fc23ab8fbb513e26f062d8ecaeea9 100644 (file)
@@ -21,8 +21,7 @@
 #include "llvm/Constants.h"
 #include "llvm/Support/CallSite.h"
 #include "Support/Statistic.h"
-
-namespace llvm {
+using namespace llvm;
 
 namespace {
   Statistic<> NumArgumentsProped("ipconstprop",
@@ -38,7 +37,7 @@ namespace {
   RegisterOpt<IPCP> X("ipconstprop", "Interprocedural constant propagation");
 }
 
-Pass *createIPConstantPropagationPass() { return new IPCP(); }
+Pass *llvm::createIPConstantPropagationPass() { return new IPCP(); }
 
 bool IPCP::run(Module &M) {
   bool Changed = false;
@@ -117,6 +116,7 @@ bool IPCP::processFunction(Function &F) {
       Value *V = ArgumentConstants[i].first;
       if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(V))
         V = CPR->getValue();
+
       AI->replaceAllUsesWith(V);
       ++NumArgumentsProped;
       MadeChange = true;
@@ -124,4 +124,3 @@ bool IPCP::processFunction(Function &F) {
   return MadeChange;
 }
 
-} // End llvm namespace
index 574c8bf268f68fa83e528c00a0622e85f52ea1da..15c68cd893b1ab1250cda7c2aa35fdc3f498a9f4 100644 (file)
@@ -21,8 +21,7 @@
 #include "Support/Statistic.h"
 #include <fstream>
 #include <set>
-
-namespace llvm {
+using namespace llvm;
 
 namespace {
   Statistic<> NumFunctions("internalize", "Number of functions internalized");
@@ -118,8 +117,6 @@ namespace {
   RegisterOpt<InternalizePass> X("internalize", "Internalize Global Symbols");
 } // end anonymous namespace
 
-Pass *createInternalizePass() {
+Pass *llvm::createInternalizePass() {
   return new InternalizePass();
 }
-
-} // End llvm namespace
index f18fb929b3428175fface1e48fbf3220cc980186..a9c87f6a89b2f6aa2b2730954fcc9813bcd16983 100644 (file)
@@ -33,6 +33,7 @@
 // pass invokable via the "opt" command at will.
 //===----------------------------------------------------------------------===//
 
+#include "llvm/Transforms/IPO.h"
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Instructions.h"
@@ -46,8 +47,7 @@
 #include "Support/Statistic.h"
 #include "Support/StringExtras.h"
 #include "Support/VectorExtras.h"
-
-namespace llvm {
+using namespace llvm;
 
 namespace {
   Statistic<> LongJmpsTransformed("lowersetjmp",
@@ -533,9 +533,8 @@ void LowerSetJmp::visitUnwindInst(UnwindInst& UI)
                "", &UI);
 }
 
-Pass* createLowerSetJmpPass()
+Pass* llvm::createLowerSetJmpPass()
 {
   return new LowerSetJmp();
 }
 
-} // End llvm namespace
index fd39b6b12a5e0786f135435df65c25883ca515d7..e22c86cb7fe47bedfe6d22b6ff291529d8fed247 100644 (file)
@@ -52,8 +52,7 @@
 #include "Support/hash_map"
 #include <functional>
 #include <algorithm>
-
-namespace llvm {
+using namespace llvm;
 
 //---------------------------------------------------------------------------- 
 // Global constants used in marking Cilk functions and function calls.
@@ -538,4 +537,3 @@ bool Parallelize::run(Module& M)
   return true;
 }
 
-} // End llvm namespace
index 30e2514872eaf480ecb56868fba9368cfe6361e0..74e0d33d4127e43fd888c2355f9faf8d2bd6d603 100644 (file)
@@ -14,6 +14,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "llvm/Transforms/IPO.h"
 #include "llvm/CallGraphSCCPass.h"
 #include "llvm/Function.h"
 #include "llvm/Intrinsics.h"
@@ -22,8 +23,7 @@
 #include "llvm/Analysis/CallGraph.h"
 #include "Support/Statistic.h"
 #include <set>
-
-namespace llvm {
+using namespace llvm;
 
 namespace {
   Statistic<> NumRemoved("prune-eh", "Number of invokes removed");
@@ -39,7 +39,7 @@ namespace {
   RegisterOpt<PruneEH> X("prune-eh", "Remove unused exception handling info");
 }
 
-Pass *createPruneEHPass() { return new PruneEH(); }
+Pass *llvm::createPruneEHPass() { return new PruneEH(); }
 
 
 bool PruneEH::runOnSCC(const std::vector<CallGraphNode *> &SCC) {
@@ -107,4 +107,3 @@ bool PruneEH::runOnSCC(const std::vector<CallGraphNode *> &SCC) {
   return MadeChange; 
 }
 
-} // End llvm namespace
index fd5b7fb1f13c3f25f6a8dcd743f0030bfab31f74..dea919773e5b108de533e980924d8a2921d441a4 100644 (file)
@@ -21,8 +21,7 @@
 #include "llvm/Pass.h"
 #include "llvm/Support/CallSite.h"
 #include "Support/Statistic.h"
-
-namespace llvm {
+using namespace llvm;
 
 namespace {
   Statistic<> NumRaised("raiseallocs", "Number of allocations raised");
@@ -52,7 +51,7 @@ namespace {
 
 
 // createRaiseAllocationsPass - The interface to this file...
-Pass *createRaiseAllocationsPass() {
+Pass *llvm::createRaiseAllocationsPass() {
   return new RaiseAllocations();
 }
 
@@ -197,4 +196,3 @@ bool RaiseAllocations::run(Module &M) {
   return Changed;
 }
 
-} // End llvm namespace