#include "llvm/iOther.h"
#include "llvm/BasicBlock.h"
#include "llvm/Method.h"
+#include "llvm/Pass.h"
#include <map>
#include <vector>
static Value *NormalizePhiOperand(PHINode *PN, Value *CPV,
BasicBlock *Pred, CachedCopyMap &CopyCache) {
-
- /* NOTE: CahedCopyMap was disabled to insert phi elimination code
- for all phi args -- Ruchira
- */
-
-
// Check if we've already inserted a copy for this constant in Pred
// Note that `copyCache[Pred]' will create an empty vector the first time
//
// Entry point for normalizing constant args in PHIs
//---------------------------------------------------------------------------
-bool HoistPHIConstants::doHoistPHIConstants(Method *M) {
+static bool doHoistPHIConstants(Method *M) {
CachedCopyMap Cache;
bool Changed = false;
return Changed;
}
+
+namespace {
+ struct HoistPHIConstants : public MethodPass {
+ virtual bool runOnMethod(Method *M) { return doHoistPHIConstants(M); }
+ };
+}
+
+Pass *createHoistPHIConstantsPass() { return new HoistPHIConstants(); }