xref: /freebsd/contrib/llvm-project/llvm/include/llvm/Transforms/IPO/ExpandVariadics.h (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
1 //===- ExpandVariadics.h - expand variadic functions ------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 #ifndef LLVM_TRANSFORMS_IPO_EXPANDVARIADICS_H
9 #define LLVM_TRANSFORMS_IPO_EXPANDVARIADICS_H
10 
11 #include "llvm/IR/PassManager.h"
12 
13 namespace llvm {
14 
15 class Module;
16 class ModulePass;
17 class OptimizationLevel;
18 
19 enum class ExpandVariadicsMode {
20   Unspecified, // Use the implementation defaults
21   Disable,     // Disable the pass entirely
22   Optimize,    // Optimise without changing ABI
23   Lowering,    // Change variadic calling convention
24 };
25 
26 class ExpandVariadicsPass : public PassInfoMixin<ExpandVariadicsPass> {
27   const ExpandVariadicsMode Mode;
28 
29 public:
30   // Operates under passed mode unless overridden on commandline
31   ExpandVariadicsPass(ExpandVariadicsMode Mode);
32 
33   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
34 };
35 
36 ModulePass *createExpandVariadicsPass(ExpandVariadicsMode);
37 
38 } // end namespace llvm
39 
40 #endif // LLVM_TRANSFORMS_IPO_EXPANDVARIADICS_H
41