Programs that actually free memory were broken
[oota-llvm.git] / lib / Transforms / IPO / MutateStructTypes.cpp
index d6b37c04908b45d95e7cd5788f81d0fdc510f776..fcad5fa050bfed7d85eae298d0d3f78083a39c25 100644 (file)
 #include "llvm/DerivedTypes.h"
 #include "llvm/Module.h"
 #include "llvm/Function.h"
+#include "llvm/BasicBlock.h"
 #include "llvm/GlobalVariable.h"
 #include "llvm/SymbolTable.h"
 #include "llvm/iPHINode.h"
 #include "llvm/iMemory.h"
 #include "llvm/iTerminators.h"
 #include "llvm/iOther.h"
+#include "llvm/Argument.h"
 #include "Support/STLExtras.h"
 #include <algorithm>
 using std::map;
@@ -336,9 +338,8 @@ void MutateStructTypes::transformMethod(Function *m) {
 
   // Okay, first order of business, create the arguments...
   for (unsigned i = 0, e = M->getArgumentList().size(); i != e; ++i) {
-    const FunctionArgument *OFA = M->getArgumentList()[i];
-    FunctionArgument *NFA = new FunctionArgument(ConvertType(OFA->getType()),
-                                                 OFA->getName());
+    const Argument *OFA = M->getArgumentList()[i];
+    Argument *NFA = new Argument(ConvertType(OFA->getType()), OFA->getName());
     NewMeth->getArgumentList().push_back(NFA);
     LocalValueMap[OFA] = NFA; // Keep track of value mapping
   }