mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Auto-upgrade free instructions to calls to the builtin free function.
Update all analysis passes and transforms to treat free calls just like FreeInst. Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84987 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -24,6 +24,7 @@
|
||||
#include "llvm/ADT/SmallPtrSet.h"
|
||||
#include "llvm/Analysis/ConstantFolding.h"
|
||||
#include "llvm/Analysis/DebugInfo.h"
|
||||
#include "llvm/Analysis/MallocHelper.h"
|
||||
#include "llvm/Analysis/ProfileInfo.h"
|
||||
#include "llvm/Target/TargetData.h"
|
||||
#include "llvm/Support/GetElementPtrTypeIterator.h"
|
||||
@ -59,7 +60,7 @@ bool llvm::isSafeToLoadUnconditionally(Value *V, Instruction *ScanFrom) {
|
||||
|
||||
// If we see a free or a call which may write to memory (i.e. which might do
|
||||
// a free) the pointer could be marked invalid.
|
||||
if (isa<FreeInst>(BBI) ||
|
||||
if (isa<FreeInst>(BBI) || isFreeCall(BBI) ||
|
||||
(isa<CallInst>(BBI) && BBI->mayWriteToMemory() &&
|
||||
!isa<DbgInfoIntrinsic>(BBI)))
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user