diff options
| author | Bob Haarman <llvm@inglorion.net> | 2017-02-02 23:49:16 +0000 |
|---|---|---|
| committer | Bob Haarman <llvm@inglorion.net> | 2017-02-02 23:49:16 +0000 |
| commit | 35989d6be572d297683f790315b1bf35a4a926b6 (patch) | |
| tree | 8ae5517a772c039bec390ff37377fa63fbade02c | |
| parent | 803b141f32fc8b09c259c97d31e77e5f5efc58af (diff) | |
| download | bcm5719-llvm-35989d6be572d297683f790315b1bf35a4a926b6.tar.gz bcm5719-llvm-35989d6be572d297683f790315b1bf35a4a926b6.zip | |
add the ability to call InitTargetOptionsFromCodeGenFlags from multiple objects
Summary: llvm/CodeGen/CommandFlags.h a utility function InitTargetOptionsFromCodeGenFlags which is used to set target options from flags based on the command line. The command line flags are stored in globals defined in the same file, and including the file in multiple places causes the globals to be defined multiple times, leading to linker errors. This change adds a single place in lld where these globals are defined and exports only the utility function. This makes it possible to call InitTargetOptionsFromCodeGenFlags from multiple places in lld, which a follow-up change will do.
Reviewers: davide, ruiu
Reviewed By: davide, ruiu
Subscribers: mgorny
Differential Revision: https://reviews.llvm.org/D29058
llvm-svn: 293965
| -rw-r--r-- | lld/ELF/LTO.cpp | 2 | ||||
| -rw-r--r-- | lld/lib/Core/CMakeLists.txt | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp index 7aaddcfb674..fb133817ea4 100644 --- a/lld/ELF/LTO.cpp +++ b/lld/ELF/LTO.cpp @@ -12,11 +12,11 @@ #include "Error.h" #include "InputFiles.h" #include "Symbols.h" +#include "lld/Core/TargetOptionsCommandFlags.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Twine.h" -#include "llvm/CodeGen/CommandFlags.h" #include "llvm/IR/DiagnosticPrinter.h" #include "llvm/LTO/Config.h" #include "llvm/LTO/LTO.h" diff --git a/lld/lib/Core/CMakeLists.txt b/lld/lib/Core/CMakeLists.txt index 7f4c47f14b9..2c2d74ba16c 100644 --- a/lld/lib/Core/CMakeLists.txt +++ b/lld/lib/Core/CMakeLists.txt @@ -7,6 +7,7 @@ add_lld_library(lldCore Reproduce.cpp Resolver.cpp SymbolTable.cpp + TargetOptionsCommandFlags.cpp Writer.cpp ADDITIONAL_HEADER_DIRS |

