aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/IPO
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-11-11 22:41:34 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-11-11 22:41:34 +0000
commitd0fde30ce850b78371fd1386338350591f9ff494 (patch)
tree83bb73e83f54fc8e1e474d116250ae2779562f7e /lib/Transforms/IPO
parent0d723acf15b0326e2df09ecb614b02a617f536e4 (diff)
downloadexternal_llvm-d0fde30ce850b78371fd1386338350591f9ff494.zip
external_llvm-d0fde30ce850b78371fd1386338350591f9ff494.tar.gz
external_llvm-d0fde30ce850b78371fd1386338350591f9ff494.tar.bz2
Put all LLVM code into the llvm namespace, as per bug 109.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r--lib/Transforms/IPO/ConstantMerge.cpp5
-rw-r--r--lib/Transforms/IPO/DeadArgumentElimination.cpp5
-rw-r--r--lib/Transforms/IPO/DeadTypeElimination.cpp5
-rw-r--r--lib/Transforms/IPO/ExtractFunction.cpp4
-rw-r--r--lib/Transforms/IPO/FunctionResolution.cpp4
-rw-r--r--lib/Transforms/IPO/GlobalDCE.cpp4
-rw-r--r--lib/Transforms/IPO/IPConstantPropagation.cpp4
-rw-r--r--lib/Transforms/IPO/InlineSimple.cpp4
-rw-r--r--lib/Transforms/IPO/Inliner.cpp4
-rw-r--r--lib/Transforms/IPO/Inliner.h4
-rw-r--r--lib/Transforms/IPO/Internalize.cpp4
-rw-r--r--lib/Transforms/IPO/LowerSetJmp.cpp4
-rw-r--r--lib/Transforms/IPO/MutateStructTypes.cpp2
-rw-r--r--lib/Transforms/IPO/Parallelize.cpp4
-rw-r--r--lib/Transforms/IPO/PruneEH.cpp4
-rw-r--r--lib/Transforms/IPO/RaiseAllocations.cpp4
-rw-r--r--lib/Transforms/IPO/SimpleStructMutation.cpp4
17 files changed, 67 insertions, 2 deletions
diff --git a/lib/Transforms/IPO/ConstantMerge.cpp b/lib/Transforms/IPO/ConstantMerge.cpp
index a452682..498cd7b 100644
--- a/lib/Transforms/IPO/ConstantMerge.cpp
+++ b/lib/Transforms/IPO/ConstantMerge.cpp
@@ -22,6 +22,8 @@
#include "llvm/Pass.h"
#include "Support/Statistic.h"
+namespace llvm {
+
namespace {
Statistic<> NumMerged("constmerge", "Number of global constants merged");
@@ -37,7 +39,6 @@ namespace {
Pass *createConstantMergePass() { return new ConstantMerge(); }
-
bool ConstantMerge::run(Module &M) {
std::map<Constant*, GlobalVariable*> CMap;
bool MadeChanges = false;
@@ -78,3 +79,5 @@ bool ConstantMerge::run(Module &M) {
return MadeChanges;
}
+
+} // End llvm namespace
diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp
index 9003f88..197710d 100644
--- a/lib/Transforms/IPO/DeadArgumentElimination.cpp
+++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp
@@ -30,6 +30,8 @@
#include "Support/iterator"
#include <set>
+namespace llvm {
+
namespace {
Statistic<> NumArgumentsEliminated("deadargelim",
"Number of unread args removed");
@@ -576,3 +578,6 @@ bool DAE::run(Module &M) {
RemoveDeadArgumentsFromFunction(*DeadRetVal.begin());
return true;
}
+
+} // End llvm namespace
+
diff --git a/lib/Transforms/IPO/DeadTypeElimination.cpp b/lib/Transforms/IPO/DeadTypeElimination.cpp
index c3eb416..126991d 100644
--- a/lib/Transforms/IPO/DeadTypeElimination.cpp
+++ b/lib/Transforms/IPO/DeadTypeElimination.cpp
@@ -19,6 +19,8 @@
#include "llvm/DerivedTypes.h"
#include "Support/Statistic.h"
+namespace llvm {
+
namespace {
struct DTE : public Pass {
// doPassInitialization - For this pass, it removes global symbol table
@@ -45,7 +47,6 @@ Pass *createDeadTypeEliminationPass() {
}
-
// ShouldNukeSymtabEntry - Return true if this module level symbol table entry
// should be eliminated.
//
@@ -95,3 +96,5 @@ bool DTE::run(Module &M) {
return Changed;
}
+
+} // End llvm namespace
diff --git a/lib/Transforms/IPO/ExtractFunction.cpp b/lib/Transforms/IPO/ExtractFunction.cpp
index 1656c51..c1ae2d4 100644
--- a/lib/Transforms/IPO/ExtractFunction.cpp
+++ b/lib/Transforms/IPO/ExtractFunction.cpp
@@ -10,6 +10,8 @@
#include "llvm/Pass.h"
#include "llvm/Module.h"
+namespace llvm {
+
namespace {
class FunctionExtractorPass : public Pass {
Function *Named;
@@ -90,3 +92,5 @@ namespace {
Pass *createFunctionExtractionPass(Function *F) {
return new FunctionExtractorPass(F);
}
+
+} // End llvm namespace
diff --git a/lib/Transforms/IPO/FunctionResolution.cpp b/lib/Transforms/IPO/FunctionResolution.cpp
index a21853d..2a366c8 100644
--- a/lib/Transforms/IPO/FunctionResolution.cpp
+++ b/lib/Transforms/IPO/FunctionResolution.cpp
@@ -29,6 +29,8 @@
#include "Support/Statistic.h"
#include <algorithm>
+namespace llvm {
+
namespace {
Statistic<>NumResolved("funcresolve", "Number of varargs functions resolved");
Statistic<> NumGlobals("funcresolve", "Number of global variables resolved");
@@ -329,3 +331,5 @@ bool FunctionResolvingPass::run(Module &M) {
return Changed;
}
+
+} // End llvm namespace
diff --git a/lib/Transforms/IPO/GlobalDCE.cpp b/lib/Transforms/IPO/GlobalDCE.cpp
index dc40026..8e7920d 100644
--- a/lib/Transforms/IPO/GlobalDCE.cpp
+++ b/lib/Transforms/IPO/GlobalDCE.cpp
@@ -22,6 +22,8 @@
#include "Support/Statistic.h"
#include <set>
+namespace llvm {
+
namespace {
Statistic<> NumFunctions("globaldce","Number of functions removed");
Statistic<> NumVariables("globaldce","Number of global variables removed");
@@ -195,3 +197,5 @@ bool GlobalDCE::SafeToDestroyConstant(Constant *C) {
return true;
}
+
+} // End llvm namespace
diff --git a/lib/Transforms/IPO/IPConstantPropagation.cpp b/lib/Transforms/IPO/IPConstantPropagation.cpp
index b592138..b0135d1 100644
--- a/lib/Transforms/IPO/IPConstantPropagation.cpp
+++ b/lib/Transforms/IPO/IPConstantPropagation.cpp
@@ -22,6 +22,8 @@
#include "llvm/Support/CallSite.h"
#include "Support/Statistic.h"
+namespace llvm {
+
namespace {
Statistic<> NumArgumentsProped("ipconstprop",
"Number of args turned into constants");
@@ -121,3 +123,5 @@ bool IPCP::processFunction(Function &F) {
}
return MadeChange;
}
+
+} // End llvm namespace
diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp
index 169e577..715f446 100644
--- a/lib/Transforms/IPO/InlineSimple.cpp
+++ b/lib/Transforms/IPO/InlineSimple.cpp
@@ -17,6 +17,8 @@
#include "llvm/Support/CallSite.h"
#include "llvm/Transforms/IPO.h"
+namespace llvm {
+
namespace {
// FunctionInfo - For each function, calculate the size of it in blocks and
// instructions.
@@ -114,3 +116,5 @@ int SimpleInliner::getInlineCost(CallSite CS) {
InlineCost += CalleeFI.NumInsts*10 + CalleeFI.NumBlocks*20;
return InlineCost;
}
+
+} // End llvm namespace
diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp
index 8ad72ab..bd1bd83 100644
--- a/lib/Transforms/IPO/Inliner.cpp
+++ b/lib/Transforms/IPO/Inliner.cpp
@@ -24,6 +24,8 @@
#include "Support/Debug.h"
#include "Support/Statistic.h"
+namespace llvm {
+
namespace {
Statistic<> NumInlined("inline", "Number of functions inlined");
Statistic<> NumDeleted("inline", "Number of functions deleted because all callers found");
@@ -134,3 +136,5 @@ bool Inliner::performInlining(CallSite CS, std::set<Function*> &SCC) {
}
return true;
}
+
+} // End llvm namespace
diff --git a/lib/Transforms/IPO/Inliner.h b/lib/Transforms/IPO/Inliner.h
index 1f3d0d2..805876c 100644
--- a/lib/Transforms/IPO/Inliner.h
+++ b/lib/Transforms/IPO/Inliner.h
@@ -20,6 +20,9 @@
#define DEBUG_TYPE "inline"
#include "llvm/CallGraphSCCPass.h"
#include <set>
+
+namespace llvm {
+
class CallSite;
/// Inliner - This class contains all of the helper code which is used to
@@ -61,5 +64,6 @@ private:
bool performInlining(CallSite CS, std::set<Function*> &SCC);
};
+} // End llvm namespace
#endif
diff --git a/lib/Transforms/IPO/Internalize.cpp b/lib/Transforms/IPO/Internalize.cpp
index 92d389a..574c8bf 100644
--- a/lib/Transforms/IPO/Internalize.cpp
+++ b/lib/Transforms/IPO/Internalize.cpp
@@ -22,6 +22,8 @@
#include <fstream>
#include <set>
+namespace llvm {
+
namespace {
Statistic<> NumFunctions("internalize", "Number of functions internalized");
Statistic<> NumGlobals ("internalize", "Number of global vars internalized");
@@ -119,3 +121,5 @@ namespace {
Pass *createInternalizePass() {
return new InternalizePass();
}
+
+} // End llvm namespace
diff --git a/lib/Transforms/IPO/LowerSetJmp.cpp b/lib/Transforms/IPO/LowerSetJmp.cpp
index abbc2c9..276523b 100644
--- a/lib/Transforms/IPO/LowerSetJmp.cpp
+++ b/lib/Transforms/IPO/LowerSetJmp.cpp
@@ -47,6 +47,8 @@
#include "Support/StringExtras.h"
#include "Support/VectorExtras.h"
+namespace llvm {
+
namespace {
Statistic<> LongJmpsTransformed("lowersetjmp",
"Number of longjmps transformed");
@@ -538,3 +540,5 @@ Pass* createLowerSetJmpPass()
{
return new LowerSetJmp();
}
+
+} // End llvm namespace
diff --git a/lib/Transforms/IPO/MutateStructTypes.cpp b/lib/Transforms/IPO/MutateStructTypes.cpp
index dfaf8a8..41835ad 100644
--- a/lib/Transforms/IPO/MutateStructTypes.cpp
+++ b/lib/Transforms/IPO/MutateStructTypes.cpp
@@ -28,6 +28,8 @@
#include "Support/Debug.h"
#include <algorithm>
+using namespace llvm;
+
// ValuePlaceHolder - A stupid little marker value. It appears as an
// instruction of type Instruction::UserOp1.
//
diff --git a/lib/Transforms/IPO/Parallelize.cpp b/lib/Transforms/IPO/Parallelize.cpp
index 77e6ed3..fd39b6b 100644
--- a/lib/Transforms/IPO/Parallelize.cpp
+++ b/lib/Transforms/IPO/Parallelize.cpp
@@ -53,6 +53,8 @@
#include <functional>
#include <algorithm>
+namespace llvm {
+
//----------------------------------------------------------------------------
// Global constants used in marking Cilk functions and function calls.
//----------------------------------------------------------------------------
@@ -535,3 +537,5 @@ bool Parallelize::run(Module& M)
return true;
}
+
+} // End llvm namespace
diff --git a/lib/Transforms/IPO/PruneEH.cpp b/lib/Transforms/IPO/PruneEH.cpp
index b377a8b..30e2514 100644
--- a/lib/Transforms/IPO/PruneEH.cpp
+++ b/lib/Transforms/IPO/PruneEH.cpp
@@ -23,6 +23,8 @@
#include "Support/Statistic.h"
#include <set>
+namespace llvm {
+
namespace {
Statistic<> NumRemoved("prune-eh", "Number of invokes removed");
@@ -104,3 +106,5 @@ bool PruneEH::runOnSCC(const std::vector<CallGraphNode *> &SCC) {
return MadeChange;
}
+
+} // End llvm namespace
diff --git a/lib/Transforms/IPO/RaiseAllocations.cpp b/lib/Transforms/IPO/RaiseAllocations.cpp
index 81abda0..fd5b7fb 100644
--- a/lib/Transforms/IPO/RaiseAllocations.cpp
+++ b/lib/Transforms/IPO/RaiseAllocations.cpp
@@ -22,6 +22,8 @@
#include "llvm/Support/CallSite.h"
#include "Support/Statistic.h"
+namespace llvm {
+
namespace {
Statistic<> NumRaised("raiseallocs", "Number of allocations raised");
@@ -194,3 +196,5 @@ bool RaiseAllocations::run(Module &M) {
return Changed;
}
+
+} // End llvm namespace
diff --git a/lib/Transforms/IPO/SimpleStructMutation.cpp b/lib/Transforms/IPO/SimpleStructMutation.cpp
index 012fa22..0c70916 100644
--- a/lib/Transforms/IPO/SimpleStructMutation.cpp
+++ b/lib/Transforms/IPO/SimpleStructMutation.cpp
@@ -23,6 +23,8 @@ using std::vector;
using std::set;
using std::pair;
+namespace llvm {
+
namespace {
struct SimpleStructMutation : public MutateStructTypes {
enum Transform { SwapElements, SortElements };
@@ -188,3 +190,5 @@ SimpleStructMutation::TransformsType
return Transforms;
}
+
+} // End llvm namespace