X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAsmParser%2FLLParser.h;h=ca2e2b695f8d5e7578a7bb4e5c095ee09c32a1a7;hb=ab21db79ef1d2530880ad11f21f0b87ffca02dd4;hp=30a49cd8848049a18b8be43e458ee5a2c8d7faa8;hpb=1c7eea60d3cbada2bae54c42fa178078a3ace9b3;p=oota-llvm.git diff --git a/lib/AsmParser/LLParser.h b/lib/AsmParser/LLParser.h index 30a49cd8848..ca2e2b695f8 100644 --- a/lib/AsmParser/LLParser.h +++ b/lib/AsmParser/LLParser.h @@ -28,6 +28,7 @@ namespace llvm { class Instruction; class Constant; class GlobalValue; + class MetadataBase; class MDString; class MDNode; struct ValID; @@ -45,9 +46,9 @@ namespace llvm { std::map > ForwardRefTypeIDs; std::vector NumberedTypes; /// MetadataCache - This map keeps track of parsed metadata constants. - std::map MetadataCache; - std::map > ForwardRefMDNodes; - + std::map MetadataCache; + std::map > ForwardRefMDNodes; + SmallVector, 2> MDsOnInst; struct UpRefRecord { /// Loc - This is the location of the upref. LocTy Loc; @@ -74,9 +75,11 @@ namespace llvm { std::map > ForwardRefVals; std::map > ForwardRefValIDs; std::vector 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; } @@ -125,9 +128,10 @@ namespace llvm { bool HasLinkage; return ParseOptionalLinkage(Linkage, HasLinkage); } bool ParseOptionalVisibility(unsigned &Visibility); - bool ParseOptionalCallingConv(unsigned &CC); + bool ParseOptionalCallingConv(CallingConv::ID &CC); bool ParseOptionalAlignment(unsigned &Alignment); - bool ParseOptionalCommaAlignment(unsigned &Alignment); + bool ParseOptionalCustomMetadata(); + bool ParseOptionalInfo(unsigned &Alignment); bool ParseIndexList(SmallVectorImpl &Indices); // Top-Level Entities @@ -142,11 +146,15 @@ namespace llvm { bool ParseDefine(); bool ParseGlobalType(bool &IsConstant); + bool ParseUnnamedGlobal(); bool ParseNamedGlobal(); bool ParseGlobal(const std::string &Name, LocTy Loc, unsigned Linkage, bool HasLinkage, unsigned Visibility); bool ParseAlias(const std::string &Name, LocTy Loc, unsigned Visibility); bool ParseStandaloneMetadata(); + bool ParseNamedMetadata(); + bool ParseMDString(MetadataBase *&S); + bool ParseMDNode(MetadataBase *&N); // Type Parsing. bool ParseType(PATypeHolder &Result, bool AllowVoid = false); @@ -222,7 +230,13 @@ namespace llvm { Loc = Lex.getLoc(); return ParseTypeAndValue(V, PFS); } - + bool ParseTypeAndBasicBlock(BasicBlock *&BB, LocTy &Loc, + PerFunctionState &PFS); + bool ParseTypeAndBasicBlock(BasicBlock *&BB, PerFunctionState &PFS) { + LocTy Loc; + return ParseTypeAndBasicBlock(BB, Loc, PFS); + } + struct ParamInfo { LocTy Loc; Value *V; @@ -256,6 +270,7 @@ namespace llvm { bool ParseRet(Instruction *&Inst, BasicBlock *BB, PerFunctionState &PFS); bool ParseBr(Instruction *&Inst, PerFunctionState &PFS); bool ParseSwitch(Instruction *&Inst, PerFunctionState &PFS); + bool ParseIndirectBr(Instruction *&Inst, PerFunctionState &PFS); bool ParseInvoke(Instruction *&Inst, PerFunctionState &PFS); bool ParseArithmetic(Instruction *&I, PerFunctionState &PFS, unsigned Opc, @@ -270,8 +285,9 @@ 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 ParseFree(Instruction *&I, PerFunctionState &PFS); + bool ParseAlloc(Instruction *&I, PerFunctionState &PFS, + BasicBlock *BB = 0, bool isAlloca = true); + bool ParseFree(Instruction *&I, PerFunctionState &PFS, BasicBlock *BB); bool ParseLoad(Instruction *&I, PerFunctionState &PFS, bool isVolatile); bool ParseStore(Instruction *&I, PerFunctionState &PFS, bool isVolatile); bool ParseGetResult(Instruction *&I, PerFunctionState &PFS);