[llvm-commits] CVS: llvm/lib/Transforms/Utils/BasicBlockUtils.cpp BreakCriticalEdges.cpp CloneFunction.cpp CloneModule.cpp CloneTrace.cpp DemoteRegToStack.cpp InlineFunction.cpp Linker.cpp Local.cpp PromoteMemoryToRegister.cpp SimplifyCFG.cpp UnifyFunctionExitNodes.cpp ValueMapper.cpp ValueMapper.h
Brian Gaeke
gaeke at cs.uiuc.edu
Tue Nov 11 16:43:38 PST 2003
Changes in directory llvm/lib/Transforms/Utils:
BasicBlockUtils.cpp updated: 1.8 -> 1.9
BreakCriticalEdges.cpp updated: 1.14 -> 1.15
CloneFunction.cpp updated: 1.17 -> 1.18
CloneModule.cpp updated: 1.7 -> 1.8
CloneTrace.cpp updated: 1.3 -> 1.4
DemoteRegToStack.cpp updated: 1.6 -> 1.7
InlineFunction.cpp updated: 1.15 -> 1.16
Linker.cpp updated: 1.62 -> 1.63
Local.cpp updated: 1.11 -> 1.12
PromoteMemoryToRegister.cpp updated: 1.56 -> 1.57
SimplifyCFG.cpp updated: 1.17 -> 1.18
UnifyFunctionExitNodes.cpp updated: 1.26 -> 1.27
ValueMapper.cpp updated: 1.7 -> 1.8
ValueMapper.h updated: 1.2 -> 1.3
---
Log message:
Put all LLVM code into the llvm namespace, as per bug 109.
---
Diffs of the changes: (+55 -0)
Index: llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
diff -u llvm/lib/Transforms/Utils/BasicBlockUtils.cpp:1.8 llvm/lib/Transforms/Utils/BasicBlockUtils.cpp:1.9
--- llvm/lib/Transforms/Utils/BasicBlockUtils.cpp:1.8 Mon Oct 20 14:43:20 2003
+++ llvm/lib/Transforms/Utils/BasicBlockUtils.cpp Tue Nov 11 16:41:34 2003
@@ -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 @@
if (NewTI) // If it's a different instruction, replace.
ReplaceInstWithInst(TI, NewTI);
}
+
+} // End llvm namespace
Index: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
diff -u llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.14 llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.15
--- llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.14 Sun Nov 9 22:42:42 2003
+++ llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp Tue Nov 11 16:41:34 2003
@@ -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 @@
}
return true;
}
+
+} // End llvm namespace
Index: llvm/lib/Transforms/Utils/CloneFunction.cpp
diff -u llvm/lib/Transforms/Utils/CloneFunction.cpp:1.17 llvm/lib/Transforms/Utils/CloneFunction.cpp:1.18
--- llvm/lib/Transforms/Utils/CloneFunction.cpp:1.17 Mon Oct 20 14:43:20 2003
+++ llvm/lib/Transforms/Utils/CloneFunction.cpp Tue Nov 11 16:41:34 2003
@@ -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 @@
CloneFunctionInto(NewF, F, ValueMap, Returns);
return NewF;
}
+
+} // End llvm namespace
Index: llvm/lib/Transforms/Utils/CloneModule.cpp
diff -u llvm/lib/Transforms/Utils/CloneModule.cpp:1.7 llvm/lib/Transforms/Utils/CloneModule.cpp:1.8
--- llvm/lib/Transforms/Utils/CloneModule.cpp:1.7 Mon Oct 20 14:43:20 2003
+++ llvm/lib/Transforms/Utils/CloneModule.cpp Tue Nov 11 16:41:34 2003
@@ -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 @@
return New;
}
+
+} // End llvm namespace
Index: llvm/lib/Transforms/Utils/CloneTrace.cpp
diff -u llvm/lib/Transforms/Utils/CloneTrace.cpp:1.3 llvm/lib/Transforms/Utils/CloneTrace.cpp:1.4
--- llvm/lib/Transforms/Utils/CloneTrace.cpp:1.3 Mon Oct 20 14:43:20 2003
+++ llvm/lib/Transforms/Utils/CloneTrace.cpp Tue Nov 11 16:41:34 2003
@@ -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 @@
//return new vector of basic blocks
return clonedTrace;
}
+
+} // End llvm namespace
Index: llvm/lib/Transforms/Utils/DemoteRegToStack.cpp
diff -u llvm/lib/Transforms/Utils/DemoteRegToStack.cpp:1.6 llvm/lib/Transforms/Utils/DemoteRegToStack.cpp:1.7
--- llvm/lib/Transforms/Utils/DemoteRegToStack.cpp:1.6 Thu Nov 6 13:46:29 2003
+++ llvm/lib/Transforms/Utils/DemoteRegToStack.cpp Tue Nov 11 16:41:34 2003
@@ -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 @@
return XSlot;
}
+
+} // End llvm namespace
Index: llvm/lib/Transforms/Utils/InlineFunction.cpp
diff -u llvm/lib/Transforms/Utils/InlineFunction.cpp:1.15 llvm/lib/Transforms/Utils/InlineFunction.cpp:1.16
--- llvm/lib/Transforms/Utils/InlineFunction.cpp:1.15 Sun Oct 26 23:33:09 2003
+++ llvm/lib/Transforms/Utils/InlineFunction.cpp Tue Nov 11 16:41:34 2003
@@ -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 @@
SimplifyCFG(AfterCallBB);
return true;
}
+
+} // End llvm namespace
Index: llvm/lib/Transforms/Utils/Linker.cpp
diff -u llvm/lib/Transforms/Utils/Linker.cpp:1.62 llvm/lib/Transforms/Utils/Linker.cpp:1.63
--- llvm/lib/Transforms/Utils/Linker.cpp:1.62 Wed Nov 5 14:37:01 2003
+++ llvm/lib/Transforms/Utils/Linker.cpp Tue Nov 11 16:41:34 2003
@@ -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 @@
return false;
}
+} // End llvm namespace
Index: llvm/lib/Transforms/Utils/Local.cpp
diff -u llvm/lib/Transforms/Utils/Local.cpp:1.11 llvm/lib/Transforms/Utils/Local.cpp:1.12
--- llvm/lib/Transforms/Utils/Local.cpp:1.11 Mon Oct 20 14:43:20 2003
+++ llvm/lib/Transforms/Utils/Local.cpp Tue Nov 11 16:41:34 2003
@@ -17,6 +17,8 @@
#include "llvm/iOperators.h"
#include "llvm/ConstantHandling.h"
+namespace llvm {
+
//===----------------------------------------------------------------------===//
// Local constant propagation...
//
@@ -180,3 +182,5 @@
}
return false;
}
+
+} // End llvm namespace
Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.56 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.57
--- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.56 Mon Oct 20 14:43:20 2003
+++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Tue Nov 11 16:41:34 2003
@@ -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 @@
if (Allocas.empty()) return;
PromoteMem2Reg(Allocas, DT, DF, TD).run();
}
+
+} // End llvm namespace
Index: llvm/lib/Transforms/Utils/SimplifyCFG.cpp
diff -u llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.17 llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.18
--- llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.17 Mon Oct 20 14:43:20 2003
+++ llvm/lib/Transforms/Utils/SimplifyCFG.cpp Tue Nov 11 16:41:34 2003
@@ -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 @@
return Changed;
}
+
+} // End llvm namespace
Index: llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
diff -u llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:1.26 llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:1.27
--- llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:1.26 Mon Oct 20 14:43:20 2003
+++ llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp Tue Nov 11 16:41:34 2003
@@ -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 @@
ReturnBlock = NewRetBlock;
return true;
}
+
+} // End llvm namespace
Index: llvm/lib/Transforms/Utils/ValueMapper.cpp
diff -u llvm/lib/Transforms/Utils/ValueMapper.cpp:1.7 llvm/lib/Transforms/Utils/ValueMapper.cpp:1.8
--- llvm/lib/Transforms/Utils/ValueMapper.cpp:1.7 Wed Nov 5 14:43:58 2003
+++ llvm/lib/Transforms/Utils/ValueMapper.cpp Tue Nov 11 16:41:34 2003
@@ -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 @@
return 0;
}
+} // End llvm namespace
Index: llvm/lib/Transforms/Utils/ValueMapper.h
diff -u llvm/lib/Transforms/Utils/ValueMapper.h:1.2 llvm/lib/Transforms/Utils/ValueMapper.h:1.3
--- llvm/lib/Transforms/Utils/ValueMapper.h:1.2 Tue Oct 21 10:17:13 2003
+++ llvm/lib/Transforms/Utils/ValueMapper.h Tue Nov 11 16:41:34 2003
@@ -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
More information about the llvm-commits
mailing list