This re-applies6094b3b7db, which was reverted ine7efd37c22(and before that in1effa19de2) due to bot failures. The test failures were fixed by having SelfExecutorProcessControl use an InPlaceTaskDispatcher by default, rather than a DynamicThreadPoolTaskDispatcher. This shouldn't be necessary (and indicates a concurrency issue elsewhere), but InPlaceTaskDispatcher is a less surprising default, and better matches the existing behavior (compilation on current thread by default), so the change seems reasonable. I've filed https://github.com/llvm/llvm-project/issues/89870 to investigate the concurrency issue as a follow-up. Coding my way home: 6.25133S 127.94177W
40 lines
1.3 KiB
C++
40 lines
1.3 KiB
C++
//===--------- OrcTestCommon.cpp - Utilities for Orc Unit Tests -----------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Common utilities for Orc unit tests.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "OrcTestCommon.h"
|
|
|
|
using namespace llvm;
|
|
|
|
bool OrcNativeTarget::NativeTargetInitialized = false;
|
|
|
|
ModuleBuilder::ModuleBuilder(LLVMContext &Context, StringRef Triple,
|
|
StringRef Name)
|
|
: M(new Module(Name, Context)) {
|
|
if (Triple != "")
|
|
M->setTargetTriple(Triple);
|
|
}
|
|
|
|
void llvm::orc::CoreAPIsBasedStandardTest::OverridableDispatcher::dispatch(
|
|
std::unique_ptr<Task> T) {
|
|
if (Parent.DispatchOverride)
|
|
Parent.DispatchOverride(std::move(T));
|
|
else
|
|
InPlaceTaskDispatcher::dispatch(std::move(T));
|
|
}
|
|
|
|
std::unique_ptr<llvm::orc::ExecutorProcessControl>
|
|
llvm::orc::CoreAPIsBasedStandardTest::makeEPC(
|
|
std::shared_ptr<SymbolStringPool> SSP) {
|
|
return std::make_unique<UnsupportedExecutorProcessControl>(
|
|
std::move(SSP), std::make_unique<OverridableDispatcher>(*this));
|
|
}
|