aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/ExtractFunction.cpp
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2004-04-22 23:00:51 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2004-04-22 23:00:51 +0000
commit7d248397a738c31bbe6e22bfe93a17cc560efdf7 (patch)
tree4c38f9a57c73b52434b780f9f12b63b5f1628b26 /lib/Transforms/IPO/ExtractFunction.cpp
parent79906c9825d4ff18e3f1fff54eef8162257b72a9 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13112 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/ExtractFunction.cpp')
-rw-r--r--lib/Transforms/IPO/ExtractFunction.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/Transforms/IPO/ExtractFunction.cpp b/lib/Transforms/IPO/ExtractFunction.cpp
index 052742689f..41b796035b 100644
--- a/lib/Transforms/IPO/ExtractFunction.cpp
+++ b/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);
}