mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Use real types instead of "Self" for the IR value names of local type data.
Since that's somewhat expensive, allow the generation of meaningful IR value names to be efficiently controlled in IRGen. By default, enable meaningful value names only when generating .ll output. I considered giving protocol witness tables the name T:Protocol instead of T.Protocol, but decided that I didn't want to update that many test cases.
This commit is contained in:
@@ -2514,6 +2514,7 @@ irgen::emitFieldTypeAccessor(IRGenModule &IGM,
|
||||
|
||||
CanType formalType = type->getDeclaredTypeInContext()->getCanonicalType();
|
||||
llvm::Value *metadata = IGF.collectParameters().claimNext();
|
||||
setTypeMetadataName(IGM, metadata, formalType);
|
||||
|
||||
// Get the address at which the field type vector reference should be
|
||||
// cached.
|
||||
@@ -3719,7 +3720,7 @@ emitInvariantLoadFromMetadataAtIndex(IRGenFunction &IGF,
|
||||
llvm::Value *metadata,
|
||||
int index,
|
||||
llvm::Type *objectTy,
|
||||
const llvm::Twine &suffix = "") {
|
||||
const Twine &suffix = Twine::createNull()) {
|
||||
auto result = emitLoadFromMetadataAtIndex(IGF, metadata, index, objectTy,
|
||||
suffix);
|
||||
IGF.setInvariantLoad(result);
|
||||
@@ -4128,7 +4129,8 @@ static llvm::Value *emitLoadOfHeapMetadataRef(IRGenFunction &IGF,
|
||||
|
||||
auto metadata = IGF.Builder.CreateLoad(Address(slot,
|
||||
IGF.IGM.getPointerAlignment()));
|
||||
metadata->setName(llvm::Twine(object->getName()) + ".metadata");
|
||||
if (IGF.IGM.EnableValueNames && object->hasName())
|
||||
metadata->setName(llvm::Twine(object->getName()) + ".metadata");
|
||||
return metadata;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user