projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[llvm-dwp] Add coverage for both the presence and absence of type units, and fix...
[oota-llvm.git]
/
include
/
llvm
/
IR
/
Metadata.h
diff --git
a/include/llvm/IR/Metadata.h
b/include/llvm/IR/Metadata.h
index 133e8c4777f4b4a0d6a7e8c78009c42703854266..8805cec1471b8832d9cfafebcb2b5c83f031c0c1 100644
(file)
--- a/
include/llvm/IR/Metadata.h
+++ b/
include/llvm/IR/Metadata.h
@@
-27,10
+27,10
@@
#include <type_traits>
namespace llvm {
#include <type_traits>
namespace llvm {
+
class LLVMContext;
class Module;
class LLVMContext;
class Module;
-template<typename ValueSubClass, typename ItemParentClass>
- class SymbolTableListTraits;
+class ModuleSlotTracker;
enum LLVMConstants : uint32_t {
DEBUG_METADATA_VERSION = 3 // Current debug info version number.
enum LLVMConstants : uint32_t {
DEBUG_METADATA_VERSION = 3 // Current debug info version number.
@@
-59,27
+59,28
@@
protected:
public:
enum MetadataKind {
MDTupleKind,
public:
enum MetadataKind {
MDTupleKind,
- MDLocationKind,
- GenericDebugNodeKind,
- MDSubrangeKind,
- MDEnumeratorKind,
- MDBasicTypeKind,
- MDDerivedTypeKind,
- MDCompositeTypeKind,
- MDSubroutineTypeKind,
- MDFileKind,
- MDCompileUnitKind,
- MDSubprogramKind,
- MDLexicalBlockKind,
- MDLexicalBlockFileKind,
- MDNamespaceKind,
- MDTemplateTypeParameterKind,
- MDTemplateValueParameterKind,
- MDGlobalVariableKind,
- MDLocalVariableKind,
- MDExpressionKind,
- MDObjCPropertyKind,
- MDImportedEntityKind,
+ DILocationKind,
+ GenericDINodeKind,
+ DISubrangeKind,
+ DIEnumeratorKind,
+ DIBasicTypeKind,
+ DIDerivedTypeKind,
+ DICompositeTypeKind,
+ DISubroutineTypeKind,
+ DIFileKind,
+ DICompileUnitKind,
+ DISubprogramKind,
+ DILexicalBlockKind,
+ DILexicalBlockFileKind,
+ DINamespaceKind,
+ DIModuleKind,
+ DITemplateTypeParameterKind,
+ DITemplateValueParameterKind,
+ DIGlobalVariableKind,
+ DILocalVariableKind,
+ DIExpressionKind,
+ DIObjCPropertyKind,
+ DIImportedEntityKind,
ConstantAsMetadataKind,
LocalAsMetadataKind,
MDStringKind
ConstantAsMetadataKind,
LocalAsMetadataKind,
MDStringKind
@@
-89,7
+90,7
@@
protected:
Metadata(unsigned ID, StorageType Storage)
: SubclassID(ID), Storage(Storage), SubclassData16(0), SubclassData32(0) {
}
Metadata(unsigned ID, StorageType Storage)
: SubclassID(ID), Storage(Storage), SubclassData16(0), SubclassData32(0) {
}
- ~Metadata()
{}
+ ~Metadata()
= default;
/// \brief Default handling of a changed operand, which asserts.
///
/// \brief Default handling of a changed operand, which asserts.
///
@@
-121,7
+122,12
@@
public:
///
/// If \c M is provided, metadata nodes will be numbered canonically;
/// otherwise, pointer addresses are substituted.
///
/// 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.
///
/// \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.
///
/// 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, const Module *M = nullptr) const;
+ void printAsOperand(raw_ostream &OS, ModuleSlotTracker &MST,
+ const Module *M = nullptr) const;
+ /// @}
};
#define HANDLE_METADATA(CLASS) class CLASS;
};
#define HANDLE_METADATA(CLASS) class CLASS;
@@
-164,7
+174,7
@@
class MetadataAsValue : public Value {
Metadata *MD;
MetadataAsValue(Type *Ty, Metadata *MD);
Metadata *MD;
MetadataAsValue(Type *Ty, Metadata *MD);
- ~MetadataAsValue();
+ ~MetadataAsValue()
override
;
/// \brief Drop use of metadata (during teardown).
void dropUse() { MD = nullptr; }
/// \brief Drop use of metadata (during teardown).
void dropUse() { MD = nullptr; }
@@
-253,7
+263,7
@@
protected:
: Metadata(ID, Uniqued), ReplaceableMetadataImpl(V->getContext()), V(V) {
assert(V && "Expected valid value");
}
: Metadata(ID, Uniqued), ReplaceableMetadataImpl(V->getContext()), V(V) {
assert(V && "Expected valid value");
}
- ~ValueAsMetadata()
{}
+ ~ValueAsMetadata()
= default;
public:
static ValueAsMetadata *get(Value *V);
public:
static ValueAsMetadata *get(Value *V);
@@
-560,10
+570,12
@@
struct AAMDNodes {
template<>
struct DenseMapInfo<AAMDNodes> {
static inline AAMDNodes getEmptyKey() {
template<>
struct DenseMapInfo<AAMDNodes> {
static inline AAMDNodes getEmptyKey() {
- return AAMDNodes(DenseMapInfo<MDNode *>::getEmptyKey(), 0, 0);
+ return AAMDNodes(DenseMapInfo<MDNode *>::getEmptyKey(),
+ nullptr, nullptr);
}
static inline AAMDNodes getTombstoneKey() {
}
static inline AAMDNodes getTombstoneKey() {
- return AAMDNodes(DenseMapInfo<MDNode *>::getTombstoneKey(), 0, 0);
+ return AAMDNodes(DenseMapInfo<MDNode *>::getTombstoneKey(),
+ nullptr, nullptr);
}
static unsigned getHashValue(const AAMDNodes &Val) {
return DenseMapInfo<MDNode *>::getHashValue(Val.TBAA) ^
}
static unsigned getHashValue(const AAMDNodes &Val) {
return DenseMapInfo<MDNode *>::getHashValue(Val.TBAA) ^
@@
-754,7
+766,7
@@
protected:
MDNode(LLVMContext &Context, unsigned ID, StorageType Storage,
ArrayRef<Metadata *> Ops1, ArrayRef<Metadata *> Ops2 = None);
MDNode(LLVMContext &Context, unsigned ID, StorageType Storage,
ArrayRef<Metadata *> Ops1, ArrayRef<Metadata *> Ops2 = None);
- ~MDNode()
{}
+ ~MDNode()
= default;
void dropAllReferences();
void dropAllReferences();
@@
-869,6
+881,7
@@
protected:
void storeDistinctInContext();
template <class T, class StoreT>
static T *storeImpl(T *N, StorageType Storage, StoreT &Store);
void storeDistinctInContext();
template <class T, class StoreT>
static T *storeImpl(T *N, StorageType Storage, StoreT &Store);
+ template <class T> static T *storeImpl(T *N, StorageType Storage);
private:
void handleChangedOperand(void *Ref, Metadata *New);
private:
void handleChangedOperand(void *Ref, Metadata *New);
@@
-901,13
+914,13
@@
private:
N->recalculateHash();
}
template <class NodeTy>
N->recalculateHash();
}
template <class NodeTy>
- static void dispatchRecalculateHash(NodeTy *
N
, std::false_type) {}
+ static void dispatchRecalculateHash(NodeTy *, std::false_type) {}
template <class NodeTy>
static void dispatchResetHash(NodeTy *N, std::true_type) {
N->setHash(0);
}
template <class NodeTy>
template <class NodeTy>
static void dispatchResetHash(NodeTy *N, std::true_type) {
N->setHash(0);
}
template <class NodeTy>
- static void dispatchResetHash(NodeTy *
N
, std::false_type) {}
+ static void dispatchResetHash(NodeTy *, std::false_type) {}
public:
typedef const MDOperand *op_iterator;
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 *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.
};
/// \brief Tuple of metadata.
@@
-1079,10
+1094,10
@@
public:
template <class U>
explicit MDTupleTypedArrayWrapper(
template <class U>
explicit MDTupleTypedArrayWrapper(
- const
U &Tuple
,
- typename std::enable_if<
-
std::is_constructible<const MDTuple *, U>::value>::type * =
nullptr)
- : N(
Tuple
) {}
+ const
MDTupleTypedArrayWrapper<U> &Other
,
+ typename std::enable_if<
!std::is_convertible<U *, T *>::value>::type * =
+ nullptr)
+ : N(
Other.get()
) {}
explicit operator bool() const { return get(); }
explicit operator MDTuple *() const { return get(); }
explicit operator bool() const { return get(); }
explicit operator MDTuple *() const { return get(); }
@@
-1113,7
+1128,6
@@
public:
///
/// TODO: Inherit from Metadata.
class NamedMDNode : public ilist_node<NamedMDNode> {
///
/// TODO: Inherit from Metadata.
class NamedMDNode : public ilist_node<NamedMDNode> {
- friend class SymbolTableListTraits<NamedMDNode, Module>;
friend struct ilist_traits<NamedMDNode>;
friend class LLVMContextImpl;
friend class Module;
friend struct ilist_traits<NamedMDNode>;
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 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;
// ---------------------------------------------------------------------------
void dump() const;
// ---------------------------------------------------------------------------
@@
-1205,4
+1219,4
@@
public:
} // end llvm namespace
} // end llvm namespace
-#endif
+#endif
// LLVM_IR_METADATA_H