[PATCH] D31349: IR: Replace the "Linker Options" module flag with "llvm.linker.options" named metadata.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 24 13:46:27 PDT 2017


pcc added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:1304
   // Add the linker options metadata flag.
-  getModule().addModuleFlag(llvm::Module::AppendUnique, "Linker Options",
-                            llvm::MDNode::get(getLLVMContext(),
----------------
rnk wrote:
> This is a minor behavior change, right? Now we don't deduplicate linker options for "free"? We unique the flags anyway, so we get this behavior, which seems fine:
> ```
> $ cat a.ll
> !0 = !{!"asdf"}
> !my_named_md = !{!0}
> 
> $ cat b.ll
> !0 = !{!"asdf"}
> !my_named_md = !{!0}
> 
> $ llvm-link a.ll b.ll -S -o -
> ; ModuleID = 'llvm-link'
> source_filename = "llvm-link"
> !my_named_md = !{!0, !0}
> !0 = !{!"asdf"}
> ```
Correct.


https://reviews.llvm.org/D31349





More information about the llvm-commits mailing list