Abbreviate "representation" -> "repr" (#3464)

Specifically using these abbreviations:
* InitRepr: "initializing representation"
* ObjectRepr: "object representation"
* ValueRepr: "value representation"

As discussed in [#toolchain
discord](https://discord.com/channels/655572317891461132/655578254970716160/1182086098470572143)
and now documented in the [list of
abbreviations](https://docs.google.com/document/d/1RRYMm42osyqhI2LyjrjockYCutQ5dOf8Abu50kTrkX0/edit?resourcekey=0-kHyqOESbOHmzZphUbtLrTw#heading=h.pph7i5m5un7q).
This commit is contained in:
josh11b
2023-12-06 23:11:47 +00:00
committed by GitHub
parent fa07b52b8b
commit e9fc07feee
12 changed files with 187 additions and 229 deletions
+10 -11
View File
@@ -80,11 +80,11 @@ auto FunctionContext::CreateSyntheticBlock() -> llvm::BasicBlock* {
auto FunctionContext::FinishInit(SemIR::TypeId type_id, SemIR::InstId dest_id,
SemIR::InstId source_id) -> void {
switch (SemIR::GetInitializingRepresentation(sem_ir(), type_id).kind) {
case SemIR::InitializingRepresentation::None:
case SemIR::InitializingRepresentation::InPlace:
switch (SemIR::GetInitRepr(sem_ir(), type_id).kind) {
case SemIR::InitRepr::None:
case SemIR::InitRepr::InPlace:
break;
case SemIR::InitializingRepresentation::ByCopy:
case SemIR::InitRepr::ByCopy:
CopyValue(type_id, source_id, dest_id);
break;
}
@@ -92,16 +92,15 @@ auto FunctionContext::FinishInit(SemIR::TypeId type_id, SemIR::InstId dest_id,
auto FunctionContext::CopyValue(SemIR::TypeId type_id, SemIR::InstId source_id,
SemIR::InstId dest_id) -> void {
switch (auto rep = SemIR::GetValueRepresentation(sem_ir(), type_id);
rep.kind) {
case SemIR::ValueRepresentation::Unknown:
switch (auto rep = SemIR::GetValueRepr(sem_ir(), type_id); rep.kind) {
case SemIR::ValueRepr::Unknown:
CARBON_FATAL() << "Attempt to copy incomplete type";
case SemIR::ValueRepresentation::None:
case SemIR::ValueRepr::None:
break;
case SemIR::ValueRepresentation::Copy:
case SemIR::ValueRepr::Copy:
builder().CreateStore(GetValue(source_id), GetValue(dest_id));
break;
case SemIR::ValueRepresentation::Pointer: {
case SemIR::ValueRepr::Pointer: {
const auto& layout = llvm_module().getDataLayout();
auto* type = GetType(type_id);
// TODO: Compute known alignment of the source and destination, which may
@@ -114,7 +113,7 @@ auto FunctionContext::CopyValue(SemIR::TypeId type_id, SemIR::InstId source_id,
align, layout.getTypeAllocSize(type));
break;
}
case SemIR::ValueRepresentation::Custom:
case SemIR::ValueRepr::Custom:
CARBON_FATAL() << "TODO: Add support for CopyValue with custom value rep";
}
}