Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
Update clang for r282299.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282301 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
pcc committed Sep 23, 2016
1 parent 714e179 commit 0c8c36d
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions lib/CodeGen/BackendUtil.cpp
Expand Up @@ -714,20 +714,6 @@ void EmitAssemblyHelper::EmitAssembly(BackendAction Action,
}
}

namespace {
// Wrapper prodiving a stream for the ThinLTO backend.
class ThinLTOOutputWrapper : public lto::NativeObjectOutput {
std::unique_ptr<raw_pwrite_stream> OS;

public:
ThinLTOOutputWrapper(std::unique_ptr<raw_pwrite_stream> OS)
: OS(std::move(OS)) {}
std::unique_ptr<raw_pwrite_stream> getStream() override {
return std::move(OS);
}
};
}

static void runThinLTOBackend(const CodeGenOptions &CGOpts, Module *M,
std::unique_ptr<raw_pwrite_stream> OS) {
// If we are performing a ThinLTO importing compile, load the function index
Expand Down Expand Up @@ -769,12 +755,12 @@ static void runThinLTOBackend(const CodeGenOptions &CGOpts, Module *M,
ModuleMap[I.first()] = (*MBOrErr)->getMemBufferRef();
OwnedImports.push_back(std::move(*MBOrErr));
}
auto AddOutput = [&](size_t Task) {
return llvm::make_unique<ThinLTOOutputWrapper>(std::move(OS));
auto AddStream = [&](size_t Task) {
return llvm::make_unique<lto::NativeObjectStream>(std::move(OS));
};
lto::Config Conf;
if (Error E = thinBackend(
Conf, 0, AddOutput, *M, *CombinedIndex, ImportList,
Conf, 0, AddStream, *M, *CombinedIndex, ImportList,
ModuleToDefinedGVSummaries[M->getModuleIdentifier()], ModuleMap)) {
handleAllErrors(std::move(E), [&](ErrorInfoBase &EIB) {
errs() << "Error running ThinLTO backend: " << EIB.message() << '\n';
Expand Down

0 comments on commit 0c8c36d

Please sign in to comment.