LLVM API Documentation

Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Friends
llvm::MDNode Class Reference

Tuple of metadata. More...

#include <Metadata.h>

Inheritance diagram for llvm::MDNode:
Inheritance graph
Collaboration diagram for llvm::MDNode:
Collaboration graph

List of all members.

Public Member Functions

void replaceOperandWith (unsigned i, Value *NewVal)
 Replace a specific operand.
ValuegetOperand (unsigned i) const LLVM_READONLY
 Return specified operand.
unsigned getNumOperands () const
 Return number of MDNode operands.
bool isFunctionLocal () const
 Return whether MDNode is local to a function.
const FunctiongetFunction () const
 Return the first function-local operand's function.
bool isTBAAVtableAccess () const
 Check whether MDNode is a vtable access.

Static Public Member Functions

static MDNodeget (LLVMContext &Context, ArrayRef< Value * > Vals)
static MDNodegetWhenValsUnresolved (LLVMContext &Context, ArrayRef< Value * > Vals, bool isFunctionLocal)
 Construct MDNode with an explicit function-localness.
static MDNodegetIfExists (LLVMContext &Context, ArrayRef< Value * > Vals)
static MDNodegetTemporary (LLVMContext &Context, ArrayRef< Value * > Vals)
 Return a temporary MDNode.
static void deleteTemporary (MDNode *N)
 Deallocate a node created by getTemporary.
static bool classof (const Value *V)
 Methods for support type inquiry through isa, cast, and dyn_cast:
static MDNodeconcatenate (MDNode *A, MDNode *B)
 Methods for metadata merging.
static MDNodeintersect (MDNode *A, MDNode *B)
static MDNodegetMostGenericTBAA (MDNode *A, MDNode *B)
static AAMDNodes getMostGenericAA (const AAMDNodes &A, const AAMDNodes &B)
static MDNodegetMostGenericFPMath (MDNode *A, MDNode *B)
static MDNodegetMostGenericRange (MDNode *A, MDNode *B)

Protected Types

enum  { FunctionLocalBit = 1 << 0, NotUniquedBit = 1 << 1 }
 Subclass data enums. More...
enum  FunctionLocalness { FL_Unknown = -1, FL_No = 0, FL_Yes = 1 }
 FunctionLocal enums. More...

Protected Member Functions

void * operator new (size_t Size, unsigned NumOps)
void operator delete (void *Mem)
 Required by std, but never called.
void operator delete (void *, unsigned)
 Required by std, but never called.
void operator delete (void *, unsigned, bool)
 Required by std, but never called.
void replaceOperand (MDNodeOperand *Op, Value *NewVal)
 Replace each instance of the given operand with a new value.
 MDNode (LLVMContext &C, unsigned ID, ArrayRef< Value * > Vals, bool isFunctionLocal)
 ~MDNode ()
bool isNotUniqued () const
void setIsNotUniqued ()
void setValueSubclassData (unsigned short D)

Static Protected Member Functions

static MDNodegetMDNode (LLVMContext &C, ArrayRef< Value * > Vals, FunctionLocalness FL, bool Insert=true)


class MDNodeOperand
class LLVMContextImpl

Detailed Description

Tuple of metadata.

Definition at line 144 of file Metadata.h.

Member Enumeration Documentation

anonymous enum [protected]

Subclass data enums.


FunctionLocalBit - This bit is set if this MDNode is function local. This is true when it (potentially transitively) contains a reference to something in a function, like an argument, basicblock, or instruction.


NotUniquedBit - This is set on MDNodes that are not uniqued because they have a null operand.

Definition at line 168 of file Metadata.h.

FunctionLocal enums.


Definition at line 180 of file Metadata.h.

Constructor & Destructor Documentation

MDNode::MDNode ( LLVMContext C,
unsigned  ID,
ArrayRef< Value * >  Vals,
bool  isFunctionLocal 
) [protected]
llvm::MDNode::~MDNode ( ) [inline, protected]

Definition at line 191 of file Metadata.h.

Member Function Documentation

static bool llvm::MDNode::classof ( const Value V) [inline, static]

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

Reimplemented from llvm::Metadata.

Reimplemented in llvm::MDNodeFwdDecl, and llvm::GenericMDNode.

Definition at line 241 of file Metadata.h.

