mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
IR: Add missing null operand to MDSubroutineType
Add missing `nullptr` from `MDSubroutineType`'s operands for `MDCompositeTypeBase::getIdentifier()` (and add tests for all the other unused fields). This highlights just how crazy it is that `MDSubroutineType` inherits from `MDCompositeTypeBase`. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229926 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
953c5c9458
commit
aeb422f527
@ -200,7 +200,7 @@ MDSubroutineType *MDSubroutineType::getImpl(LLVMContext &Context,
|
||||
bool ShouldCreate) {
|
||||
DEFINE_GETIMPL_LOOKUP(MDSubroutineType, (Flags, TypeArray));
|
||||
Metadata *Ops[] = {nullptr, nullptr, nullptr, nullptr,
|
||||
TypeArray, nullptr, nullptr};
|
||||
TypeArray, nullptr, nullptr, nullptr};
|
||||
DEFINE_GETIMPL_STORE(MDSubroutineType, (Flags), Ops);
|
||||
}
|
||||
|
||||
|
@ -964,6 +964,15 @@ TEST_F(MDSubroutineTypeTest, get) {
|
||||
|
||||
TempMDSubroutineType Temp = N->clone();
|
||||
EXPECT_EQ(N, MDNode::replaceWithUniqued(std::move(Temp)));
|
||||
|
||||
// Test always-empty operands.
|
||||
EXPECT_EQ(nullptr, N->getScope());
|
||||
EXPECT_EQ(nullptr, N->getFile());
|
||||
EXPECT_EQ("", N->getName());
|
||||
EXPECT_EQ(nullptr, N->getBaseType());
|
||||
EXPECT_EQ(nullptr, N->getVTableHolder());
|
||||
EXPECT_EQ(nullptr, N->getTemplateParams());
|
||||
EXPECT_EQ("", N->getIdentifier());
|
||||
}
|
||||
|
||||
typedef MetadataTest MDFileTest;
|
||||
|
Loading…
Reference in New Issue
Block a user