summaryrefslogtreecommitdiff
path: root/include/llvm/Transforms/ChangeAllocations.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Transforms/ChangeAllocations.h')
-rw-r--r--include/llvm/Transforms/ChangeAllocations.h47
1 files changed, 3 insertions, 44 deletions
diff --git a/include/llvm/Transforms/ChangeAllocations.h b/include/llvm/Transforms/ChangeAllocations.h
index f0a06859e9..1b837419bd 100644
--- a/include/llvm/Transforms/ChangeAllocations.h
+++ b/include/llvm/Transforms/ChangeAllocations.h
@@ -10,51 +10,10 @@
#ifndef LLVM_TRANSFORMS_CHANGEALLOCATIONS_H
#define LLVM_TRANSFORMS_CHANGEALLOCATIONS_H
-#include "llvm/Pass.h"
+class Pass;
class TargetData;
-// LowerAllocations - Turn malloc and free instructions into %malloc and %free
-// calls.
-//
-class LowerAllocations : public BasicBlockPass {
- Method *MallocMeth; // Methods in the module we are processing
- Method *FreeMeth; // Initialized by doInitialization
-
- const TargetData &DataLayout;
-public:
- inline LowerAllocations(const TargetData &TD) : DataLayout(TD) {
- MallocMeth = FreeMeth = 0;
- }
-
- // doPassInitialization - For the lower allocations pass, this ensures that a
- // module contains a declaration for a malloc and a free function.
- //
- bool doInitialization(Module *M);
-
- // runOnBasicBlock - This method does the actual work of converting
- // instructions over, assuming that the pass has already been initialized.
- //
- bool runOnBasicBlock(BasicBlock *BB);
-};
-
-// RaiseAllocations - Turn %malloc and %free calls into the appropriate
-// instruction.
-//
-class RaiseAllocations : public BasicBlockPass {
- Method *MallocMeth; // Methods in the module we are processing
- Method *FreeMeth; // Initialized by doPassInitializationVirt
-public:
- inline RaiseAllocations() : MallocMeth(0), FreeMeth(0) {}
-
- // doPassInitialization - For the raise allocations pass, this finds a
- // declaration for malloc and free if they exist.
- //
- bool doInitialization(Module *M);
-
- // runOnBasicBlock - This method does the actual work of converting
- // instructions over, assuming that the pass has already been initialized.
- //
- bool runOnBasicBlock(BasicBlock *BB);
-};
+Pass *createLowerAllocationsPass(const TargetData &TD);
+Pass *createRaiseAllocationsPass();
#endif