changes because iMemory.h no longer #includes DerivedTypes.h
authorChris Lattner <sabre@nondot.org>
Mon, 29 Apr 2002 18:48:30 +0000 (18:48 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 29 Apr 2002 18:48:30 +0000 (18:48 +0000)
This only requires Type.h anyway

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2405 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
lib/Transforms/Utils/PromoteMemoryToRegister.cpp

index 1eb582ebc4c79f1161d2847b7d030f15dbd35a00..396b503ebae97231f6514e2c2fd9b7a3e0d9dc32 100644 (file)
@@ -9,6 +9,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Transforms/Scalar/DecomposeMultiDimRefs.h"
+#include "llvm/DerivedTypes.h"
 #include "llvm/Constant.h"
 #include "llvm/iMemory.h"
 #include "llvm/iOther.h"
index cfaeeccdf6e2d251a541c9421036cdc7a10168c0..ee8300215f731a4d06420537cd21d716b2afa030 100644 (file)
@@ -25,6 +25,7 @@
 #include "llvm/Function.h"
 #include "llvm/BasicBlock.h"
 #include "llvm/Constant.h"
+#include "llvm/Type.h"
 
 using std::vector;
 using std::map;
@@ -165,7 +166,7 @@ bool PromotePass::runOnFunction(Function *F) {
   //
   vector<Value *> Values(Allocas.size());
   for (unsigned i = 0, e = Allocas.size(); i != e; ++i)
-    Values[i] = Constant::getNullValue(Allocas[i]->getType()->getElementType());
+    Values[i] = Constant::getNullValue(Allocas[i]->getAllocatedType());
 
   // Walks all basic blocks in the function performing the SSA rename algorithm
   // and inserting the phi nodes we marked as necessary
@@ -204,7 +205,7 @@ bool PromotePass::QueuePhiNode(BasicBlock *BB, unsigned AllocaNo) {
   if (BBPNs[AllocaNo]) return false;
 
   // Create a PhiNode using the dereferenced type...
-  PHINode *PN = new PHINode(Allocas[AllocaNo]->getType()->getElementType(),
+  PHINode *PN = new PHINode(Allocas[AllocaNo]->getAllocatedType(),
                             Allocas[AllocaNo]->getName()+".mem2reg");
   BBPNs[AllocaNo] = PN;