[llvm-commits] CVS: llvm/lib/Transforms/Scalar/RaiseAllocations.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Aug 11 10:06:03 PDT 2003


Changes in directory llvm/lib/Transforms/Scalar:

RaiseAllocations.cpp updated: 1.14 -> 1.15

---
Log message:

Fix handling of 'free' if it has absolutely no prototype


---
Diffs of the changes:

Index: llvm/lib/Transforms/Scalar/RaiseAllocations.cpp
diff -u llvm/lib/Transforms/Scalar/RaiseAllocations.cpp:1.14 llvm/lib/Transforms/Scalar/RaiseAllocations.cpp:1.15
--- llvm/lib/Transforms/Scalar/RaiseAllocations.cpp:1.14	Tue Oct  1 17:38:41 2002
+++ llvm/lib/Transforms/Scalar/RaiseAllocations.cpp	Mon Aug 11 10:05:08 2003
@@ -93,6 +93,13 @@
     FreeFunc = M.getFunction("free", FreeType);
   }
 
+  // One last try, check to see if we can find free as 'int (...)* free'.  This
+  // handles the case where NOTHING was declared.
+  if (FreeFunc == 0) {
+    FreeType = FunctionType::get(Type::IntTy, std::vector<const Type*>(),true);
+    FreeFunc = M.getFunction("free", FreeType);
+  }
+
 
   // Don't mess with locally defined versions of these functions...
   if (MallocFunc && !MallocFunc->isExternal()) MallocFunc = 0;





More information about the llvm-commits mailing list