LLVM  8.0.1
AlwaysInliner.h
Go to the documentation of this file.
1 //===-- AlwaysInliner.h - Pass to inline "always_inline" functions --------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// \file
11 /// Provides passes to inlining "always_inline" functions.
12 ///
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_TRANSFORMS_IPO_ALWAYSINLINER_H
16 #define LLVM_TRANSFORMS_IPO_ALWAYSINLINER_H
17 
18 #include "llvm/IR/PassManager.h"
19 
20 namespace llvm {
21 
22 /// Inlines functions marked as "always_inline".
23 ///
24 /// Note that this does not inline call sites marked as always_inline and does
25 /// not delete the functions even when all users are inlined. The normal
26 /// inliner should be used to handle call site inlining, this pass's goal is to
27 /// be the simplest possible pass to remove always_inline function definitions'
28 /// uses by inlining them. The \c GlobalDCE pass can be used to remove these
29 /// functions once all users are gone.
30 class AlwaysInlinerPass : public PassInfoMixin<AlwaysInlinerPass> {
31  bool InsertLifetime;
32 
33 public:
34  AlwaysInlinerPass(bool InsertLifetime = true)
35  : InsertLifetime(InsertLifetime) {}
36 
38 };
39 
40 /// Create a legacy pass manager instance of a pass to inline and remove
41 /// functions marked as "always_inline".
42 Pass *createAlwaysInlinerLegacyPass(bool InsertLifetime = true);
43 
44 }
45 
46 #endif // LLVM_TRANSFORMS_IPO_ALWAYSINLINER_H
Pass interface - Implemented by all &#39;passes&#39;.
Definition: Pass.h:81
This class represents lattice values for constants.
Definition: AllocatorList.h:24
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:65
AlwaysInlinerPass(bool InsertLifetime=true)
Definition: AlwaysInliner.h:34
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:366
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:154
Pass * createAlwaysInlinerLegacyPass(bool InsertLifetime=true)
Create a legacy pass manager instance of a pass to inline and remove functions marked as "always_inli...
PreservedAnalyses run(Module &M, ModuleAnalysisManager &)
Inlines functions marked as "always_inline".
Definition: AlwaysInliner.h:30
A container for analyses that lazily runs them and caches their results.
This header defines various interfaces for pass management in LLVM.