X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FIR%2FMetadata.h;h=8805cec1471b8832d9cfafebcb2b5c83f031c0c1;hb=2b762697564ca1e12e0e974e93ceeb4c3420505c;hp=bf4a030cd362e44a8f12b45e4506164c4964d341;hpb=cf0db29df20d9c665da7e82bb261bdd7cf7f1b2b;p=oota-llvm.git diff --git a/include/llvm/IR/Metadata.h b/include/llvm/IR/Metadata.h index bf4a030cd36..8805cec1471 100644 --- a/include/llvm/IR/Metadata.h +++ b/include/llvm/IR/Metadata.h @@ -27,10 +27,10 @@ #include namespace llvm { + class LLVMContext; class Module; -template - class SymbolTableListTraits; +class ModuleSlotTracker; enum LLVMConstants : uint32_t { DEBUG_METADATA_VERSION = 3 // Current debug info version number. @@ -73,6 +73,7 @@ public: DILexicalBlockKind, DILexicalBlockFileKind, DINamespaceKind, + DIModuleKind, DITemplateTypeParameterKind, DITemplateValueParameterKind, DIGlobalVariableKind, @@ -121,7 +122,12 @@ public: /// /// If \c M is provided, metadata nodes will be numbered canonically; /// otherwise, pointer addresses are substituted. - void print(raw_ostream &OS, const Module *M = nullptr) const; + /// @{ + void print(raw_ostream &OS, const Module *M = nullptr, + bool IsForDebug = false) const; + void print(raw_ostream &OS, ModuleSlotTracker &MST, const Module *M = nullptr, + bool IsForDebug = false) const; + /// @} /// \brief Print as operand. /// @@ -129,7 +135,11 @@ public: /// /// If \c M is provided, metadata nodes will be numbered canonically; /// otherwise, pointer addresses are substituted. + /// @{ void printAsOperand(raw_ostream &OS, const Module *M = nullptr) const; + void printAsOperand(raw_ostream &OS, ModuleSlotTracker &MST, + const Module *M = nullptr) const; + /// @} }; #define HANDLE_METADATA(CLASS) class CLASS; @@ -560,10 +570,12 @@ struct AAMDNodes { template<> struct DenseMapInfo { static inline AAMDNodes getEmptyKey() { - return AAMDNodes(DenseMapInfo::getEmptyKey(), 0, 0); + return AAMDNodes(DenseMapInfo::getEmptyKey(), + nullptr, nullptr); } static inline AAMDNodes getTombstoneKey() { - return AAMDNodes(DenseMapInfo::getTombstoneKey(), 0, 0); + return AAMDNodes(DenseMapInfo::getTombstoneKey(), + nullptr, nullptr); } static unsigned getHashValue(const AAMDNodes &Val) { return DenseMapInfo::getHashValue(Val.TBAA) ^ @@ -869,6 +881,7 @@ protected: void storeDistinctInContext(); template static T *storeImpl(T *N, StorageType Storage, StoreT &Store); + template static T *storeImpl(T *N, StorageType Storage); private: void handleChangedOperand(void *Ref, Metadata *New); @@ -901,13 +914,13 @@ private: N->recalculateHash(); } template - static void dispatchRecalculateHash(NodeTy *N, std::false_type) {} + static void dispatchRecalculateHash(NodeTy *, std::false_type) {} template static void dispatchResetHash(NodeTy *N, std::true_type) { N->setHash(0); } template - static void dispatchResetHash(NodeTy *N, std::false_type) {} + static void dispatchResetHash(NodeTy *, std::false_type) {} public: typedef const MDOperand *op_iterator; @@ -951,6 +964,8 @@ public: static MDNode *getMostGenericFPMath(MDNode *A, MDNode *B); static MDNode *getMostGenericRange(MDNode *A, MDNode *B); static MDNode *getMostGenericAliasScope(MDNode *A, MDNode *B); + static MDNode *getMostGenericAlignmentOrDereferenceable(MDNode *A, MDNode *B); + }; /// \brief Tuple of metadata. @@ -1113,7 +1128,6 @@ public: /// /// TODO: Inherit from Metadata. class NamedMDNode : public ilist_node { - friend class SymbolTableListTraits; friend struct ilist_traits; friend class LLVMContextImpl; friend class Module; @@ -1181,7 +1195,7 @@ public: void addOperand(MDNode *M); void setOperand(unsigned I, MDNode *New); StringRef getName() const; - void print(raw_ostream &ROS) const; + void print(raw_ostream &ROS, bool IsForDebug = false) const; void dump() const; // --------------------------------------------------------------------------- @@ -1203,6 +1217,6 @@ public: } }; -} // namespace llvm +} // end llvm namespace -#endif +#endif // LLVM_IR_METADATA_H