OSDN Git Service

dsymutil: Only warn about missing clang modules once.
authorAdrian Prantl <aprantl@apple.com>
Wed, 13 Jan 2016 20:26:00 +0000 (20:26 +0000)
committerAdrian Prantl <aprantl@apple.com>
Wed, 13 Jan 2016 20:26:00 +0000 (20:26 +0000)
rdar://problem/22269336

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257664 91177308-0d34-0410-b5e6-96231b3b80d8

test/tools/dsymutil/Inputs/modules/Foo.pcm
test/tools/dsymutil/X86/modules-warnings.test [new file with mode: 0644]
tools/dsymutil/DwarfLinker.cpp

index 4a39a06..ff6b2ad 100644 (file)
Binary files a/test/tools/dsymutil/Inputs/modules/Foo.pcm and b/test/tools/dsymutil/Inputs/modules/Foo.pcm differ
diff --git a/test/tools/dsymutil/X86/modules-warnings.test b/test/tools/dsymutil/X86/modules-warnings.test
new file mode 100644 (file)
index 0000000..5452cdb
--- /dev/null
@@ -0,0 +1,12 @@
+Test for module-related warnings.
+This reuses the files from the modules.m testcase.
+
+RUN: rm -rf %t.dir && mkdir %t.dir
+RUN: cp %p/../Inputs/modules/1.o %p/../Inputs/modules/Foo.pcm %t.dir
+
+RUN: llvm-dsymutil -f -oso-prepend-path=%t.dir -y \
+RUN:   %p/dummy-debug-map.map -o %t 2>&1 | FileCheck %s
+
+Module-not-found should be reported only once.
+CHECK:     warning: {{.*}}Bar.pcm: No such file or directory
+CHECK-NOT: warning: {{.*}}Bar.pcm: No such file or directory
index 8c5f794..32ca5c4 100644 (file)
@@ -3237,10 +3237,8 @@ void DwarfLinker::loadClangModule(StringRef Filename, StringRef ModulePath,
   auto &Obj =
       ModuleMap.addDebugMapObject(Path, sys::TimeValue::PosixZeroTime());
   auto ErrOrObj = loadObject(ObjHolder, Obj, ModuleMap);
-  if (!ErrOrObj) {
-    ClangModules.erase(ClangModules.find(Filename));
+  if (!ErrOrObj)
     return;
-  }
 
   std::unique_ptr<CompileUnit> Unit;