aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
diff options
context:
space:
mode:
authorKeith Smiley <keithbsmiley@gmail.com>2022-01-30 13:38:03 -0800
committerKeith Smiley <keithbsmiley@gmail.com>2022-02-04 10:54:27 -0800
commitdbed14d215fed740e0e26784e7b8b00b68f5e680 (patch)
tree7d01585fce71d35f109a3c3d1e67121c4dfc1a9f /llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
parente55ace6c3729822d26feeeb74f81f3bd4872eaea (diff)
downloadllvm-dbed14d215fed740e0e26784e7b8b00b68f5e680.zip
llvm-dbed14d215fed740e0e26784e7b8b00b68f5e680.tar.gz
llvm-dbed14d215fed740e0e26784e7b8b00b68f5e680.tar.bz2
[llvm-libtool-darwin] Fix crash with bitcode asm module
When using llvm-libtool-darwin with LTO building llvm itself, it crashed on a file with an asm module in the bitcode. This fixes that by correctly registering the targets for this. Differential Revision: https://reviews.llvm.org/D118575
Diffstat (limited to 'llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp')
-rw-r--r--llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
index 8b6b264..cd56e10 100644
--- a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
+++ b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
@@ -21,6 +21,7 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/LineIterator.h"
+#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/Support/WithColor.h"
#include "llvm/Support/raw_ostream.h"
@@ -682,6 +683,10 @@ int main(int Argc, char **Argv) {
if (VersionOption)
cl::PrintVersionMessage();
+ llvm::InitializeAllTargetInfos();
+ llvm::InitializeAllTargetMCs();
+ llvm::InitializeAllAsmParsers();
+
Config C = *ConfigOrErr;
switch (LibraryOperation) {
case Operation::None: