Util/slottracker.cpp
/// CreateModuleSlot - Insert the specified MDNode* into the slot table.
Insert the specified MDNode* into the slot table.
Insert the specified MDNode * into the slot table .
void SlotTracker::CreateMetadataSlot(const MDNode *N) {
    assert(N && "Can't insert a null Value into SlotTracker!");
    if (!N->isFunctionLocal()) {
        mdn_iterator I = mdnMap.find(N);
        if (I != mdnMap.end())
            return;
        unsigned DestSlot = mdnNext++;
        mdnMap[N] = DestSlot;
    }
    for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i)
        if (const MDNode *Op = dyn_cast_or_null<MDNode>(N->getOperand(i)))
            CreateMetadataSlot(Op);
}
void SlotTracker :: CreateMetadataSlot ( const MDNode * N ) { assert ( N && " " ) ; if ( ! N -> isFunctionLocal ( ) ) { mdn_iterator I = mdnMap . find ( N ) ; if ( I != mdnMap . end ( ) ) return ; unsigned DestSlot = mdnNext ++ ; mdnMap [ N ] = DestSlot ; } for ( unsigned i = 0 , e = N -> getNumOperands ( ) ; i != e ; ++ i ) if ( const MDNode * Op = dyn_cast_or_null < MDNode > ( N -> getOperand ( i ) ) ) CreateMetadataSlot ( Op ) ; }
CreateModuleSlot - Insert the specified MDNode* into the slot table.
CreateModuleSlot - Insert the specified MDNode * into the slot table .
// Don't insert if N is a function-local metadata, these are always printed // inline. // Recursively add any MDNodes referenced by operands.