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.
This commit is contained in:
parent
70f7d5842f
commit
d492fe0a00
1 changed files with 11 additions and 0 deletions
|
@ -836,6 +836,10 @@ struct LLVMRustThinLTOData {
|
||||||
StringMap<FunctionImporter::ImportMapTy> ImportLists;
|
StringMap<FunctionImporter::ImportMapTy> ImportLists;
|
||||||
StringMap<FunctionImporter::ExportSetTy> ExportLists;
|
StringMap<FunctionImporter::ExportSetTy> ExportLists;
|
||||||
StringMap<GVSummaryMapTy> ModuleToDefinedGVSummaries;
|
StringMap<GVSummaryMapTy> ModuleToDefinedGVSummaries;
|
||||||
|
|
||||||
|
#if LLVM_VERSION_GE(7, 0)
|
||||||
|
LLVMRustThinLTOData() : Index(/* isPerformingAnalysis = */ false) {}
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
// Just an argument to the `LLVMRustCreateThinLTOData` function below.
|
// Just an argument to the `LLVMRustCreateThinLTOData` function below.
|
||||||
|
@ -918,7 +922,14 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
|
||||||
//
|
//
|
||||||
// This is copied from `lib/LTO/ThinLTOCodeGenerator.cpp`
|
// This is copied from `lib/LTO/ThinLTOCodeGenerator.cpp`
|
||||||
#if LLVM_VERSION_GE(5, 0)
|
#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);
|
computeDeadSymbols(Ret->Index, Ret->GUIDPreservedSymbols);
|
||||||
|
#endif
|
||||||
ComputeCrossModuleImport(
|
ComputeCrossModuleImport(
|
||||||
Ret->Index,
|
Ret->Index,
|
||||||
Ret->ModuleToDefinedGVSummaries,
|
Ret->ModuleToDefinedGVSummaries,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue