llvm-wrapper: adapt for and LLVM API change
This commit is contained in:
parent
c372b14701
commit
75aec4703d
2 changed files with 26 additions and 1 deletions
|
@ -205,7 +205,12 @@ enum class LLVMRustCodeModel {
|
|||
None,
|
||||
};
|
||||
|
||||
static Optional<CodeModel::Model> fromRust(LLVMRustCodeModel Model) {
|
||||
#if LLVM_VERSION_LT(16, 0)
|
||||
static Optional<CodeModel::Model>
|
||||
#else
|
||||
static std::optional<CodeModel::Model>
|
||||
#endif
|
||||
fromRust(LLVMRustCodeModel Model) {
|
||||
switch (Model) {
|
||||
case LLVMRustCodeModel::Tiny:
|
||||
return CodeModel::Tiny;
|
||||
|
@ -638,7 +643,11 @@ LLVMRustOptimize(
|
|||
LLVMSelfProfileInitializeCallbacks(PIC,LlvmSelfProfiler,BeforePassCallback,AfterPassCallback);
|
||||
}
|
||||
|
||||
#if LLVM_VERSION_LT(16, 0)
|
||||
Optional<PGOOptions> PGOOpt;
|
||||
#else
|
||||
std::optional<PGOOptions> PGOOpt;
|
||||
#endif
|
||||
if (PGOGenPath) {
|
||||
assert(!PGOUsePath && !PGOSampleUsePath);
|
||||
PGOOpt = PGOOptions(PGOGenPath, "", "", PGOOptions::IRInstr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue