diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 10:51:19 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 10:51:19 +0000 |
commit | eb11fae6d08f479c0799db45860a98af528fa6e7 (patch) | |
tree | 44d492a50c8c1a7eb8e2d17ea3360ec4d066f042 /lib/Testing/Support | |
parent | b8a2042aa938069e862750553db0e4d82d25822c (diff) |
Notes
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)}; } |