diff options
| author | Chris Lattner <sabre@nondot.org> | 2004-03-08 16:45:53 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2004-03-08 16:45:53 +0000 |
| commit | d91e676700f45dc143da188b43f925bea623dc28 (patch) | |
| tree | f77b6e666f99e1a051f5c66e79d747af997448ec /llvm | |
| parent | e2b27080e7a5a3e7163a31770a333ab08fc518da (diff) | |
| download | bcm5719-llvm-d91e676700f45dc143da188b43f925bea623dc28.tar.gz bcm5719-llvm-d91e676700f45dc143da188b43f925bea623dc28.zip | |
finegrainify namespacification
llvm-svn: 12221
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp b/llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp index c74f93c94b8..27c25875468 100644 --- a/llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp +++ b/llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp @@ -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 @@ char doDFS(BasicBlock * node,std::map<BasicBlock *, Color > &color){ 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 @@ bool EmitFunctionTable::run(Module &M){ M.getGlobalList().push_back(fnCount); return true; // Always modifies program } - -} // End llvm namespace |

