[llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Mar 8 10:47:04 PST 2004
Changes in directory llvm/lib/Transforms/Instrumentation:
EmitFunctions.cpp updated: 1.16 -> 1.17
---
Log message:
finegrainify namespacification
---
Diffs of the changes: (+14 -14)
Index: llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp
diff -u llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp:1.16 llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp:1.17
--- llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp:1.16 Sat Feb 14 22:07:26 2004
+++ llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp Mon Mar 8 10:45:53 2004
@@ -7,7 +7,9 @@
//
//===----------------------------------------------------------------------===//
//
-// This inserts a global constant table with function pointers all along
+// This inserts a global constant table with function pointers all along.
+//
+// NOTE: This pass is used by the reoptimizer only.
//
//===----------------------------------------------------------------------===//
@@ -16,24 +18,24 @@
#include "llvm/Module.h"
#include "llvm/Pass.h"
#include "llvm/Support/CFG.h"
-
-namespace llvm {
-
-enum Color{
- WHITE,
- GREY,
- BLACK
-};
+using namespace llvm;
namespace {
+ enum Color{
+ WHITE,
+ GREY,
+ BLACK
+ };
+
struct EmitFunctionTable : public Pass {
bool run(Module &M);
};
- RegisterOpt<EmitFunctionTable> X("emitfuncs", "Emit a Function Table");
+ RegisterOpt<EmitFunctionTable>
+ X("emitfuncs", "Emit a function table for the reoptimizer");
}
-char doDFS(BasicBlock * node,std::map<BasicBlock *, Color > &color){
+static char doDFS(BasicBlock * node,std::map<BasicBlock *, Color > &color){
color[node] = GREY;
for(succ_iterator vl = succ_begin(node), ve = succ_end(node); vl != ve; ++vl){
@@ -56,7 +58,7 @@
return 1;
}
-char hasBackEdge(Function *F){
+static char hasBackEdge(Function *F){
std::map<BasicBlock *, Color > color;
return doDFS(F->begin(), color);
}
@@ -106,5 +108,3 @@
M.getGlobalList().push_back(fnCount);
return true; // Always modifies program
}
-
-} // End llvm namespace
More information about the llvm-commits
mailing list