diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2004-04-22 23:00:51 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2004-04-22 23:00:51 +0000 |
commit | 98aa516a9cc80eded682e8031e0f77c33f0b8f0f (patch) | |
tree | bc2e11226bf28e72ed815ec39841f479e7de6d2f /llvm/lib/Transforms/IPO/ExtractFunction.cpp | |
parent | e0682426f0c627a328277bc9401b3355b6fd0669 (diff) | |
download | bcm5719-llvm-98aa516a9cc80eded682e8031e0f77c33f0b8f0f.tar.gz bcm5719-llvm-98aa516a9cc80eded682e8031e0f77c33f0b8f0f.zip |
Clarify the logic: the flag is renamed to `deleteFn' to signify it will delete
the function instead of isolating it. This also means the condition is reversed.
llvm-svn: 13112
Diffstat (limited to 'llvm/lib/Transforms/IPO/ExtractFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/ExtractFunction.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/llvm/lib/Transforms/IPO/ExtractFunction.cpp b/llvm/lib/Transforms/IPO/ExtractFunction.cpp index 052742689fc..41b796035b2 100644 --- a/llvm/lib/Transforms/IPO/ExtractFunction.cpp +++ b/llvm/lib/Transforms/IPO/ExtractFunction.cpp @@ -19,14 +19,14 @@ using namespace llvm; namespace { class FunctionExtractorPass : public Pass { Function *Named; - bool isolateFunc; + bool deleteFunc; public: - /// FunctionExtractorPass - ctor for the pass. If isolateFn is true, then - /// the named function is the only thing left in the Module (default - /// behavior), otherwise the function is the thing deleted. + /// FunctionExtractorPass - If deleteFn is true, this pass deletes as the + /// specified function. Otherwise, it deletes as much of the module as + /// possible, except for the function specified. /// - FunctionExtractorPass(Function *F = 0, bool isolateFn = true) - : Named(F), isolateFunc(isolateFn) {} + FunctionExtractorPass(Function *F = 0, bool deleteFn = true) + : Named(F), deleteFunc(deleteFn) {} bool run(Module &M) { if (Named == 0) { @@ -34,10 +34,10 @@ namespace { if (Named == 0) return false; // No function to extract } - if (isolateFunc) - return isolateFunction(M); - else + if (deleteFunc) return deleteFunction(); + else + return isolateFunction(M); } bool deleteFunction() { @@ -112,6 +112,6 @@ namespace { RegisterPass<FunctionExtractorPass> X("extract", "Function Extractor"); } -Pass *llvm::createFunctionExtractionPass(Function *F, bool isolateFn) { - return new FunctionExtractorPass(F, isolateFn); +Pass *llvm::createFunctionExtractionPass(Function *F, bool deleteFn) { + return new FunctionExtractorPass(F, deleteFn); } |