Remove line and file from DINamespace.
Fixes the issue highlighted in
http://lists.llvm.org/pipermail/cfe-dev/2014-June/037500.html.
The DW_AT_decl_file and DW_AT_decl_line attributes on namespaces can
prevent LLVM from uniquing types that are in the same namespace. They
also don't carry any meaningful information.
rdar://problem/17484998
Differential Revision: https://reviews.llvm.org/D32648
llvm-svn: 301706
diff --git a/llvm/unittests/IR/MetadataTest.cpp b/llvm/unittests/IR/MetadataTest.cpp
index 8dc9795..e61e649 100644
--- a/llvm/unittests/IR/MetadataTest.cpp
+++ b/llvm/unittests/IR/MetadataTest.cpp
@@ -1732,31 +1732,18 @@
TEST_F(DINamespaceTest, get) {
DIScope *Scope = getFile();
- DIFile *File = getFile();
StringRef Name = "namespace";
- unsigned Line = 5;
bool ExportSymbols = true;
- auto *N = DINamespace::get(Context, Scope, File, Name, Line, ExportSymbols);
+ auto *N = DINamespace::get(Context, Scope, Name, ExportSymbols);
EXPECT_EQ(dwarf::DW_TAG_namespace, N->getTag());
EXPECT_EQ(Scope, N->getScope());
- EXPECT_EQ(File, N->getFile());
EXPECT_EQ(Name, N->getName());
- EXPECT_EQ(Line, N->getLine());
- EXPECT_EQ(N,
- DINamespace::get(Context, Scope, File, Name, Line, ExportSymbols));
-
- EXPECT_NE(N,
- DINamespace::get(Context, getFile(), File, Name, Line, ExportSymbols));
- EXPECT_NE(N,
- DINamespace::get(Context, Scope, getFile(), Name, Line, ExportSymbols));
- EXPECT_NE(N,
- DINamespace::get(Context, Scope, File, "other", Line, ExportSymbols));
- EXPECT_NE(N,
- DINamespace::get(Context, Scope, File, Name, Line + 1, ExportSymbols));
- EXPECT_NE(N,
- DINamespace::get(Context, Scope, File, Name, Line, !ExportSymbols));
+ EXPECT_EQ(N, DINamespace::get(Context, Scope, Name, ExportSymbols));
+ EXPECT_NE(N, DINamespace::get(Context, getFile(), Name, ExportSymbols));
+ EXPECT_NE(N, DINamespace::get(Context, Scope, "other", ExportSymbols));
+ EXPECT_NE(N, DINamespace::get(Context, Scope, Name, !ExportSymbols));
TempDINamespace Temp = N->clone();
EXPECT_EQ(N, MDNode::replaceWithUniqued(std::move(Temp)));