1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[dsymutil] Fix conversion between unique_ptr and Expected

Reproducer.cpp:70:12: error: could not convert ‘Repro’ from
‘std::unique_ptr<llvm::dsymutil::ReproducerGenerate,
std::default_delete<llvm::dsymutil::ReproducerGenerate> >’ to
‘llvm::Expected<std::unique_ptr<llvm::dsymutil::Reproducer> >’
This commit is contained in:
Jonas Devlieghere 2020-05-21 11:41:20 -07:00
parent 4123cb0132
commit 435f397d00

View File

@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
#include "llvm/Support/Path.h"
#include "Reproducer.h"
#include "llvm/Support/Path.h"
using namespace llvm;
using namespace llvm::dsymutil;
@ -64,17 +64,19 @@ Reproducer::createReproducer(ReproducerMode Mode, StringRef Root) {
switch (Mode) {
case ReproducerMode::Generate: {
std::error_code EC;
auto Repro = std::make_unique<ReproducerGenerate>(EC);
std::unique_ptr<Reproducer> Repro =
std::make_unique<ReproducerGenerate>(EC);
if (EC)
return errorCodeToError(EC);
return Repro;
return std::move(Repro);
}
case ReproducerMode::Use: {
std::error_code EC;
auto Repro = std::make_unique<ReproducerUse>(Root, EC);
std::unique_ptr<Reproducer> Repro =
std::make_unique<ReproducerUse>(Root, EC);
if (EC)
return errorCodeToError(EC);
return Repro;
return std::move(Repro);
}
case ReproducerMode::Off:
return std::make_unique<Reproducer>();