mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +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:
@@ -131,6 +131,15 @@ IRGenModule::IRGenModule(IRGenModuleDispatcher &dispatcher, SourceFile *SF,
|
||||
Types(*new TypeConverter(*this))
|
||||
{
|
||||
dispatcher.addGenModule(SF, this);
|
||||
|
||||
// If the command line contains an explicit request about whether to add
|
||||
// LLVM value names, honor it. Otherwise, add value names only if the
|
||||
// final result is textual LLVM assembly.
|
||||
if (Opts.HasValueNamesSetting) {
|
||||
EnableValueNames = Opts.ValueNames;
|
||||
} else {
|
||||
EnableValueNames = (Opts.OutputKind == IRGenOutputKind::LLVMAssembly);
|
||||
}
|
||||
|
||||
VoidTy = llvm::Type::getVoidTy(getLLVMContext());
|
||||
Int1Ty = llvm::Type::getInt1Ty(getLLVMContext());
|
||||
|
||||
Reference in New Issue
Block a user