aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index b2ec18d..b76baae 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -104,8 +104,10 @@ bool CompilerInstance::createTarget() {
if (!hasTarget())
return false;
- // Create TargetInfo for the other side of CUDA/OpenMP/SYCL compilation.
- if ((getLangOpts().CUDA || getLangOpts().OpenMPIsDevice ||
+ // Check whether AuxTarget exists, if not, then create TargetInfo for the
+ // other side of CUDA/OpenMP/SYCL compilation.
+ if (!getAuxTarget() &&
+ (getLangOpts().CUDA || getLangOpts().OpenMPIsDevice ||
getLangOpts().SYCLIsDevice) &&
!getFrontendOpts().AuxTriple.empty()) {
auto TO = std::make_shared<TargetOptions>();