mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +00:00
Enhance transform passes so that they apply the same tranforms to malloc calls as to MallocInst.
Reviewed by Dan Gohman. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82300 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include "llvm/LLVMContext.h"
|
||||
#include "llvm/Pass.h"
|
||||
#include "llvm/Analysis/ConstantFolding.h"
|
||||
#include "llvm/Analysis/MallocHelper.h"
|
||||
#include "llvm/Analysis/ValueTracking.h"
|
||||
#include "llvm/Transforms/Utils/Local.h"
|
||||
#include "llvm/Support/CallSite.h"
|
||||
@@ -400,7 +401,12 @@ private:
|
||||
void visitStoreInst (Instruction &I);
|
||||
void visitLoadInst (LoadInst &I);
|
||||
void visitGetElementPtrInst(GetElementPtrInst &I);
|
||||
void visitCallInst (CallInst &I) { visitCallSite(CallSite::get(&I)); }
|
||||
void visitCallInst (CallInst &I) {
|
||||
if (isMalloc(&I))
|
||||
markOverdefined(&I);
|
||||
else
|
||||
visitCallSite(CallSite::get(&I));
|
||||
}
|
||||
void visitInvokeInst (InvokeInst &II) {
|
||||
visitCallSite(CallSite::get(&II));
|
||||
visitTerminatorInst(II);
|
||||
|
Reference in New Issue
Block a user