aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AsmParser/LLParser.h
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2015-04-01 18:49:24 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-04-01 18:49:26 +0000
commit3fa16bd6062e23bcdb82ed4dd965674792e6b761 (patch)
tree9348fc507292f7e8715d22d64ce5a32131b4f875 /lib/AsmParser/LLParser.h
parentbeed47390a60f6f0c77532b3d3f76bb47ef49423 (diff)
parentebe69fe11e48d322045d5949c83283927a0d790b (diff)
downloadexternal_llvm-3fa16bd6062e23bcdb82ed4dd965674792e6b761.zip
external_llvm-3fa16bd6062e23bcdb82ed4dd965674792e6b761.tar.gz
external_llvm-3fa16bd6062e23bcdb82ed4dd965674792e6b761.tar.bz2
Merge "Update aosp/master LLVM for rebase to r230699."
Diffstat (limited to 'lib/AsmParser/LLParser.h')
-rw-r--r--lib/AsmParser/LLParser.h48
1 files changed, 34 insertions, 14 deletions
diff --git a/lib/AsmParser/LLParser.h b/lib/AsmParser/LLParser.h
index aa62bcc..5e92e57 100644
--- a/lib/AsmParser/LLParser.h
+++ b/lib/AsmParser/LLParser.h
@@ -52,8 +52,6 @@ namespace llvm {
t_EmptyArray, // No value: []
t_Constant, // Value in ConstantVal.
t_InlineAsm, // Value in StrVal/StrVal2/UIntVal.
- t_MDNode, // Value in MDNodeVal.
- t_MDString, // Value in MDStringVal.
t_ConstantStruct, // Value in ConstantStructElts.
t_PackedConstantStruct // Value in ConstantStructElts.
} Kind;
@@ -64,8 +62,6 @@ namespace llvm {
APSInt APSIntVal;
APFloat APFloatVal;
Constant *ConstantVal;
- MDNode *MDNodeVal;
- MDString *MDStringVal;
Constant **ConstantStructElts;
ValID() : Kind(t_LocalID), APFloatVal(0.0) {}
@@ -106,17 +102,16 @@ namespace llvm {
SMLoc Loc;
unsigned MDKind, MDSlot;
};
- DenseMap<Instruction*, std::vector<MDRef> > ForwardRefInstMetadata;
SmallVector<Instruction*, 64> InstsWithTBAATag;
// Type resolution handling data structures. The location is set when we
// have processed a use of the type but not a definition yet.
StringMap<std::pair<Type*, LocTy> > NamedTypes;
- std::vector<std::pair<Type*, LocTy> > NumberedTypes;
+ std::map<unsigned, std::pair<Type*, LocTy> > NumberedTypes;
- std::vector<TrackingVH<MDNode> > NumberedMetadata;
- std::map<unsigned, std::pair<TrackingVH<MDNode>, LocTy> > ForwardRefMDNodes;
+ std::map<unsigned, TrackingMDNodeRef> NumberedMetadata;
+ std::map<unsigned, std::pair<TempMDTuple, LocTy>> ForwardRefMDNodes;
// Global Value reference information.
std::map<std::string, std::pair<GlobalValue*, LocTy> > ForwardRefVals;
@@ -270,14 +265,21 @@ namespace llvm {
bool ParseNamedMetadata();
bool ParseMDString(MDString *&Result);
bool ParseMDNodeID(MDNode *&Result);
- bool ParseMDNodeID(MDNode *&Result, unsigned &SlotNo);
bool ParseUnnamedAttrGrp();
bool ParseFnAttributeValuePairs(AttrBuilder &B,
std::vector<unsigned> &FwdRefAttrGrps,
bool inAttrGrp, LocTy &BuiltinLoc);
// Type Parsing.
- bool ParseType(Type *&Result, bool AllowVoid = false);
+ bool ParseType(Type *&Result, const Twine &Msg, bool AllowVoid = false);
+ bool ParseType(Type *&Result, bool AllowVoid = false) {
+ return ParseType(Result, "expected type", AllowVoid);
+ }
+ bool ParseType(Type *&Result, const Twine &Msg, LocTy &Loc,
+ bool AllowVoid = false) {
+ Loc = Lex.getLoc();
+ return ParseType(Result, Msg, AllowVoid);
+ }
bool ParseType(Type *&Result, LocTy &Loc, bool AllowVoid = false) {
Loc = Lex.getLoc();
return ParseType(Result, AllowVoid);
@@ -381,12 +383,30 @@ namespace llvm {
bool ParseGlobalValue(Type *Ty, Constant *&V);
bool ParseGlobalTypeAndValue(Constant *&V);
bool ParseGlobalValueVector(SmallVectorImpl<Constant *> &Elts);
- bool parseOptionalComdat(Comdat *&C);
- bool ParseMetadataListValue(ValID &ID, PerFunctionState *PFS);
- bool ParseMetadataValue(ValID &ID, PerFunctionState *PFS);
- bool ParseMDNodeVector(SmallVectorImpl<Value*> &, PerFunctionState *PFS);
+ bool parseOptionalComdat(StringRef GlobalName, Comdat *&C);
+ bool ParseMetadataAsValue(Value *&V, PerFunctionState &PFS);
+ bool ParseValueAsMetadata(Metadata *&MD, const Twine &TypeMsg,
+ PerFunctionState *PFS);
+ bool ParseMetadata(Metadata *&MD, PerFunctionState *PFS);
+ bool ParseMDTuple(MDNode *&MD, bool IsDistinct = false);
+ bool ParseMDNode(MDNode *&MD);
+ bool ParseMDNodeTail(MDNode *&MD);
+ bool ParseMDNodeVector(SmallVectorImpl<Metadata *> &MDs);
bool ParseInstructionMetadata(Instruction *Inst, PerFunctionState *PFS);
+ template <class FieldTy>
+ bool ParseMDField(LocTy Loc, StringRef Name, FieldTy &Result);
+ template <class FieldTy> bool ParseMDField(StringRef Name, FieldTy &Result);
+ template <class ParserTy>
+ bool ParseMDFieldsImplBody(ParserTy parseField);
+ template <class ParserTy>
+ bool ParseMDFieldsImpl(ParserTy parseField, LocTy &ClosingLoc);
+ bool ParseSpecializedMDNode(MDNode *&N, bool IsDistinct = false);
+
+#define HANDLE_SPECIALIZED_MDNODE_LEAF(CLASS) \
+ bool Parse##CLASS(MDNode *&Result, bool IsDistinct);
+#include "llvm/IR/Metadata.def"
+
// Function Parsing.
struct ArgInfo {
LocTy Loc;