1 //===-- Utils.cpp - TransformUtils Infrastructure -------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // This file defines the common initialization infrastructure for the
10 // TransformUtils library.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/Transforms/Utils.h"
15 #include "llvm-c/Initialization.h"
16 #include "llvm-c/Transforms/Utils.h"
17 #include "llvm/IR/LegacyPassManager.h"
18 #include "llvm/InitializePasses.h"
19 #include "llvm/PassRegistry.h"
23 /// initializeTransformUtils - Initialize all passes in the TransformUtils
25 void llvm::initializeTransformUtils(PassRegistry
&Registry
) {
26 initializeAddDiscriminatorsLegacyPassPass(Registry
);
27 initializeBreakCriticalEdgesPass(Registry
);
28 initializeCanonicalizeAliasesLegacyPassPass(Registry
);
29 initializeInstNamerPass(Registry
);
30 initializeLCSSAWrapperPassPass(Registry
);
31 initializeLibCallsShrinkWrapLegacyPassPass(Registry
);
32 initializeLoopSimplifyPass(Registry
);
33 initializeLowerInvokeLegacyPassPass(Registry
);
34 initializeLowerSwitchPass(Registry
);
35 initializeNameAnonGlobalLegacyPassPass(Registry
);
36 initializePromoteLegacyPassPass(Registry
);
37 initializeStripNonLineTableDebugInfoPass(Registry
);
38 initializeUnifyFunctionExitNodesPass(Registry
);
39 initializeMetaRenamerPass(Registry
);
40 initializeStripGCRelocatesPass(Registry
);
41 initializePredicateInfoPrinterLegacyPassPass(Registry
);
44 /// LLVMInitializeTransformUtils - C binding for initializeTransformUtilsPasses.
45 void LLVMInitializeTransformUtils(LLVMPassRegistryRef R
) {
46 initializeTransformUtils(*unwrap(R
));
49 void LLVMAddLowerSwitchPass(LLVMPassManagerRef PM
) {
50 unwrap(PM
)->add(createLowerSwitchPass());
53 void LLVMAddPromoteMemoryToRegisterPass(LLVMPassManagerRef PM
) {
54 unwrap(PM
)->add(createPromoteMemoryToRegisterPass());
57 void LLVMAddAddDiscriminatorsPass(LLVMPassManagerRef PM
) {
58 unwrap(PM
)->add(createAddDiscriminatorsPass());