diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-12 02:30:19 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-12 02:30:19 +0800 |
| commit | 0e73b1821cacb453c307cc1b9f35e989321b8e42 (patch) | |
| tree | d9c59378c840bc7b49bcc9458fb0fc3a04aa28e2 /backend/lib/CodeGen | |
| parent | 5ee4740bc864a8aaddb50e8e7a43cb5a18df0fcf (diff) | |
| download | rcc-project-0e73b1821cacb453c307cc1b9f35e989321b8e42.tar.gz rcc-project-0e73b1821cacb453c307cc1b9f35e989321b8e42.tar.xz | |
[CodeGen] Preserve variable-sized stack object offsets
Diffstat (limited to 'backend/lib/CodeGen')
| -rw-r--r-- | backend/lib/CodeGen/MachineFrameInfo.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/backend/lib/CodeGen/MachineFrameInfo.cpp b/backend/lib/CodeGen/MachineFrameInfo.cpp index 8c3e6e5..80e1ee0 100644 --- a/backend/lib/CodeGen/MachineFrameInfo.cpp +++ b/backend/lib/CodeGen/MachineFrameInfo.cpp @@ -114,9 +114,9 @@ Expected<void> MachineFrameInfo::verifyDescription(const StackObjectDesc &Descri const bool IsVariable = Description.Kind == StackObjectKind::VariableSized || Description.Kind == StackObjectKind::DynamicAlloca; if (IsVariable) { - if (Description.Size || Description.Offset) { + if (Description.Size) { return makeUnexpected(ErrorCode::InvalidArgument, - "variable-sized stack objects cannot have a fixed size or offset"); + "variable-sized stack objects cannot have a fixed size"); } } else if (!Description.Size) { return makeUnexpected(ErrorCode::InvalidArgument, @@ -254,10 +254,6 @@ Expected<void> MachineFrameInfo::setObjectOffset(FrameIndex Index, std::int64_t "live stack object unexpectedly lacks a description"); } StackObjectDesc Description = *CurrentDescription; - if ((*Object)->isVariableSized()) { - return makeUnexpected(ErrorCode::InvalidArgument, - "variable-sized stack object cannot have a fixed offset"); - } Description.Offset = Offset; (*Object)->Description.emplace<StackObjectDesc>(std::move(Description)); return {}; |
