lib/IRGen/GenMeta.cpp
llvm::Value *
IRGenFunction::emitValueWitnessTableRef(SILType type,
                                        llvm::Value **metadataSlot) {
  // See if we have a cached projection we can use.
  if (auto cached = tryGetLocalTypeDataForLayout(type,
                                  LocalTypeDataKind::forValueWitnessTable())) {
    if (metadataSlot)
      *metadataSlot = emitTypeMetadataRefForLayout(type);
    return cached;
  }
  
  auto metadata = emitTypeMetadataRefForLayout(type);
  if (metadataSlot) *metadataSlot = metadata;
  auto vwtable = emitValueWitnessTableRefForMetadata(metadata);
  setScopedLocalTypeDataForLayout(type,
                                  LocalTypeDataKind::forValueWitnessTable(),
                                  vwtable);
  return vwtable;
}
/// Given a lowered SIL type, load a value witness table that represents its
/// layout.
Given a lowered SIL type, load a value witness table that represents its
layout.
Given a lowered SIL type load a value witness table that represents its layout .
llvm::Value *
IRGenFunction::emitValueWitnessTableRef(SILType type,
                                        llvm::Value **metadataSlot) {
  if (auto cached = tryGetLocalTypeDataForLayout(type,
                                  LocalTypeDataKind::forValueWitnessTable())) {
    if (metadataSlot)
      *metadataSlot = emitTypeMetadataRefForLayout(type);
    return cached;
  }
  auto metadata = emitTypeMetadataRefForLayout(type);
  if (metadataSlot) *metadataSlot = metadata;
  auto vwtable = emitValueWitnessTableRefForMetadata(metadata);
  setScopedLocalTypeDataForLayout(type,
                                  LocalTypeDataKind::forValueWitnessTable(),
                                  vwtable);
  return vwtable;
}
llvm :: Value * IRGenFunction :: emitValueWitnessTableRef ( SILType type , llvm :: Value * * metadataSlot ) { if ( auto cached = tryGetLocalTypeDataForLayout ( type , LocalTypeDataKind :: forValueWitnessTable ( ) ) ) { if ( metadataSlot ) * metadataSlot = emitTypeMetadataRefForLayout ( type ) ; return cached ; } auto metadata = emitTypeMetadataRefForLayout ( type ) ; if ( metadataSlot ) * metadataSlot = metadata ; auto vwtable = emitValueWitnessTableRefForMetadata ( metadata ) ; setScopedLocalTypeDataForLayout ( type , LocalTypeDataKind :: forValueWitnessTable ( ) , vwtable ) ; return vwtable ; }
Given a lowered SIL type, load a value witness table that represents its
layout.
Given a lowered SIL type load a value witness table that represents its layout .
// See if we have a cached projection we can use.