Fix PR23045.
[oota-llvm.git] / tools / llvm-link / llvm-link.cpp
index a15855b392a45336031421ab9c2f5e6594cd450f..29c4c736b33b97b56fa92929d5664ddeec0056bf 100644 (file)
@@ -15,6 +15,7 @@
 #include "llvm/Linker/Linker.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Bitcode/ReaderWriter.h"
+#include "llvm/IR/AutoUpgrade.h"
 #include "llvm/IR/DiagnosticInfo.h"
 #include "llvm/IR/DiagnosticPrinter.h"
 #include "llvm/IR/LLVMContext.h"
@@ -69,11 +70,8 @@ loadFile(const char *argv0, const std::string &FN, LLVMContext &Context) {
   if (!Result)
     Err.print(argv0, errs());
 
-  // Fixme (pr23045). We would like to upgrade the metadata with something like
-  //  Result->materializeMetadata();
-  //  UpgradeDebugInfo(*Result);
-  // but that fails to drop old debug info from function bodies.
-  Result->materializeAllPermanently();
+  Result->materializeMetadata();
+  UpgradeDebugInfo(*Result);
 
   return Result;
 }