summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/BasicBlockUtils.cpp4
-rw-r--r--llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp4
-rw-r--r--llvm/lib/Transforms/Utils/CloneFunction.cpp4
-rw-r--r--llvm/lib/Transforms/Utils/CloneModule.cpp4
-rw-r--r--llvm/lib/Transforms/Utils/CloneTrace.cpp4
-rw-r--r--llvm/lib/Transforms/Utils/DemoteRegToStack.cpp4
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp4
-rw-r--r--llvm/lib/Transforms/Utils/Linker.cpp3
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp4
-rw-r--r--llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp4
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp4
-rw-r--r--llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp4
-rw-r--r--llvm/lib/Transforms/Utils/ValueMapper.cpp3
-rw-r--r--llvm/lib/Transforms/Utils/ValueMapper.h5
14 files changed, 55 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
index 22fd555a46a..5fb54693325 100644
--- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -19,6 +19,8 @@
#include "llvm/Type.h"
#include <algorithm>
+namespace llvm {
+
// ReplaceInstWithValue - Replace all uses of an instruction (specified by BI)
// with a value, then remove and delete the original instruction.
//
@@ -112,3 +114,5 @@ void RemoveSuccessor(TerminatorInst *TI, unsigned SuccNum) {
if (NewTI) // If it's a different instruction, replace.
ReplaceInstWithInst(TI, NewTI);
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp b/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
index de59db2f9bc..e8201cc3915 100644
--- a/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
+++ b/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
@@ -25,6 +25,8 @@
#include "llvm/Support/CFG.h"
#include "Support/Statistic.h"
+namespace llvm {
+
namespace {
Statistic<> NumBroken("break-crit-edges", "Number of blocks inserted");
@@ -168,3 +170,5 @@ bool SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P) {
}
return true;
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index e0312f2efb2..d8aa9aebe43 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -19,6 +19,8 @@
#include "llvm/Function.h"
#include "ValueMapper.h"
+namespace llvm {
+
// RemapInstruction - Convert the instruction operands from referencing the
// current values into those specified by ValueMap.
//
@@ -140,3 +142,5 @@ Function *CloneFunction(const Function *F,
CloneFunctionInto(NewF, F, ValueMap, Returns);
return NewF;
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Transforms/Utils/CloneModule.cpp b/llvm/lib/Transforms/Utils/CloneModule.cpp
index cc22c7214a5..21a8675f07b 100644
--- a/llvm/lib/Transforms/Utils/CloneModule.cpp
+++ b/llvm/lib/Transforms/Utils/CloneModule.cpp
@@ -19,6 +19,8 @@
#include "llvm/Constant.h"
#include "ValueMapper.h"
+namespace llvm {
+
/// CloneModule - Return an exact copy of the specified module. This is not as
/// easy as it might seem because we have to worry about making copies of global
/// variables and functions, and making their (initializers and references,
@@ -88,3 +90,5 @@ Module *CloneModule(const Module *M) {
return New;
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Transforms/Utils/CloneTrace.cpp b/llvm/lib/Transforms/Utils/CloneTrace.cpp
index 9d995464bf8..990e54c783b 100644
--- a/llvm/lib/Transforms/Utils/CloneTrace.cpp
+++ b/llvm/lib/Transforms/Utils/CloneTrace.cpp
@@ -20,6 +20,8 @@
#include "llvm/Function.h"
+namespace llvm {
+
//Clones the trace (a vector of basic blocks)
std::vector<BasicBlock *> CloneTrace(const std::vector<BasicBlock*> &origTrace) {
@@ -86,3 +88,5 @@ std::vector<BasicBlock *> CloneTrace(const std::vector<BasicBlock*> &origTrace)
//return new vector of basic blocks
return clonedTrace;
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp b/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp
index bd605ca7890..e35dca4de03 100644
--- a/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp
+++ b/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp
@@ -22,6 +22,8 @@
#include "llvm/Type.h"
#include "Support/hash_set"
+namespace llvm {
+
typedef hash_set<PHINode*> PhiSet;
typedef hash_set<PHINode*>::iterator PhiSetIterator;
@@ -160,3 +162,5 @@ AllocaInst* DemoteRegToStack(Instruction& X) {
return XSlot;
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index 1481324330a..265d5c419ac 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -24,6 +24,8 @@
#include "llvm/Support/CallSite.h"
#include "llvm/Transforms/Utils/Local.h"
+namespace llvm {
+
bool InlineFunction(CallInst *CI) { return InlineFunction(CallSite(CI)); }
bool InlineFunction(InvokeInst *II) { return InlineFunction(CallSite(II)); }
@@ -278,3 +280,5 @@ bool InlineFunction(CallSite CS) {
SimplifyCFG(AfterCallBB);
return true;
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Transforms/Utils/Linker.cpp b/llvm/lib/Transforms/Utils/Linker.cpp
index 0be840fb6cd..4bc78a4cde3 100644
--- a/llvm/lib/Transforms/Utils/Linker.cpp
+++ b/llvm/lib/Transforms/Utils/Linker.cpp
@@ -23,6 +23,8 @@
#include "llvm/iOther.h"
#include "llvm/Constants.h"
+namespace llvm {
+
// Error - Simple wrapper function to conditionally assign to E and return true.
// This just makes error return conditions a little bit simpler...
//
@@ -902,3 +904,4 @@ bool LinkModules(Module *Dest, const Module *Src, std::string *ErrorMsg) {
return false;
}
+} // End llvm namespace
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 2f9b07ca945..894699596e1 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -17,6 +17,8 @@
#include "llvm/iOperators.h"
#include "llvm/ConstantHandling.h"
+namespace llvm {
+
//===----------------------------------------------------------------------===//
// Local constant propagation...
//
@@ -180,3 +182,5 @@ bool dceInstruction(BasicBlock::iterator &BBI) {
}
return false;
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
index f920718c3a9..0859f699801 100644
--- a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
+++ b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
@@ -25,6 +25,8 @@
#include "llvm/Support/CFG.h"
#include "Support/StringExtras.h"
+namespace llvm {
+
/// isAllocaPromotable - Return true if this alloca is legal for promotion.
/// This is true if there are only loads and stores to the alloca...
///
@@ -459,3 +461,5 @@ void PromoteMemToReg(const std::vector<AllocaInst*> &Allocas,
if (Allocas.empty()) return;
PromoteMem2Reg(Allocas, DT, DF, TD).run();
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index a5f54b1326c..158d9119ae5 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -21,6 +21,8 @@
#include <algorithm>
#include <functional>
+namespace llvm {
+
// PropagatePredecessors - This gets "Succ" ready to have the predecessors from
// "BB". This is a little tricky because "Succ" has PHI nodes, which need to
// have extra slots added to them to hold the merge edges from BB's
@@ -298,3 +300,5 @@ bool SimplifyCFG(BasicBlock *BB) {
return Changed;
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp b/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
index 180871b0937..2591ffd6d72 100644
--- a/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
+++ b/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
@@ -22,6 +22,8 @@
#include "llvm/iPHINode.h"
#include "llvm/Type.h"
+namespace llvm {
+
static RegisterOpt<UnifyFunctionExitNodes>
X("mergereturn", "Unify function exit nodes");
@@ -112,3 +114,5 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) {
ReturnBlock = NewRetBlock;
return true;
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp
index 6590498bbc1..248ebace7a5 100644
--- a/llvm/lib/Transforms/Utils/ValueMapper.cpp
+++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp
@@ -16,6 +16,8 @@
#include "llvm/Constants.h"
#include "llvm/Instruction.h"
+namespace llvm {
+
Value *MapValue(const Value *V, std::map<const Value*, Value*> &VM) {
Value *&VMSlot = VM[V];
if (VMSlot) return VMSlot; // Does it exist in the map yet?
@@ -105,3 +107,4 @@ Value *MapValue(const Value *V, std::map<const Value*, Value*> &VM) {
return 0;
}
+} // End llvm namespace
diff --git a/llvm/lib/Transforms/Utils/ValueMapper.h b/llvm/lib/Transforms/Utils/ValueMapper.h
index 8264ade108a..e67b3261dba 100644
--- a/llvm/lib/Transforms/Utils/ValueMapper.h
+++ b/llvm/lib/Transforms/Utils/ValueMapper.h
@@ -16,8 +16,13 @@
#define LIB_TRANSFORMS_UTILS_VALUE_MAPPER_H
#include <map>
+
+namespace llvm {
+
class Value;
Value *MapValue(const Value *V, std::map<const Value*, Value*> &VM);
+} // End llvm namespace
+
#endif
OpenPOWER on IntegriCloud