LLVM  3.7.0
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
llvm::Metadata Class Reference

Root of the metadata hierarchy. More...

#include <Metadata.h>

Inheritance diagram for llvm::Metadata:
[legend]
Collaboration diagram for llvm::Metadata:
[legend]

Public Types

enum  MetadataKind {
  MDTupleKind, 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
}
 

Public Member Functions

unsigned getMetadataID () const
 
void dump () const
 User-friendly dump. More...
 
void dump (const Module *M) const
 
void print (raw_ostream &OS, const Module *M=nullptr) const
 Print. More...
 
void print (raw_ostream &OS, ModuleSlotTracker &MST, const Module *M=nullptr) const
 
void printAsOperand (raw_ostream &OS, const Module *M=nullptr) const
 Print as operand. More...
 
void printAsOperand (raw_ostream &OS, ModuleSlotTracker &MST, const Module *M=nullptr) const
 

Protected Types

enum  StorageType { Uniqued, Distinct, Temporary }
 Active type of storage. More...
 

Protected Member Functions

 Metadata (unsigned ID, StorageType Storage)
 
 ~Metadata ()=default
 
void handleChangedOperand (void *, Metadata *)
 Default handling of a changed operand, which asserts. More...
 

Protected Attributes

unsigned Storage: 2
 Storage flag for non-uniqued, otherwise unowned, metadata. More...
 
unsigned short SubclassData16
 
unsigned SubclassData32
 

Friends

class ReplaceableMetadataImpl
 

Detailed Description

Root of the metadata hierarchy.

This is a root class for typeless data in the IR.

Definition at line 45 of file Metadata.h.

Member Enumeration Documentation

Enumerator
MDTupleKind 
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 

Definition at line 63 of file Metadata.h.

Active type of storage.

Enumerator
Uniqued 
Distinct 
Temporary 

Definition at line 53 of file Metadata.h.

Constructor & Destructor Documentation

llvm::Metadata::Metadata ( unsigned  ID,
StorageType  Storage 
)
inlineprotected

Definition at line 93 of file Metadata.h.

llvm::Metadata::~Metadata ( )
protecteddefault

Member Function Documentation

LLVM_DUMP_METHOD void Metadata::dump ( ) const

User-friendly dump.

If M is provided, metadata nodes will be numbered canonically; otherwise, pointer addresses are substituted.

Note: this uses an explicit overload instead of default arguments so that the nullptr version is easy to call from a debugger.

Definition at line 3372 of file AsmWriter.cpp.

Referenced by llvm::LexicalScope::dump().

LLVM_DUMP_METHOD void Metadata::dump ( const Module M) const

Definition at line 3375 of file AsmWriter.cpp.

References llvm::dbgs(), and print().

unsigned llvm::Metadata::getMetadataID ( ) const
inline
void llvm::Metadata::handleChangedOperand ( void *  ,
Metadata  
)
inlineprotected

Default handling of a changed operand, which asserts.

If subclasses pass themselves in as owners to a tracking node reference, they must provide an implementation of this method.

Definition at line 102 of file Metadata.h.

References llvm_unreachable.

void Metadata::print ( raw_ostream OS,
const Module M = nullptr 
) const

Print.

Prints definition of this.

If M is provided, metadata nodes will be numbered canonically; otherwise, pointer addresses are substituted.

Definition at line 3341 of file AsmWriter.cpp.

References printMetadataImpl().

Referenced by dump(), llvm::operator<<(), and llvm::ValueEnumerator::print().

void Metadata::print ( raw_ostream OS,
ModuleSlotTracker MST,
const Module M = nullptr 
) const

Definition at line 3346 of file AsmWriter.cpp.

References printMetadataImpl().

void Metadata::printAsOperand ( raw_ostream OS,
const Module M = nullptr 
) const

Print as operand.

Prints reference of this.

If M is provided, metadata nodes will be numbered canonically; otherwise, pointer addresses are substituted.

Definition at line 3331 of file AsmWriter.cpp.

References printMetadataImpl().

void Metadata::printAsOperand ( raw_ostream OS,
ModuleSlotTracker MST,
const Module M = nullptr 
) const

Definition at line 3336 of file AsmWriter.cpp.

References printMetadataImpl().

Friends And Related Function Documentation

friend class ReplaceableMetadataImpl
friend

Definition at line 46 of file Metadata.h.

Member Data Documentation

unsigned llvm::Metadata::Storage
protected

Storage flag for non-uniqued, otherwise unowned, metadata.

Definition at line 56 of file Metadata.h.

Referenced by llvm::MDNode::isDistinct(), llvm::MDNode::isTemporary(), and llvm::MDNode::isUniqued().

unsigned short llvm::Metadata::SubclassData16
protected
unsigned llvm::Metadata::SubclassData32
protected

Definition at line 60 of file Metadata.h.

Referenced by llvm::GenericDINode::getHash(), and llvm::MDTuple::getHash().


The documentation for this class was generated from the following files: