diff options
author | Adrian Prantl <aprantl@apple.com> | 2017-04-28 22:25:46 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2017-04-28 22:25:46 +0000 |
commit | fed4f399d3a9b8381d9d32e7aa928855b11d7485 (patch) | |
tree | 6b842659a0d73b8c897febc016f92df12d4304b8 /llvm/unittests/IR/MetadataTest.cpp | |
parent | c20ccd2c0209fdaae7f7efe066c4b59b4ca46842 (diff) | |
download | bcm5719-llvm-fed4f399d3a9b8381d9d32e7aa928855b11d7485.tar.gz bcm5719-llvm-fed4f399d3a9b8381d9d32e7aa928855b11d7485.zip |
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
Diffstat (limited to 'llvm/unittests/IR/MetadataTest.cpp')
-rw-r--r-- | llvm/unittests/IR/MetadataTest.cpp | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/llvm/unittests/IR/MetadataTest.cpp b/llvm/unittests/IR/MetadataTest.cpp index 8dc97956d11..e61e649df19 100644 --- a/llvm/unittests/IR/MetadataTest.cpp +++ b/llvm/unittests/IR/MetadataTest.cpp @@ -1732,31 +1732,18 @@ typedef MetadataTest DINamespaceTest; 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))); |