aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-11 15:05:08 +0000
committerChris Lattner <sabre@nondot.org>2003-08-11 15:05:08 +0000
commit1f28e8ce4d8b2c31769e819619a8600349327ba2 (patch)
tree0bdaf5553e4c5bcd9b27110ddd9ba7afd592d5c7 /lib
parent4c08840e4bc247f3567320ca9258479659b0042f (diff)
downloadexternal_llvm-1f28e8ce4d8b2c31769e819619a8600349327ba2.zip
external_llvm-1f28e8ce4d8b2c31769e819619a8600349327ba2.tar.gz
external_llvm-1f28e8ce4d8b2c31769e819619a8600349327ba2.tar.bz2
Fix handling of 'free' if it has absolutely no prototype
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7721 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/IPO/RaiseAllocations.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/RaiseAllocations.cpp b/lib/Transforms/IPO/RaiseAllocations.cpp
index 75c2247..dcfdb34 100644
--- a/lib/Transforms/IPO/RaiseAllocations.cpp
+++ b/lib/Transforms/IPO/RaiseAllocations.cpp
@@ -93,6 +93,13 @@ bool RaiseAllocations::doInitialization(Module &M) {
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;