mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
IRGen: a small refactoring in GenConstant
Just moving a few functions around and make emitConstantValue the main entry point for creating constants. NFC
This commit is contained in:
@@ -6414,17 +6414,8 @@ void IRGenModule::emitSILStaticInitializers() {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Set the IR global's initializer to the constant for this SIL
|
||||
// struct.
|
||||
if (auto *SI = dyn_cast<StructInst>(InitValue)) {
|
||||
IRGlobal->setInitializer(emitConstantStruct(*this, SI));
|
||||
continue;
|
||||
}
|
||||
|
||||
// Set the IR global's initializer to the constant for this SIL
|
||||
// tuple.
|
||||
auto *TI = cast<TupleInst>(InitValue);
|
||||
IRGlobal->setInitializer(emitConstantTuple(*this, TI));
|
||||
IRGlobal->setInitializer(
|
||||
emitConstantValue(*this, cast<SingleValueInstruction>(InitValue)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user