From 2bc252acd5625cb0fb167f0d9b3fd05292f7cc47 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 30 Mar 2016 22:05:13 +0000 Subject: Cloning: Reduce complexity of debug info cloning and fix correctness issue. Commit r260791 contained an error in that it would introduce a cross-module reference in the old module. It also introduced O(N^2) complexity in the module cloner by requiring the entire module to be visited for each function. Fix both of these problems by avoiding use of the CloneDebugInfoMetadata function (which is only designed to do intra-module cloning) and cloning function-attached metadata in the same way that we clone all other metadata. Differential Revision: http://reviews.llvm.org/D18583 llvm-svn: 264935 --- llvm/lib/Transforms/Utils/CloneModule.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'llvm/lib/Transforms/Utils/CloneModule.cpp') diff --git a/llvm/lib/Transforms/Utils/CloneModule.cpp b/llvm/lib/Transforms/Utils/CloneModule.cpp index 494e275..929f51b 100644 --- a/llvm/lib/Transforms/Utils/CloneModule.cpp +++ b/llvm/lib/Transforms/Utils/CloneModule.cpp @@ -138,7 +138,6 @@ std::unique_ptr llvm::CloneModule( VMap[&*J] = &*DestI++; } - CloneDebugInfoMetadata(F, &*I, VMap); SmallVector Returns; // Ignore returns cloned. CloneFunctionInto(F, &*I, VMap, /*ModuleLevelChanges=*/true, Returns); } -- cgit v1.1