diff options
Diffstat (limited to 'lib/Transforms/IPO/RaiseAllocations.cpp')
| -rw-r--r-- | lib/Transforms/IPO/RaiseAllocations.cpp | 7 |
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; |
