2011-02-20 07:57:14 -05:00
|
|
|
//===-- Utils.cpp - TransformUtils Infrastructure -------------------------===//
|
|
|
|
|
//
|
2019-08-20 16:50:12 -04:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2011-02-20 07:57:14 -05:00
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
//
|
|
|
|
|
// This file defines the common initialization infrastructure for the
|
|
|
|
|
// TransformUtils library.
|
|
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
2018-07-28 06:51:19 -04:00
|
|
|
#include "llvm/Transforms/Utils.h"
|
2011-02-20 07:57:14 -05:00
|
|
|
#include "llvm-c/Initialization.h"
|
2018-07-28 06:51:19 -04:00
|
|
|
#include "llvm-c/Transforms/Utils.h"
|
|
|
|
|
#include "llvm/IR/LegacyPassManager.h"
|
2017-06-10 09:44:06 -04:00
|
|
|
#include "llvm/InitializePasses.h"
|
2014-11-24 04:08:18 -05:00
|
|
|
#include "llvm/PassRegistry.h"
|
2011-02-20 07:57:14 -05:00
|
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
|
|
/// initializeTransformUtils - Initialize all passes in the TransformUtils
|
|
|
|
|
/// library.
|
|
|
|
|
void llvm::initializeTransformUtils(PassRegistry &Registry) {
|
2016-07-23 16:41:05 -04:00
|
|
|
initializeAddDiscriminatorsLegacyPassPass(Registry);
|
2020-07-26 15:36:28 -04:00
|
|
|
initializeAssumeSimplifyPassLegacyPassPass(Registry);
|
|
|
|
|
initializeAssumeBuilderPassLegacyPassPass(Registry);
|
2011-02-20 07:57:14 -05:00
|
|
|
initializeBreakCriticalEdgesPass(Registry);
|
2019-01-19 05:01:25 -05:00
|
|
|
initializeCanonicalizeAliasesLegacyPassPass(Registry);
|
2020-07-26 15:36:28 -04:00
|
|
|
initializeCanonicalizeFreezeInLoopsPass(Registry);
|
2011-02-20 07:57:14 -05:00
|
|
|
initializeInstNamerPass(Registry);
|
2016-07-23 16:41:05 -04:00
|
|
|
initializeLCSSAWrapperPassPass(Registry);
|
2017-01-02 14:17:04 -05:00
|
|
|
initializeLibCallsShrinkWrapLegacyPassPass(Registry);
|
2011-02-20 07:57:14 -05:00
|
|
|
initializeLoopSimplifyPass(Registry);
|
2017-01-02 14:17:04 -05:00
|
|
|
initializeLowerInvokeLegacyPassPass(Registry);
|
2011-02-20 07:57:14 -05:00
|
|
|
initializeLowerSwitchPass(Registry);
|
2017-01-02 14:17:04 -05:00
|
|
|
initializeNameAnonGlobalLegacyPassPass(Registry);
|
2016-07-23 16:41:05 -04:00
|
|
|
initializePromoteLegacyPassPass(Registry);
|
2017-01-02 14:17:04 -05:00
|
|
|
initializeStripNonLineTableDebugInfoPass(Registry);
|
2011-02-20 07:57:14 -05:00
|
|
|
initializeUnifyFunctionExitNodesPass(Registry);
|
2012-12-02 08:10:19 -05:00
|
|
|
initializeMetaRenamerPass(Registry);
|
2017-01-02 14:17:04 -05:00
|
|
|
initializeStripGCRelocatesPass(Registry);
|
2017-04-16 12:01:22 -04:00
|
|
|
initializePredicateInfoPrinterLegacyPassPass(Registry);
|
2020-01-17 15:45:01 -05:00
|
|
|
initializeInjectTLIMappingsLegacyPass(Registry);
|
2020-07-26 15:36:28 -04:00
|
|
|
initializeFixIrreduciblePass(Registry);
|
|
|
|
|
initializeUnifyLoopExitsPass(Registry);
|
|
|
|
|
initializeUniqueInternalLinkageNamesLegacyPassPass(Registry);
|
2011-02-20 07:57:14 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// LLVMInitializeTransformUtils - C binding for initializeTransformUtilsPasses.
|
|
|
|
|
void LLVMInitializeTransformUtils(LLVMPassRegistryRef R) {
|
|
|
|
|
initializeTransformUtils(*unwrap(R));
|
|
|
|
|
}
|
2018-07-28 06:51:19 -04:00
|
|
|
|
|
|
|
|
void LLVMAddLowerSwitchPass(LLVMPassManagerRef PM) {
|
|
|
|
|
unwrap(PM)->add(createLowerSwitchPass());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LLVMAddPromoteMemoryToRegisterPass(LLVMPassManagerRef PM) {
|
|
|
|
|
unwrap(PM)->add(createPromoteMemoryToRegisterPass());
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-20 16:50:12 -04:00
|
|
|
void LLVMAddAddDiscriminatorsPass(LLVMPassManagerRef PM) {
|
|
|
|
|
unwrap(PM)->add(createAddDiscriminatorsPass());
|
|
|
|
|
}
|