[clang] d54ae90 - [clang][Interp][NFC] Rename InlineDescptor::IsMutable to IsFieldMutable
Timm Bäder via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 23 01:33:11 PST 2023
Author: Timm Bäder
Date: 2023-01-23T10:32:51+01:00
New Revision: d54ae905d13ed56ab8f4ce0147eb92801684f0f3
URL: https://github.com/llvm/llvm-project/commit/d54ae905d13ed56ab8f4ce0147eb92801684f0f3
DIFF: https://github.com/llvm/llvm-project/commit/d54ae905d13ed56ab8f4ce0147eb92801684f0f3.diff
LOG: [clang][Interp][NFC] Rename InlineDescptor::IsMutable to IsFieldMutable
Added:
Modified:
clang/lib/AST/Interp/Descriptor.cpp
clang/lib/AST/Interp/Descriptor.h
clang/lib/AST/Interp/EvalEmitter.cpp
clang/lib/AST/Interp/InterpFrame.cpp
clang/lib/AST/Interp/Pointer.h
Removed:
################################################################################
diff --git a/clang/lib/AST/Interp/Descriptor.cpp b/clang/lib/AST/Interp/Descriptor.cpp
index 70294af7dea7..04bc8681dd6e 100644
--- a/clang/lib/AST/Interp/Descriptor.cpp
+++ b/clang/lib/AST/Interp/Descriptor.cpp
@@ -78,9 +78,10 @@ static void ctorArrayDesc(Block *B, char *Ptr, bool IsConst, bool IsMutable,
Desc->IsBase = false;
Desc->IsActive = IsActive;
Desc->IsConst = IsConst || D->IsConst;
- Desc->IsMutable = IsMutable || D->IsMutable;
+ Desc->IsFieldMutable = IsMutable || D->IsMutable;
if (auto Fn = D->ElemDesc->CtorFn)
- Fn(B, ElemLoc, Desc->IsConst, Desc->IsMutable, IsActive, D->ElemDesc);
+ Fn(B, ElemLoc, Desc->IsConst, Desc->IsFieldMutable, IsActive,
+ D->ElemDesc);
}
}
@@ -131,9 +132,10 @@ static void ctorRecord(Block *B, char *Ptr, bool IsConst, bool IsMutable,
Desc->IsBase = IsBase;
Desc->IsActive = IsActive && !IsUnion;
Desc->IsConst = IsConst || F->IsConst;
- Desc->IsMutable = IsMutable || F->IsMutable;
+ Desc->IsFieldMutable = IsMutable || F->IsMutable;
if (auto Fn = F->CtorFn)
- Fn(B, Ptr + SubOff, Desc->IsConst, Desc->IsMutable, Desc->IsActive, F);
+ Fn(B, Ptr + SubOff, Desc->IsConst, Desc->IsFieldMutable, Desc->IsActive,
+ F);
};
for (const auto &B : D->ElemRecord->bases())
CtorSub(B.Offset, B.Desc, /*isBase=*/true);
diff --git a/clang/lib/AST/Interp/Descriptor.h b/clang/lib/AST/Interp/Descriptor.h
index 730d66b0cb64..6ef4fc2f4c9b 100644
--- a/clang/lib/AST/Interp/Descriptor.h
+++ b/clang/lib/AST/Interp/Descriptor.h
@@ -70,7 +70,7 @@ struct InlineDescriptor {
/// Flag indicating if the field is the active member of a union.
unsigned IsActive : 1;
/// Flag indicating if the field is mutable (if in a record).
- unsigned IsMutable : 1; // TODO: Rename to IsFieldMutable.
+ unsigned IsFieldMutable : 1;
Descriptor *Desc;
};
diff --git a/clang/lib/AST/Interp/EvalEmitter.cpp b/clang/lib/AST/Interp/EvalEmitter.cpp
index 3c1d48f09f9b..72fd3b45254b 100644
--- a/clang/lib/AST/Interp/EvalEmitter.cpp
+++ b/clang/lib/AST/Interp/EvalEmitter.cpp
@@ -61,7 +61,7 @@ Scope::Local EvalEmitter::createLocal(Descriptor *D) {
Desc.Offset = sizeof(InlineDescriptor);
Desc.IsActive = true;
Desc.IsBase = false;
- Desc.IsMutable = false;
+ Desc.IsFieldMutable = false;
Desc.IsConst = false;
Desc.IsInitialized = false;
diff --git a/clang/lib/AST/Interp/InterpFrame.cpp b/clang/lib/AST/Interp/InterpFrame.cpp
index 30068e12aa9d..40644c538c6a 100644
--- a/clang/lib/AST/Interp/InterpFrame.cpp
+++ b/clang/lib/AST/Interp/InterpFrame.cpp
@@ -42,7 +42,7 @@ InterpFrame::InterpFrame(InterpState &S, const Function *Func,
ID->IsActive = true;
ID->Offset = sizeof(InlineDescriptor);
ID->IsBase = false;
- ID->IsMutable = false;
+ ID->IsFieldMutable = false;
ID->IsConst = false;
ID->IsInitialized = false;
}
diff --git a/clang/lib/AST/Interp/Pointer.h b/clang/lib/AST/Interp/Pointer.h
index ce113a54e122..1462d01c2412 100644
--- a/clang/lib/AST/Interp/Pointer.h
+++ b/clang/lib/AST/Interp/Pointer.h
@@ -260,7 +260,9 @@ class Pointer {
bool isStaticTemporary() const { return isStatic() && isTemporary(); }
/// Checks if the field is mutable.
- bool isMutable() const { return Base != 0 && getInlineDesc()->IsMutable; }
+ bool isMutable() const {
+ return Base != 0 && getInlineDesc()->IsFieldMutable;
+ }
/// Checks if an object was initialized.
bool isInitialized() const;
/// Checks if the object is active.
More information about the cfe-commits
mailing list