diff options
| -rw-r--r-- | backend/lib/MIR/MIRFrameParser.cpp | 7 | ||||
| -rw-r--r-- | backend/unittests/MIR/MIRDocumentTest.cpp | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/backend/lib/MIR/MIRFrameParser.cpp b/backend/lib/MIR/MIRFrameParser.cpp index 176bf25..4367fbd 100644 --- a/backend/lib/MIR/MIRFrameParser.cpp +++ b/backend/lib/MIR/MIRFrameParser.cpp @@ -108,9 +108,10 @@ bool MIRDocumentParser::parseStackObjects(const yaml::Node &Root, MachineFunctio Description.Offset = 0; if (const yaml::Node *NameNode = mappingValue(*Element, "name")) { std::string_view Name; - if (scalar(*NameNode, Name, "stack object name") || Name.empty()) - return fail(NameNode->range(), "stack object name cannot be empty"); - Description.AllocaName = std::string(Name); + if (scalar(*NameNode, Name, "stack object name")) + return true; + if (!Name.empty()) + Description.AllocaName = std::string(Name); } if (const yaml::Node *TypeNode = mappingValue(*Element, "type")) { std::string_view Type; diff --git a/backend/unittests/MIR/MIRDocumentTest.cpp b/backend/unittests/MIR/MIRDocumentTest.cpp index 7192398..28d5350 100644 --- a/backend/unittests/MIR/MIRDocumentTest.cpp +++ b/backend/unittests/MIR/MIRDocumentTest.cpp @@ -351,6 +351,7 @@ stack: debug-info-variable: '!0', debug-info-expression: '!DIExpression(DW_OP_LLVM_arg, 0, 18446744073709551615)', debug-info-location: '!DILocation(line: 4, column: 2, scope: !1, isImplicitCode: true)' } + - { id: 5, name: '', size: 4, alignment: 4 } entry_values: - { entry-value-register: '$g0', debug-info-variable: '!0', debug-info-expression: '!DIExpression(DW_OP_stack_value)', debug-info-location: '!2' } @@ -431,7 +432,7 @@ void testDocumentTransaction(TestContext &Context) { Function->registerInfo().liveIns().size() == 1 && Function->records().hasCalleeSavedRegisters(), "register tables must publish into the common MachineIR model"); - Context.expect(Function->frameInfo().liveObjectCount() == 2 && + Context.expect(Function->frameInfo().liveObjectCount() == 3 && Function->frameInfo().state().StackSize == 32 && Function->frameInfo().state().SavePoints.size() == 1, "frame records and stack objects must publish together"); |
