Deleted Added
full compact
19a20
> #include "llvm/Support/ValueHandle.h"
48c49,50
< t_Metadata // Value in MetadataVal.
---
> t_MDNode, // Value in MDNodeVal.
> t_MDString // Value in MDStringVal.
57c59,60
< MetadataBase *MetadataVal;
---
> MDNode *MDNodeVal;
> MDString *MDStringVal;
81,84c84,85
< /// MetadataCache - This map keeps track of parsed metadata constants.
< std::map<unsigned, WeakVH> MetadataCache;
< std::map<unsigned, std::pair<WeakVH, LocTy> > ForwardRefMDNodes;
< SmallVector<std::pair<unsigned, MDNode *>, 2> MDsOnInst;
---
> std::vector<TrackingVH<MDNode> > NumberedMetadata;
> std::map<unsigned, std::pair<TrackingVH<MDNode>, LocTy> > ForwardRefMDNodes;
172,174c173,183
< bool ParseOptionalCustomMetadata();
< bool ParseOptionalInfo(unsigned &Alignment);
< bool ParseIndexList(SmallVectorImpl<unsigned> &Indices);
---
> bool ParseInstructionMetadata(SmallVectorImpl<std::pair<unsigned,
> MDNode *> > &);
> bool ParseOptionalCommaAlign(unsigned &Alignment, bool &AteExtraComma);
> bool ParseIndexList(SmallVectorImpl<unsigned> &Indices,bool &AteExtraComma);
> bool ParseIndexList(SmallVectorImpl<unsigned> &Indices) {
> bool AteExtraComma;
> if (ParseIndexList(Indices, AteExtraComma)) return true;
> if (AteExtraComma)
> return TokError("expected index");
> return false;
> }
195,196c204,205
< bool ParseMDString(MetadataBase *&S);
< bool ParseMDNode(MetadataBase *&N);
---
> bool ParseMDString(MDString *&Result);
> bool ParseMDNodeID(MDNode *&Result);
212a222,223
> bool ConvertGlobalOrMetadataValIDToValue(const Type *Ty, ValID &ID,
> Value *&V);
283,284d293
< bool ParseInlineMetadata(Value *&V, PerFunctionState &PFS);
<
310,312c319,323
< // Instruction Parsing.
< bool ParseInstruction(Instruction *&Inst, BasicBlock *BB,
< PerFunctionState &PFS);
---
> // Instruction Parsing. Each instruction parsing routine can return with a
> // normal result, an error result, or return having eaten an extra comma.
> enum InstResult { InstNormal = 0, InstError = 1, InstExtraComma = 2 };
> int ParseInstruction(Instruction *&Inst, BasicBlock *BB,
> PerFunctionState &PFS);
315c326
< bool ParseRet(Instruction *&Inst, BasicBlock *BB, PerFunctionState &PFS);
---
> int ParseRet(Instruction *&Inst, BasicBlock *BB, PerFunctionState &PFS);
331c342
< bool ParsePHI(Instruction *&I, PerFunctionState &PFS);
---
> int ParsePHI(Instruction *&I, PerFunctionState &PFS);
333c344
< bool ParseAlloc(Instruction *&I, PerFunctionState &PFS,
---
> int ParseAlloc(Instruction *&I, PerFunctionState &PFS,
336,337c347,348
< bool ParseLoad(Instruction *&I, PerFunctionState &PFS, bool isVolatile);
< bool ParseStore(Instruction *&I, PerFunctionState &PFS, bool isVolatile);
---
> int ParseLoad(Instruction *&I, PerFunctionState &PFS, bool isVolatile);
> int ParseStore(Instruction *&I, PerFunctionState &PFS, bool isVolatile);
339,341c350,352
< bool ParseGetElementPtr(Instruction *&I, PerFunctionState &PFS);
< bool ParseExtractValue(Instruction *&I, PerFunctionState &PFS);
< bool ParseInsertValue(Instruction *&I, PerFunctionState &PFS);
---
> int ParseGetElementPtr(Instruction *&I, PerFunctionState &PFS);
> int ParseExtractValue(Instruction *&I, PerFunctionState &PFS);
> int ParseInsertValue(Instruction *&I, PerFunctionState &PFS);