diff options
author | Victor Hernandez <vhernandez@apple.com> | 2009-09-24 17:47:49 +0000 |
---|---|---|
committer | Victor Hernandez <vhernandez@apple.com> | 2009-09-24 17:47:49 +0000 |
commit | 46cd46731082e7ad6cd3901e2a13f68d7a774cab (patch) | |
tree | 20ff75183155d9aea9233c735252cd4a21da91d6 /llvm/lib/AsmParser/LLParser.h | |
parent | 5fe313d6e04677908225d4e570f9d989151ba377 (diff) | |
download | bcm5719-llvm-46cd46731082e7ad6cd3901e2a13f68d7a774cab.tar.gz bcm5719-llvm-46cd46731082e7ad6cd3901e2a13f68d7a774cab.zip |
Auto-upgrade malloc instructions to malloc calls.
Reviewed by Devang Patel.
llvm-svn: 82694
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.h')
-rw-r--r-- | llvm/lib/AsmParser/LLParser.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/AsmParser/LLParser.h b/llvm/lib/AsmParser/LLParser.h index 3420fcf4553..43e9bd81f59 100644 --- a/llvm/lib/AsmParser/LLParser.h +++ b/llvm/lib/AsmParser/LLParser.h @@ -75,9 +75,11 @@ namespace llvm { std::map<std::string, std::pair<GlobalValue*, LocTy> > ForwardRefVals; std::map<unsigned, std::pair<GlobalValue*, LocTy> > ForwardRefValIDs; std::vector<GlobalValue*> NumberedVals; + Function* MallocF; public: LLParser(MemoryBuffer *F, SourceMgr &SM, SMDiagnostic &Err, Module *m) : - Context(m->getContext()), Lex(F, SM, Err, m->getContext()), M(m) {} + Context(m->getContext()), Lex(F, SM, Err, m->getContext()), + M(m), MallocF(NULL) {} bool Run(); LLVMContext& getContext() { return Context; } @@ -276,7 +278,8 @@ namespace llvm { bool ParseShuffleVector(Instruction *&I, PerFunctionState &PFS); bool ParsePHI(Instruction *&I, PerFunctionState &PFS); bool ParseCall(Instruction *&I, PerFunctionState &PFS, bool isTail); - bool ParseAlloc(Instruction *&I, PerFunctionState &PFS, unsigned Opc); + bool ParseAlloc(Instruction *&I, PerFunctionState &PFS, + BasicBlock *BB = 0, bool isAlloca = true); bool ParseFree(Instruction *&I, PerFunctionState &PFS); bool ParseLoad(Instruction *&I, PerFunctionState &PFS, bool isVolatile); bool ParseStore(Instruction *&I, PerFunctionState &PFS, bool isVolatile); |