Linker: Add flag to override linkage rules
Add a flag to lib/Linker (and `llvm-link`) to override linkage rules.
When set, the functions in the source module *always* replace those in
the destination module.
The `llvm-link` option is `-override=abc.ll`. All the "regular" modules
are loaded and linked first, followed by the `-override` modules. This
is useful for debugging workflows where some subset of the module (e.g.,
a single function) is extracted into a separate file where it's
optimized differently, before being merged back in.
Patch by Luqman Aden!
llvm-svn: 235473
diff --git a/llvm/test/Linker/Inputs/override-with-internal-linkage.ll b/llvm/test/Linker/Inputs/override-with-internal-linkage.ll
new file mode 100644
index 0000000..6e06fa5
--- /dev/null
+++ b/llvm/test/Linker/Inputs/override-with-internal-linkage.ll
@@ -0,0 +1,4 @@
+define i32 @foo(i32 %i) {
+entry:
+ ret i32 4
+}