about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-10-19 05:40:50 +0200
committerGitHub <noreply@github.com>2021-10-19 05:40:50 +0200
commit54aa5477ac081e5675fdd29565ae0d27ffd13cab (patch)
treece9c28d19985c58f3ad982f76a51fd6834a7b6c4
parentec724ac0753b7538668308a6aa5b78980b2931bb (diff)
parente3c3f4a09cc700ff06acef3d84bea0368e622da4 (diff)
downloadrust-54aa5477ac081e5675fdd29565ae0d27ffd13cab.tar.gz
rust-54aa5477ac081e5675fdd29565ae0d27ffd13cab.zip
Rollup merge of #89766 - krasimirgg:llvm-14-targetregistrty, r=nagisa
RustWrapper: adapt for an LLVM API change

No functional changes intended.

The LLVM commit
https://github.com/llvm/llvm-project/commit/89b57061f7b769e9ea9bf6ed686e284f3e55affe
moved TargetRegistry.(h|cpp) from Support to MC.
This adapts RustWrapper accordingly.
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/LLVMWrapper.h1
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp5
2 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/LLVMWrapper.h b/compiler/rustc_llvm/llvm-wrapper/LLVMWrapper.h
index 0b1b68d83b7..ebe495872c4 100644
--- a/compiler/rustc_llvm/llvm-wrapper/LLVMWrapper.h
+++ b/compiler/rustc_llvm/llvm-wrapper/LLVMWrapper.h
@@ -18,7 +18,6 @@
 #include "llvm/Support/Host.h"
 #include "llvm/Support/Memory.h"
 #include "llvm/Support/SourceMgr.h"
-#include "llvm/Support/TargetRegistry.h"
 #include "llvm/Support/TargetSelect.h"
 #include "llvm/Support/Timer.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
index 87f423fb2d5..6d2e7d25336 100644
--- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
@@ -21,6 +21,11 @@
 #include "llvm/Support/CBindingWrapping.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Host.h"
+#if LLVM_VERSION_LT(14, 0)
+#include "llvm/Support/TargetRegistry.h"
+#else
+#include "llvm/MC/TargetRegistry.h"
+#endif
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Transforms/IPO/PassManagerBuilder.h"
 #include "llvm/Transforms/IPO/AlwaysInliner.h"