Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/include/llvm/IR/Metadata.h
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | class Metadata { | ||||
/// RTTI. | /// RTTI. | ||||
const unsigned char SubclassID; | const unsigned char SubclassID; | ||||
protected: | protected: | ||||
/// Active type of storage. | /// Active type of storage. | ||||
enum StorageType { Uniqued, Distinct, Temporary }; | enum StorageType { Uniqued, Distinct, Temporary }; | ||||
/// Storage flag for non-uniqued, otherwise unowned, metadata. | /// Storage flag for non-uniqued, otherwise unowned, metadata. | ||||
unsigned char Storage; | unsigned char Storage : 7; | ||||
// TODO: expose remaining bits to subclasses. | // TODO: expose remaining bits to subclasses. | ||||
unsigned char ImplicitCode : 1; | |||||
unsigned short SubclassData16 = 0; | unsigned short SubclassData16 = 0; | ||||
unsigned SubclassData32 = 0; | unsigned SubclassData32 = 0; | ||||
public: | public: | ||||
enum MetadataKind { | enum MetadataKind { | ||||
#define HANDLE_METADATA_LEAF(CLASS) CLASS##Kind, | #define HANDLE_METADATA_LEAF(CLASS) CLASS##Kind, | ||||
#include "llvm/IR/Metadata.def" | #include "llvm/IR/Metadata.def" | ||||
}; | }; | ||||
protected: | protected: | ||||
Metadata(unsigned ID, StorageType Storage) | Metadata(unsigned ID, StorageType Storage) | ||||
: SubclassID(ID), Storage(Storage) { | : SubclassID(ID), Storage(Storage), ImplicitCode(false) { | ||||
static_assert(sizeof(*this) == 8, "Metadata fields poorly packed"); | static_assert(sizeof(*this) == 8, "Metadata fields poorly packed"); | ||||
} | } | ||||
~Metadata() = default; | ~Metadata() = default; | ||||
/// Default handling of a changed operand, which asserts. | /// Default handling of a changed operand, which asserts. | ||||
/// | /// | ||||
/// If subclasses pass themselves in as owners to a tracking node reference, | /// If subclasses pass themselves in as owners to a tracking node reference, | ||||
▲ Show 20 Lines • Show All 1,338 Lines • Show Last 20 Lines |