summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/IndMemRemoval.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/IPO/IndMemRemoval.cpp')
-rw-r--r--lib/Transforms/IPO/IndMemRemoval.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/lib/Transforms/IPO/IndMemRemoval.cpp b/lib/Transforms/IPO/IndMemRemoval.cpp
index 9ad25dd9fa..82aa992a09 100644
--- a/lib/Transforms/IPO/IndMemRemoval.cpp
+++ b/lib/Transforms/IPO/IndMemRemoval.cpp
@@ -15,36 +15,27 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "indmemrem"
#include "llvm/Transforms/IPO.h"
#include "llvm/Pass.h"
#include "llvm/Module.h"
-#include "llvm/Function.h"
#include "llvm/Instructions.h"
#include "llvm/Type.h"
-#include "llvm/Support/Debug.h"
#include "llvm/ADT/Statistic.h"
-#include <fstream>
-#include <set>
using namespace llvm;
-namespace {
- Statistic NumBounceSites("indmemrem", "Number of sites modified");
- Statistic NumBounce ("indmemrem", "Number of bounce functions created");
+STATISTIC(NumBounceSites, "Number of sites modified");
+STATISTIC(NumBounce , "Number of bounce functions created");
+namespace {
class IndMemRemPass : public ModulePass {
-
public:
- IndMemRemPass();
virtual bool runOnModule(Module &M);
};
RegisterPass<IndMemRemPass> X("indmemrem","Indirect Malloc and Free Removal");
} // end anonymous namespace
-IndMemRemPass::IndMemRemPass()
-{
-}
-
bool IndMemRemPass::runOnModule(Module &M) {
//in Theory, all direct calls of malloc and free should be promoted
//to intrinsics. Therefor, this goes through and finds where the