References llvm::Value::GenericMDNodeVal, llvm::Value::getValueID(), and llvm::Value::MDNodeFwdDeclVal.

MDNode * MDNode::concatenate ( MDNode A,
MDNode B 
) [static]

Methods for metadata merging.

Definition at line 396 of file Metadata.cpp.

References llvm::ARM_PROC::A, get(), llvm::Value::getContext(), getNumOperands(), and getOperand().

Referenced by AddAliasScopeMetadata(), and CloneAliasScopeMetadata().

void MDNode::deleteTemporary ( MDNode N) [static]
MDNode * MDNode::get ( LLVMContext Context,
ArrayRef< Value * >  Vals 
) [static]

Definition at line 270 of file Metadata.cpp.

References FL_Unknown, and getMDNode().

Referenced by AddAliasScopeMetadata(), llvm::Module::addModuleFlag(), AddOperand(), llvm::DebugRecVH::allUsesReplacedWith(), llvm::cleanseInlinedVariable(), CloneAliasScopeMetadata(), CloneLoopBlocks(), concatenate(), llvm::DILocation::copyWithNewScope(), llvm::MDBuilder::createAliasScope(), llvm::MDBuilder::createAliasScopeDomain(), llvm::MDBuilder::createAnonymousAARoot(), llvm::DIBuilder::createArrayType(), llvm::DIBuilder::createBasicType(), llvm::MDBuilder::createBranchWeights(), llvm::DIBuilder::createClassType(), llvm::DIBuilder::createCompileUnit(), llvm::DIBuilder::createEnumerationType(), llvm::DIBuilder::createEnumerator(), llvm::DIBuilder::createExpression(), llvm::DIBuilder::createFile(), createFilePathPair(), llvm::DIBuilder::createForwardDecl(), llvm::MDBuilder::createFPMath(), llvm::DIBuilder::createFriend(), llvm::DIBuilder::createFunction(), llvm::DIBuilder::createGlobalVariable(), createImportedModule(), llvm::DIBuilder::createInheritance(), llvm::createInlinedVariable(), llvm::DIBuilder::createLexicalBlock(), llvm::DIBuilder::createLexicalBlockFile(), llvm::DIBuilder::createLocalVariable(), llvm::DIBuilder::createMemberPointerType(), llvm::DIBuilder::createMemberType(), llvm::DIBuilder::createMethod(), llvm::DIBuilder::createNameSpace(), llvm::DIBuilder::createObjCIVar(), llvm::DIBuilder::createObjCProperty(), llvm::DIBuilder::createPointerType(), llvm::DIBuilder::createQualifiedType(), llvm::MDBuilder::createRange(), llvm::DIBuilder::createReferenceType(), llvm::DIBuilder::createStaticMemberType(), llvm::DIBuilder::createStructType(), llvm::DIBuilder::createSubroutineType(), llvm::MDBuilder::createTBAANode(), llvm::MDBuilder::createTBAARoot(), llvm::MDBuilder::createTBAAScalarTypeNode(), llvm::MDBuilder::createTBAAStructNode(), llvm::MDBuilder::createTBAAStructTagNode(), llvm::MDBuilder::createTBAAStructTypeNode(), llvm::DIBuilder::createTemplateTypeParameter(), createTemplateValueParameterHelper(), llvm::DIBuilder::createTypedef(), createTypeWithFlags(), llvm::DIBuilder::createUnionType(), llvm::DIBuilder::createUnspecifiedType(), llvm::DIBuilder::createVectorType(), llvm::DebugRecVH::deleted(), getMostGenericRange(), getMostGenericTBAA(), llvm::DIBuilder::getOrCreateArray(), llvm::DIBuilder::getOrCreateSubrange(), llvm::DIBuilder::getOrCreateTypeArray(), llvm::DIBuilder::insertDbgValueIntrinsic(), llvm::DIBuilder::insertDeclare(), intersect(), LLVMMDNodeInContext(), llvm::MapValue(), llvm::DIDescriptor::replaceAllUsesWith(), SetLoopAlreadyUnrolled(), llvm::BranchInst::swapSuccessors(), llvm::UpgradeInstWithTBAATag(), llvm::UpgradeIntrinsicCall(), and llvm::InstCombiner::visitCallInst().

