summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/IR
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-19 00:37:21 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-19 00:37:21 +0000
commit3d62bbacb1aa918944f0cc966381f44e13582b4a (patch)
tree11ef811398091ec13469ff532758c8d0ba7d2008 /llvm/unittests/IR
parentca929f24699a05cf22d4337278e5fea962799632 (diff)
downloadbcm5719-llvm-3d62bbacb1aa918944f0cc966381f44e13582b4a.tar.gz
bcm5719-llvm-3d62bbacb1aa918944f0cc966381f44e13582b4a.zip
IR: Drop scope from MDTemplateParameter
Follow-up to r229740, which removed `DITemplate*::getContext()` after my upgrade script revealed that scopes are always `nullptr` for template parameters. This is the other shoe: drop `scope:` from `MDTemplateParameter` and its two subclasses. (Note: a bitcode upgrade would be pointless, since the hierarchy hasn't been moved into place.) llvm-svn: 229791
Diffstat (limited to 'llvm/unittests/IR')
-rw-r--r--llvm/unittests/IR/MetadataTest.cpp34
1 files changed, 13 insertions, 21 deletions
diff --git a/llvm/unittests/IR/MetadataTest.cpp b/llvm/unittests/IR/MetadataTest.cpp
index b6ee46a5d7b..ea49880e918 100644
--- a/llvm/unittests/IR/MetadataTest.cpp
+++ b/llvm/unittests/IR/MetadataTest.cpp
@@ -1386,21 +1386,19 @@ TEST_F(MDNamespaceTest, get) {
typedef MetadataTest MDTemplateTypeParameterTest;
TEST_F(MDTemplateTypeParameterTest, get) {
- Metadata *Scope = MDTuple::getDistinct(Context, None);
StringRef Name = "template";
Metadata *Type = MDTuple::getDistinct(Context, None);
+ Metadata *Other = MDTuple::getDistinct(Context, None);
- auto *N = MDTemplateTypeParameter::get(Context, Scope, Name, Type);
+ auto *N = MDTemplateTypeParameter::get(Context, Name, Type);
EXPECT_EQ(dwarf::DW_TAG_template_type_parameter, N->getTag());
- EXPECT_EQ(Scope, N->getScope());
EXPECT_EQ(Name, N->getName());
EXPECT_EQ(Type, N->getType());
- EXPECT_EQ(N, MDTemplateTypeParameter::get(Context, Scope, Name, Type));
+ EXPECT_EQ(N, MDTemplateTypeParameter::get(Context, Name, Type));
- EXPECT_NE(N, MDTemplateTypeParameter::get(Context, Type, Name, Type));
- EXPECT_NE(N, MDTemplateTypeParameter::get(Context, Scope, "other", Type));
- EXPECT_NE(N, MDTemplateTypeParameter::get(Context, Scope, Name, Scope));
+ EXPECT_NE(N, MDTemplateTypeParameter::get(Context, "other", Type));
+ EXPECT_NE(N, MDTemplateTypeParameter::get(Context, Name, Other));
TempMDTemplateTypeParameter Temp = N->clone();
EXPECT_EQ(N, MDNode::replaceWithUniqued(std::move(Temp)));
@@ -1410,32 +1408,26 @@ typedef MetadataTest MDTemplateValueParameterTest;
TEST_F(MDTemplateValueParameterTest, get) {
unsigned Tag = dwarf::DW_TAG_template_value_parameter;
- Metadata *Scope = MDTuple::getDistinct(Context, None);
StringRef Name = "template";
Metadata *Type = MDTuple::getDistinct(Context, None);
Metadata *Value = MDTuple::getDistinct(Context, None);
+ Metadata *Other = MDTuple::getDistinct(Context, None);
- auto *N =
- MDTemplateValueParameter::get(Context, Tag, Scope, Name, Type, Value);
+ auto *N = MDTemplateValueParameter::get(Context, Tag, Name, Type, Value);
EXPECT_EQ(Tag, N->getTag());
- EXPECT_EQ(Scope, N->getScope());
EXPECT_EQ(Name, N->getName());
EXPECT_EQ(Type, N->getType());
EXPECT_EQ(Value, N->getValue());
- EXPECT_EQ(
- N, MDTemplateValueParameter::get(Context, Tag, Scope, Name, Type, Value));
+ EXPECT_EQ(N, MDTemplateValueParameter::get(Context, Tag, Name, Type, Value));
EXPECT_NE(N, MDTemplateValueParameter::get(
- Context, dwarf::DW_TAG_GNU_template_template_param, Scope,
- Name, Type, Value));
- EXPECT_NE(
- N, MDTemplateValueParameter::get(Context, Tag, Type, Name, Type, Value));
- EXPECT_NE(N, MDTemplateValueParameter::get(Context, Tag, Scope, "other", Type,
+ Context, dwarf::DW_TAG_GNU_template_template_param, Name,
+ Type, Value));
+ EXPECT_NE(N, MDTemplateValueParameter::get(Context, Tag, "other", Type,
Value));
- EXPECT_NE(N, MDTemplateValueParameter::get(Context, Tag, Scope, Name, Scope,
+ EXPECT_NE(N, MDTemplateValueParameter::get(Context, Tag, Name, Other,
Value));
- EXPECT_NE(
- N, MDTemplateValueParameter::get(Context, Tag, Scope, Name, Type, Scope));
+ EXPECT_NE(N, MDTemplateValueParameter::get(Context, Tag, Name, Type, Other));
TempMDTemplateValueParameter Temp = N->clone();
EXPECT_EQ(N, MDNode::replaceWithUniqued(std::move(Temp)));
OpenPOWER on IntegriCloud