aboutsummaryrefslogtreecommitdiff
path: root/deps/lld/lib/Core/TargetOptionsCommandFlags.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-08-28 04:09:09 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-08-28 04:09:09 -0400
commitd7a539906d2dd49872abb161f3d3364c9641ccd2 (patch)
tree0d9c04fdc537326431a34ca2e7797c976fa4b91b /deps/lld/lib/Core/TargetOptionsCommandFlags.cpp
parent2a49c876be76dc98996a3251310728ad32b22363 (diff)
parent1525e2c0561bb598b1e94ad9cdced5dd22e7d66d (diff)
downloadzig-d7a539906d2dd49872abb161f3d3364c9641ccd2.tar.gz
zig-d7a539906d2dd49872abb161f3d3364c9641ccd2.zip
Merge branch 'embed-lld'
Zig now depends on LLVM 5.0.0. For the latest version that supports LLVM 4.0.1, use 2a49c876be76dc98996a3251310728ad32b22363. Unfortunately we had to embed LLD into Zig due to some MACH-O related LLD bugs. One of them is already upstream and another is awaiting feedback on the llvm-dev mailing list. You can use cmake option -DZIG_FORCE_EXTERNAL_LLD=ON to still use external LLD if you want to live with the MACH-O bugs or if your system LLD is patched. Closes #273
Diffstat (limited to 'deps/lld/lib/Core/TargetOptionsCommandFlags.cpp')
-rw-r--r--deps/lld/lib/Core/TargetOptionsCommandFlags.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/deps/lld/lib/Core/TargetOptionsCommandFlags.cpp b/deps/lld/lib/Core/TargetOptionsCommandFlags.cpp
new file mode 100644
index 0000000000..e0f26761e7
--- /dev/null
+++ b/deps/lld/lib/Core/TargetOptionsCommandFlags.cpp
@@ -0,0 +1,32 @@
+//===-- TargetOptionsCommandFlags.cpp ---------------------------*- C++ -*-===//
+//
+// The LLVM Linker
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file exists as a place for global variables defined in LLVM's
+// CodeGen/CommandFlags.h. By putting the resulting object file in
+// an archive and linking with it, the definitions will automatically be
+// included when needed and skipped when already present.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lld/Core/TargetOptionsCommandFlags.h"
+
+#include "llvm/CodeGen/CommandFlags.h"
+#include "llvm/Target/TargetOptions.h"
+
+// Define an externally visible version of
+// InitTargetOptionsFromCodeGenFlags, so that its functionality can be
+// used without having to include llvm/CodeGen/CommandFlags.h, which
+// would lead to multiple definitions of the command line flags.
+llvm::TargetOptions lld::InitTargetOptionsFromCodeGenFlags() {
+ return ::InitTargetOptionsFromCodeGenFlags();
+}
+
+llvm::CodeModel::Model lld::GetCodeModelFromCMModel() {
+ return CMModel;
+}