X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAsmParser%2FLLParser.h;h=556b385c3c4201be4f8b2abe648fd3ca71207283;hb=6238162cc518a915aba296ddda24311d4974290f;hp=a3eb8d3ed3869797cb4e8d8c6cb5d57a5e05ac55;hpb=02822390510359b0ec307c2c5d3e7ea5f635f6fe;p=oota-llvm.git diff --git a/lib/AsmParser/LLParser.h b/lib/AsmParser/LLParser.h index a3eb8d3ed38..556b385c3c4 100644 --- a/lib/AsmParser/LLParser.h +++ b/lib/AsmParser/LLParser.h @@ -128,17 +128,21 @@ namespace llvm { // References to blockaddress. The key is the function ValID, the value is // a list of references to blocks in that function. - std::map > > - ForwardRefBlockAddresses; + std::map> ForwardRefBlockAddresses; + class PerFunctionState; + /// Reference to per-function state to allow basic blocks to be + /// forward-referenced by blockaddress instructions within the same + /// function. + PerFunctionState *BlockAddressPFS; // Attribute builder reference information. std::map > ForwardRefAttrGroups; std::map NumberedAttrBuilders; public: - LLParser(StringRef F, SourceMgr &SM, SMDiagnostic &Err, Module *m) : - Context(m->getContext()), Lex(F, SM, Err, m->getContext()), - M(m) {} + LLParser(StringRef F, SourceMgr &SM, SMDiagnostic &Err, Module *m) + : Context(m->getContext()), Lex(F, SM, Err, m->getContext()), M(m), + BlockAddressPFS(nullptr) {} bool Run(); LLVMContext &getContext() { return Context; } @@ -327,6 +331,8 @@ namespace llvm { /// unnamed. If there is an error, this returns null otherwise it returns /// the block being defined. BasicBlock *DefineBB(const std::string &Name, LocTy Loc); + + bool resolveForwardRefBlockAddresses(); }; bool ConvertValIDToValue(Type *Ty, ValID &ID, Value *&V, @@ -372,7 +378,7 @@ namespace llvm { bool ParseValID(ValID &ID, PerFunctionState *PFS = nullptr); bool ParseGlobalValue(Type *Ty, Constant *&V); bool ParseGlobalTypeAndValue(Constant *&V); - bool ParseGlobalValueVector(SmallVectorImpl &Elts); + bool ParseGlobalValueVector(SmallVectorImpl &Elts); bool parseOptionalComdat(Comdat *&C); bool ParseMetadataListValue(ValID &ID, PerFunctionState *PFS); bool ParseMetadataValue(ValID &ID, PerFunctionState *PFS); @@ -432,10 +438,6 @@ namespace llvm { int ParseGetElementPtr(Instruction *&I, PerFunctionState &PFS); int ParseExtractValue(Instruction *&I, PerFunctionState &PFS); int ParseInsertValue(Instruction *&I, PerFunctionState &PFS); - - bool ResolveForwardRefBlockAddresses(Function *TheFn, - std::vector > &Refs, - PerFunctionState *PFS); }; } // End llvm namespace