Revert "Add 'thinlto_src_module' md with asserts or -enable-import-metadata"
authorPiotr Padlewski <piotr.padlewski@gmail.com>
Fri, 8 Jul 2016 22:55:48 +0000 (22:55 +0000)
committerPiotr Padlewski <piotr.padlewski@gmail.com>
Fri, 8 Jul 2016 22:55:48 +0000 (22:55 +0000)
Reverting because of 17463
http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules/builds/17463

This reverts commit d20cb431bba2ba43b4c65a8556cff445bfefbb7c.

llvm-svn: 274946

llvm/lib/Transforms/IPO/FunctionImport.cpp
llvm/test/Transforms/FunctionImport/funcimport.ll

index c9d075e..f15d8cf 100644 (file)
@@ -58,16 +58,6 @@ static cl::opt<bool>
     DontForceImportReferencedDiscardableSymbols("disable-force-link-odr",
                                                 cl::init(false), cl::Hidden);
 
-static cl::opt<bool> EnableImportMetadata(
-    "enable-import-metadata", cl::init(
-#if !defined(NDEBUG)
-                                  true /*Enabled with asserts.*/
-#else
-                                  false
-#endif
-                                  ),
-    cl::Hidden, cl::desc("Enable import metadata like 'thinlto_src_module'"));
-
 // Load lazily a module from \p FileName in \p Context.
 static std::unique_ptr<Module> loadFile(const std::string &FileName,
                                         LLVMContext &Context) {
@@ -601,15 +591,12 @@ bool FunctionImporter::importFunctions(
                    << SrcModule->getSourceFileName() << "\n");
       if (Import) {
         F.materialize();
-        if (EnableImportMetadata) {
-          // Add 'thinlto_src_module' metadata for statistics and debugging.
-          F.setMetadata(
-              "thinlto_src_module",
-              llvm::MDNode::get(
-                  DestModule.getContext(),
-                  {llvm::MDString::get(DestModule.getContext(),
-                                       SrcModule->getSourceFileName())}));
-        }
+        // Add 'thinlto_src_module' metadata for statistics and debugging.
+        F.setMetadata("thinlto_src_module",
+                      llvm::MDNode::get(DestModule.getContext(),
+                                        {llvm::MDString::get(
+                                            DestModule.getContext(),
+                                            SrcModule->getSourceFileName())}));
         GlobalsToImport.insert(&F);
       }
     }
index 61d4dfa..b61f8d5 100644 (file)
@@ -4,12 +4,12 @@
 ; RUN: llvm-lto -thinlto -print-summary-global-ids -o %t3 %t.bc %t2.bc 2>&1 | FileCheck %s --check-prefix=GUID
 
 ; Do the import now
-; RUN: opt -disable-force-link-odr -function-import -stats -print-imports -enable-import-metadata -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=INSTLIMDEF
+; RUN: opt -disable-force-link-odr -function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=INSTLIMDEF
 ; "-stats" requires +Asserts.
-; REQUIRES asserts
+; REQUIRES: asserts
 
 ; Test import with smaller instruction limit
-; RUN: opt -disable-force-link-odr -function-import -enable-import-metadata  -summary-file %t3.thinlto.bc %t.bc -import-instr-limit=5 -S | FileCheck %s --check-prefix=CHECK --check-prefix=INSTLIM5
+; RUN: opt -disable-force-link-odr -function-import -summary-file %t3.thinlto.bc %t.bc -import-instr-limit=5 -S | FileCheck %s --check-prefix=CHECK --check-prefix=INSTLIM5
 ; INSTLIM5-NOT: @staticfunc.llvm.
 
 ; Test import with smaller instruction limit and without the -disable-force-link-odr