LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::MDString Class Reference

#include <Metadata.h>

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

Public Types

typedef StringRef::iterator iterator
 
- Public Types inherited from llvm::Value
enum  ValueTy {
  ArgumentVal, BasicBlockVal, FunctionVal, GlobalAliasVal,
  GlobalVariableVal, UndefValueVal, BlockAddressVal, ConstantExprVal,
  ConstantAggregateZeroVal, ConstantDataArrayVal, ConstantDataVectorVal, ConstantIntVal,
  ConstantFPVal, ConstantArrayVal, ConstantStructVal, ConstantVectorVal,
  ConstantPointerNullVal, MDNodeVal, MDStringVal, InlineAsmVal,
  PseudoSourceValueVal, FixedStackPseudoSourceValueVal, InstructionVal, ConstantFirstVal = FunctionVal,
  ConstantLastVal = ConstantPointerNullVal
}
 
typedef value_use_iterator< Useruse_iterator
 
typedef value_use_iterator
< const User
const_use_iterator
 

Public Member Functions

StringRef getString () const
 
unsigned getLength () const
 
iterator begin () const
 begin() - Pointer to the first byte of the string. More...
 
iterator end () const
 end() - Pointer to one byte past the end of the string. More...
 
- Public Member Functions inherited from llvm::Value
virtual ~Value ()
 
void dump () const
 dump - Support for debugging, callable in GDB: V->dump() More...
 
void print (raw_ostream &O, AssemblyAnnotationWriter *AAW=0) const
 
TypegetType () const
 
LLVMContextgetContext () const
 All values hold a context through their type. More...
 
bool hasName () const
 
ValueNamegetValueName () const
 
void setValueName (ValueName *VN)
 
StringRef getName () const
 
void setName (const Twine &Name)
 
void takeName (Value *V)
 
void replaceAllUsesWith (Value *V)
 
bool use_empty () const
 
use_iterator use_begin ()
 
const_use_iterator use_begin () const
 
use_iterator use_end ()
 
const_use_iterator use_end () const
 
Useruse_back ()
 
const Useruse_back () const
 
bool hasOneUse () const
 
bool hasNUses (unsigned N) const
 
bool hasNUsesOrMore (unsigned N) const
 
bool isUsedInBasicBlock (const BasicBlock *BB) const
 
unsigned getNumUses () const
 
void addUse (Use &U)
 
unsigned getValueID () const
 
unsigned getRawSubclassOptionalData () const
 
void clearSubclassOptionalData ()
 
bool hasSameSubclassOptionalData (const Value *V) const
 
void intersectOptionalDataWith (const Value *V)
 
bool hasValueHandle () const
 
ValuestripPointerCasts ()
 Strips off any unneeded pointer casts, all-zero GEPs and aliases from the specified value, returning the original uncasted value. More...
 
const ValuestripPointerCasts () const
 
ValuestripPointerCastsNoFollowAliases ()
 Strips off any unneeded pointer casts and all-zero GEPs from the specified value, returning the original uncasted value. More...
 
const ValuestripPointerCastsNoFollowAliases () const
 
ValuestripInBoundsConstantOffsets ()
 Strips off unneeded pointer casts and all-constant GEPs from the specified value, returning the original pointer value. More...
 
const ValuestripInBoundsConstantOffsets () const
 
ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset)
 Strips like stripInBoundsConstantOffsets but also accumulates the constant offset stripped. More...
 
const ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const
 
ValuestripInBoundsOffsets ()
 Strips off unneeded pointer casts and any in-bounds offsets from the specified value, returning the original pointer value. More...
 
const ValuestripInBoundsOffsets () const
 
bool isDereferenceablePointer () const
 
ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB)
 
const ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const
 
void mutateType (Type *Ty)
 

Static Public Member Functions

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

Additional Inherited Members

- Static Public Attributes inherited from llvm::Value
static const unsigned MaximumAlignment = 1u << 29
 
- Protected Member Functions inherited from llvm::Value
virtual void printCustom (raw_ostream &O) const
 
 Value (Type *Ty, unsigned scid)
 
unsigned short getSubclassDataFromValue () const
 
void setValueSubclassData (unsigned short D)
 
- Protected Attributes inherited from llvm::Value
unsigned char SubclassOptionalData: 7
 

Detailed Description

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

Definition at line 35 of file Metadata.h.

Member Typedef Documentation

Definition at line 50 of file Metadata.h.

Member Function Documentation

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

begin() - Pointer to the first byte of the string.

Definition at line 53 of file Metadata.h.

References llvm::StringRef::begin(), and llvm::Value::getName().

static bool llvm::MDString::classof ( const Value V)
inlinestatic

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

Definition at line 59 of file Metadata.h.

References llvm::Value::getValueID(), and llvm::Value::MDStringVal.

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

end() - Pointer to one byte past the end of the string.

Definition at line 56 of file Metadata.h.

References llvm::StringRef::end(), and llvm::Value::getName().

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

Definition at line 38 of file Metadata.cpp.

References llvm::StringMap< ValueTy, AllocatorTy >::GetOrCreateValue(), llvm::StringMapEntry< ValueTy >::getValue(), llvm::LLVMContextImpl::MDStringCache, llvm::LLVMContext::pImpl, and llvm::Value::setValueName().

Referenced by llvm::Module::addModuleFlag(), AppendMDNodeToSourcePtr(), llvm::DIBuilder::createArrayType(), llvm::DIBuilder::createBasicType(), llvm::DIBuilder::createClassType(), llvm::DIBuilder::createCompileUnit(), llvm::DIBuilder::createComplexVariable(), llvm::DIBuilder::createEnumerationType(), llvm::DIBuilder::createEnumerator(), createFilePathPair(), llvm::DIBuilder::createForwardDecl(), llvm::DIBuilder::createFunction(), llvm::DIBuilder::createGlobalVariable(), createImportedModule(), llvm::DIBuilder::createLocalVariable(), llvm::DIBuilder::createMemberType(), llvm::DIBuilder::createMethod(), llvm::DIBuilder::createNameSpace(), llvm::DIBuilder::createObjCIVar(), llvm::DIBuilder::createObjCProperty(), llvm::DIBuilder::createPointerType(), llvm::DIBuilder::createQualifiedType(), llvm::DIBuilder::createStaticMemberType(), llvm::DIBuilder::createStaticVariable(), llvm::MDBuilder::createString(), llvm::DIBuilder::createStructType(), llvm::DIBuilder::createSubroutineType(), llvm::DIBuilder::createTemplateTemplateParameter(), llvm::DIBuilder::createTemplateTypeParameter(), llvm::DIBuilder::createTypedef(), llvm::DIBuilder::createUnionType(), llvm::DIBuilder::createUnspecifiedType(), llvm::DIBuilder::createVectorType(), LLVMMDStringInContext(), and SequenceToMDString().

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

Definition at line 42 of file Metadata.h.

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

Definition at line 48 of file Metadata.h.

References llvm::Value::getName(), and llvm::StringRef::size().

StringRef llvm::MDString::getString ( ) const
inline

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