提交 2c3e6ac8 编写于 作者: K kennytm 提交者: GitHub

Rollup merge of #47886 - alexcrichton:llvm-7-start, r=eddyb

rustc: Add some defines for LLVM 7 compat

I was testing out the tip support to see what's going on with wasm, and this was
I believe the only issue encountered with LLVM 7 support so far.
......@@ -836,6 +836,10 @@ struct LLVMRustThinLTOData {
StringMap<FunctionImporter::ImportMapTy> ImportLists;
StringMap<FunctionImporter::ExportSetTy> ExportLists;
StringMap<GVSummaryMapTy> ModuleToDefinedGVSummaries;
#if LLVM_VERSION_GE(7, 0)
LLVMRustThinLTOData() : Index(/* isPerformingAnalysis = */ false) {}
#endif
};
// Just an argument to the `LLVMRustCreateThinLTOData` function below.
......@@ -918,7 +922,14 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
//
// This is copied from `lib/LTO/ThinLTOCodeGenerator.cpp`
#if LLVM_VERSION_GE(5, 0)
#if LLVM_VERSION_GE(7, 0)
auto deadIsPrevailing = [&](GlobalValue::GUID G) {
return PrevailingType::Unknown;
};
computeDeadSymbols(Ret->Index, Ret->GUIDPreservedSymbols, deadIsPrevailing);
#else
computeDeadSymbols(Ret->Index, Ret->GUIDPreservedSymbols);
#endif
ComputeCrossModuleImport(
Ret->Index,
Ret->ModuleToDefinedGVSummaries,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册