Return the first function-local operand's function.

If this metadata is function-local and recursively has a function-local operand, return the first such operand's parent function. Otherwise, return null. getFunction() should not be used for performance- critical code because it recursively visits all the MDNode's operands.

Definition at line 213 of file Metadata.cpp.

References assertLocalFunction(), F(), getFunctionForValue(), getNumOperands(), getOperand(), and isFunctionLocal().

Referenced by llvm::LexicalScopes::findInlinedScope(), llvm::LexicalScopes::findLexicalScope(), llvm::ValueEnumerator::incorporateFunction(), llvm::Value::print(), and replaceOperand().

MDNode * MDNode::getIfExists ( LLVMContext Context,
ArrayRef< Value * >  Vals 
) [static]

Definition at line 280 of file Metadata.cpp.

References FL_Unknown, and getMDNode().

Referenced by llvm::FindAllocaDbgDeclare().

MDNode * MDNode::getMDNode ( LLVMContext C,
ArrayRef< Value * >  Vals,
FunctionLocalness  FL,
bool  Insert = true 
) [static, protected]
MDNode * MDNode::getMostGenericFPMath ( MDNode A,
MDNode B 
) [static]

Definition at line 431 of file Metadata.cpp.

References llvm::APFloat::cmpLessThan, llvm::APFloat::compare(), and getOperand().

Referenced by llvm::combineMetadata().

MDNode * MDNode::getMostGenericRange ( MDNode A,
MDNode B 
) [static]
MDNode * MDNode::getMostGenericTBAA ( MDNode A,
MDNode B 
) [static]
MDNode * MDNode::getTemporary ( LLVMContext Context,
ArrayRef< Value * >  Vals 
) [static]
MDNode * MDNode::getWhenValsUnresolved ( LLVMContext Context,
ArrayRef< Value * >  Vals,
bool  isFunctionLocal 
) [static]

Construct MDNode with an explicit function-localness.

Don't analyze Vals; trust isFunctionLocal.

Definition at line 274 of file Metadata.cpp.

References FL_No, FL_Yes, and getMDNode().

MDNode * MDNode::intersect ( MDNode A,
MDNode B 
) [static]
bool llvm::MDNode::isFunctionLocal ( ) const [inline]
bool llvm::MDNode::isNotUniqued ( ) const [inline, protected]

Definition at line 258 of file Metadata.h.

References llvm::Value::getSubclassDataFromValue(), and NotUniquedBit.

Referenced by replaceOperand().

Check whether MDNode is a vtable access.

Definition at line 541 of file TypeBasedAliasAnalysis.cpp.

References getNumOperands(), getOperand(), and isStructPathTBAA().

void MDNode::operator delete ( void *  Mem) [protected]

Required by std, but never called.

Definition at line 133 of file Metadata.cpp.

References I, MDNodeOperand, N, and llvm::Value::NumOperands.

void llvm::MDNode::operator delete ( void *  ,
) [inline, protected]

Required by std, but never called.

Definition at line 158 of file Metadata.h.

References llvm_unreachable.

void llvm::MDNode::operator delete ( void *  ,
unsigned  ,
) [inline, protected]

Required by std, but never called.

Definition at line 163 of file Metadata.h.

References llvm_unreachable.

void * MDNode::operator new ( size_t  Size,
unsigned  NumOps 
) [protected]

Definition at line 121 of file Metadata.cpp.

References llvm::IndexedInstrProf::Last, and MDNodeOperand.

void MDNode::replaceOperand ( MDNodeOperand Op,
Value NewVal 
) [protected]
void MDNode::replaceOperandWith ( unsigned  i,
Value NewVal 
void MDNode::setIsNotUniqued ( ) [protected]
void llvm::MDNode::setValueSubclassData ( unsigned short  D) [inline, protected]

Reimplemented from llvm::Value.

Definition at line 265 of file Metadata.h.

Referenced by getTemporary(), MDNode(), replaceOperand(), and setIsNotUniqued().

Friends And Related Function Documentation

friend class LLVMContextImpl [friend]

Reimplemented in llvm::GenericMDNode.

Definition at line 148 of file Metadata.h.

friend class MDNodeOperand [friend]

Definition at line 147 of file Metadata.h.

Referenced by operator delete(), and operator new().

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