diff options
Diffstat (limited to 'lib/Testing/Support')
-rw-r--r-- | lib/Testing/Support/CMakeLists.txt | 5 | ||||
-rw-r--r-- | lib/Testing/Support/Error.cpp | 11 |
2 files changed, 10 insertions, 6 deletions
diff --git a/lib/Testing/Support/CMakeLists.txt b/lib/Testing/Support/CMakeLists.txt index 8ab6fd9a25af..969875e55a19 100644 --- a/lib/Testing/Support/CMakeLists.txt +++ b/lib/Testing/Support/CMakeLists.txt @@ -8,8 +8,11 @@ add_llvm_library(LLVMTestingSupport ADDITIONAL_HEADER_DIRS ${LLVM_MAIN_INCLUDE_DIR}/llvm/Testing/Support + + LINK_COMPONENTS + Support ) include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include) include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googlemock/include) -target_link_libraries(LLVMTestingSupport PRIVATE gtest)
\ No newline at end of file +target_link_libraries(LLVMTestingSupport PRIVATE gtest) diff --git a/lib/Testing/Support/Error.cpp b/lib/Testing/Support/Error.cpp index ce0da44da408..5692cdfcdf7b 100644 --- a/lib/Testing/Support/Error.cpp +++ b/lib/Testing/Support/Error.cpp @@ -14,9 +14,10 @@ using namespace llvm; llvm::detail::ErrorHolder llvm::detail::TakeError(llvm::Error Err) { - bool Succeeded = !static_cast<bool>(Err); - std::string Message; - if (!Succeeded) - Message = toString(std::move(Err)); - return {Succeeded, Message}; + std::vector<std::shared_ptr<ErrorInfoBase>> Infos; + handleAllErrors(std::move(Err), + [&Infos](std::unique_ptr<ErrorInfoBase> Info) { + Infos.emplace_back(std::move(Info)); + }); + return {std::move(Infos)}; } |