Skip to content

Commit 6f6846f

Browse files
committed
AlwaysInliner: Alow setting InsertLifetime in the new-style pass
llvm-svn: 322033
1 parent 8b1378a commit 6f6846f

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

llvm/include/llvm/Transforms/IPO/AlwaysInliner.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ namespace llvm {
2727
/// be the simplest possible pass to remove always_inline function definitions'
2828
/// uses by inlining them. The \c GlobalDCE pass can be used to remove these
2929
/// functions once all users are gone.
30-
struct AlwaysInlinerPass : PassInfoMixin<AlwaysInlinerPass> {
30+
class AlwaysInlinerPass : public PassInfoMixin<AlwaysInlinerPass> {
31+
bool InsertLifetime;
32+
33+
public:
34+
AlwaysInlinerPass(bool InsertLifetime = true)
35+
: InsertLifetime(InsertLifetime) {}
36+
3137
PreservedAnalyses run(Module &M, ModuleAnalysisManager &);
3238
};
3339

llvm/lib/Transforms/IPO/AlwaysInliner.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ PreservedAnalyses AlwaysInlinerPass::run(Module &M, ModuleAnalysisManager &) {
5050
for (CallSite CS : Calls)
5151
// FIXME: We really shouldn't be able to fail to inline at this point!
5252
// We should do something to log or check the inline failures here.
53-
Changed |= InlineFunction(CS, IFI);
53+
Changed |=
54+
InlineFunction(CS, IFI, /*CalleeAAR=*/nullptr, InsertLifetime);
5455

5556
// Remember to try and delete this function afterward. This both avoids
5657
// re-walking the rest of the module and avoids dealing with any iterator

0 commit comments

Comments
 (0)