From f17f214145c8e3b7d57cc3e11e836b4b1bf5ccbb Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Thu, 20 Feb 2014 22:19:24 +0000 Subject: Set the SuppressWarnings option on tool level and propagate to the library. The SuppressWarnings flag, unfortunately, isn't very useful for custom tools that want to use the LLVM module linker. So I'm changing it to a parameter of the Linker, and the flag itself moves to the llvm-link tool. For the time being as SuppressWarnings is pretty much the only "option" it seems reasonable to propagate it to Linker objects. If we end up with more options in the future, some sort of "struct collecting options" may be a better idea. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201819 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-link/llvm-link.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tools/llvm-link') diff --git a/tools/llvm-link/llvm-link.cpp b/tools/llvm-link/llvm-link.cpp index 2b5dce461c..11870fa768 100644 --- a/tools/llvm-link/llvm-link.cpp +++ b/tools/llvm-link/llvm-link.cpp @@ -50,6 +50,10 @@ Verbose("v", cl::desc("Print information about actions taken")); static cl::opt DumpAsm("d", cl::desc("Print assembly as linked"), cl::Hidden); +static cl::opt +SuppressWarnings("suppress-warnings", cl::desc("Suppress all linking warnings"), + cl::init(false)); + // LoadFile - Read the specified bitcode file in and return it. This routine // searches the link path for the specified file to try to find it... // @@ -86,7 +90,7 @@ int main(int argc, char **argv) { return 1; } - Linker L(Composite.get()); + Linker L(Composite.get(), SuppressWarnings); for (unsigned i = BaseArg+1; i < InputFilenames.size(); ++i) { OwningPtr M(LoadFile(argv[0], InputFilenames[i], Context)); if (M.get() == 0) { -- cgit v1.2.3