Skip to content

Commit 8f8944e

Browse files
authored
Auto merge of rust-lang#37861 - shepmaster:llvm-4.0-inline-pass, r=alexcrichton
[LLVM 4.0] Update AlwaysInliner pass header and constructor
2 parents 224f2ce + acc9efa commit 8f8944e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/rustllvm/PassWrapper.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
#include "llvm/Target/TargetSubtargetInfo.h"
2323
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
2424

25+
#if LLVM_VERSION_GE(4, 0)
26+
#include "llvm/Transforms/IPO/AlwaysInliner.h"
27+
#endif
2528

2629
#include "llvm-c/Transforms/PassManagerBuilder.h"
2730

@@ -539,7 +542,11 @@ LLVMRustPrintPasses() {
539542

540543
extern "C" void
541544
LLVMRustAddAlwaysInlinePass(LLVMPassManagerBuilderRef PMB, bool AddLifetimes) {
545+
#if LLVM_VERSION_GE(4, 0)
546+
unwrap(PMB)->Inliner = llvm::createAlwaysInlinerLegacyPass(AddLifetimes);
547+
#else
542548
unwrap(PMB)->Inliner = createAlwaysInlinerPass(AddLifetimes);
549+
#endif
543550
}
544551

545552
extern "C" void

0 commit comments

Comments
 (0)