Skip to content

Commit

Permalink
Revert obsolete llvm-link -preserve-modules option/test
Browse files Browse the repository at this point in the history
This testing mode is now obsolete with the change to linkInModule
to take a std::unique_ptr to Module.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258399 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
teresajohnson committed Jan 21, 2016
1 parent bf54802 commit 6cd1ab9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
5 changes: 0 additions & 5 deletions test/Linker/only-needed-named-metadata.ll
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@
; ONLYNEEDED-NOT:@analias
; ONLYNEEDED-NOT:@globalfunc2()

; Test -only-needed link with the modules preserved instead of freeing to
; catch any cross-module references to metadata, which the bitcode writer
; will assert on.
; RUN: llvm-link -preserve-modules -o %t3.bc -only-needed %S/Inputs/only-needed-named-metadata.ll %S/only-needed-named-metadata.ll

@X = global i32 5
@U = global i32 6
@U_linkonce = linkonce_odr hidden global i32 6
Expand Down
13 changes: 0 additions & 13 deletions tools/llvm-link/llvm-link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ static cl::opt<bool>
SuppressWarnings("suppress-warnings", cl::desc("Suppress all linking warnings"),
cl::init(false));

static cl::opt<bool>
PreserveModules("preserve-modules",
cl::desc("Preserve linked modules for testing"));

static cl::opt<bool> PreserveBitcodeUseListOrder(
"preserve-bc-uselistorder",
cl::desc("Preserve use-list order when writing LLVM bitcode."),
Expand Down Expand Up @@ -284,15 +280,6 @@ static bool linkFiles(const char *argv0, LLVMContext &Context, Linker &L,
return false;
// All linker flags apply to linking of subsequent files.
ApplicableFlags = Flags;

// If requested for testing, preserve modules by releasing them from
// the unique_ptr before the are freed. This can help catch any
// cross-module references from e.g. unneeded metadata references
// that aren't properly set to null but instead mapped to the source
// module version. The bitcode writer will assert if it finds any such
// cross-module references.
if (PreserveModules)
M.release();
}

return true;
Expand Down

0 comments on commit 6cd1ab9

Please sign in to comment.