LLVM 18.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::MDString Class Reference

A single uniqued string. More...

#include "llvm/IR/Metadata.h"

Inheritance diagram for llvm::MDString:
Inheritance graph
[legend]

Public Types

using iterator = StringRef::iterator
 

Public Member Functions

 MDString (const MDString &)=delete
 
MDStringoperator= (MDString &&)=delete
 
MDStringoperator= (const MDString &)=delete
 
StringRef getString () const
 
unsigned getLength () const
 
iterator begin () const
 Pointer to the first byte of the string.
 
iterator end () const
 Pointer to one byte past the end of the string.
 
const unsigned charbytes_begin () const
 
const unsigned charbytes_end () const
 

Static Public Member Functions

static MDStringget (LLVMContext &Context, StringRef Str)
 
static MDStringget (LLVMContext &Context, const char *Str)
 
static bool classof (const Metadata *MD)
 Methods for support type inquiry through isa, cast, and dyn_cast.
 

Friends

class StringMapEntryStorage< MDString >
 

Additional Inherited Members

 Active type of storage. More...

Detailed Description

A single uniqued string.

These are used to efficiently contain a byte sequence for metadata. MDString is always unnamed.

Definition at line 698 of file Metadata.h.

Member Typedef Documentation

◆ iterator

Definition at line 719 of file Metadata.h.

Constructor & Destructor Documentation

◆ MDString()

llvm::MDString::MDString ( const MDString )
delete

Member Function Documentation

◆ begin()

iterator llvm::MDString::begin ( ) const
inline

Pointer to the first byte of the string.

Definition at line 722 of file Metadata.h.

References llvm::StringRef::begin(), and getString().

◆ bytes_begin()

const unsigned char * llvm::MDString::bytes_begin ( ) const
inline

Definition at line 727 of file Metadata.h.

References llvm::StringRef::bytes_begin(), and getString().

◆ bytes_end()

const unsigned char * llvm::MDString::bytes_end ( ) const
inline

Definition at line 728 of file Metadata.h.

References llvm::StringRef::bytes_end(), and getString().

◆ classof()

static bool llvm::MDString::classof ( const Metadata MD)
inlinestatic

Methods for support type inquiry through isa, cast, and dyn_cast.

Definition at line 731 of file Metadata.h.

References llvm::Metadata::getMetadataID().

◆ end()

iterator llvm::MDString::end ( ) const
inline

Pointer to one byte past the end of the string.

Definition at line 725 of file Metadata.h.

References llvm::StringRef::end(), and getString().

◆ get() [1/2]

static MDString * llvm::MDString::get ( LLVMContext Context,
const char Str 
)
inlinestatic

Definition at line 711 of file Metadata.h.

References Context, and get().

◆ get() [2/2]

MDString * MDString::get ( LLVMContext Context,
StringRef  Str 
)
static

Definition at line 564 of file Metadata.cpp.

References Context, I, llvm::LLVMContextImpl::MDStringCache, and llvm::LLVMContext::pImpl.

Referenced by llvm::Module::addModuleFlag(), AddRuntimeUnrollDisableMetaData(), llvm::OpenMPIRBuilder::applySimd(), convertToLocalCopy(), createMIBNode(), llvm::OpenMPIRBuilder::createOffloadEntriesAndInfoMetadata(), llvm::OpenMPIRBuilder::createOffloadEntry(), llvm::createPGOFuncNameMetadata(), llvm::dxil::createShaderModelMD(), llvm::MDBuilder::createString(), createStringMetadata(), llvm::DIBuilder::createTemplateTemplateParameter(), DisableAllLoopOptsOnLoop(), llvm::embedBufferInModule(), llvm::emitAMDGPUPrintfCall(), llvm::hlsl::FrontendResource::FrontendResource(), get(), llvm::DINode::getCanonicalMDString(), llvm::DIMacroNode::getCanonicalMDString(), getKeyFPValMD(), getKeyValMD(), llvm::GCNTTIImpl::instCombineIntrinsic(), LLVMMDStringInContext(), LLVMMDStringInContext2(), llvm::LLParser::parseMDField(), postUnswitch(), llvm::LoopVectorizeHints::setAlreadyVectorized(), llvm::Module::setDarwinTargetVariantTriple(), llvm::Loop::setLoopAlreadyUnrolled(), llvm::Loop::setLoopMustProgress(), llvm::Module::setStackProtectorGuard(), llvm::Module::setStackProtectorGuardReg(), llvm::Module::setStackProtectorGuardSymbol(), solveTypeName(), llvm::OpenMPIRBuilder::unrollLoopFull(), llvm::OpenMPIRBuilder::unrollLoopHeuristic(), llvm::OpenMPIRBuilder::unrollLoopPartial(), updateNVPTXMetadata(), upgradeLoopTag(), llvm::UpgradeModuleFlags(), UpgradeRetainReleaseMarker(), and llvm::dxil::ResourceBase::write().

◆ getLength()

unsigned llvm::MDString::getLength ( ) const
inline

Definition at line 717 of file Metadata.h.

References getString(), and llvm::StringRef::size().

◆ getString()

StringRef MDString::getString ( ) const

◆ operator=() [1/2]

MDString & llvm::MDString::operator= ( const MDString )
delete

◆ operator=() [2/2]

MDString & llvm::MDString::operator= ( MDString &&  )
delete

Friends And Related Function Documentation

◆ StringMapEntryStorage< MDString >

friend class StringMapEntryStorage< MDString >
friend

Definition at line 615 of file Metadata.h.


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