2010-10-07 17:55:47 +00:00
|
|
|
//===-- Utils.cpp - TransformUtils Infrastructure -------------------------===//
|
|
|
|
|
//
|
2019-01-19 08:50:56 +00: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
|
2010-10-07 17:55:47 +00:00
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
//
|
|
|
|
|
// This file defines the common initialization infrastructure for the
|
|
|
|
|
// TransformUtils library.
|
|
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
2018-03-28 17:44:36 +00:00
|
|
|
#include "llvm/Transforms/Utils.h"
|
2010-10-07 17:55:47 +00:00
|
|
|
#include "llvm-c/Initialization.h"
|
2018-03-29 22:31:38 +00:00
|
|
|
#include "llvm-c/Transforms/Utils.h"
|
2018-03-28 17:44:36 +00:00
|
|
|
#include "llvm/IR/LegacyPassManager.h"
|
2017-06-06 11:49:48 +00:00
|
|
|
#include "llvm/InitializePasses.h"
|
2014-01-07 11:48:04 +00:00
|
|
|
#include "llvm/PassRegistry.h"
|
2010-10-07 17:55:47 +00:00
|
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
|
|
/// initializeTransformUtils - Initialize all passes in the TransformUtils
|
|
|
|
|
/// library.
|
|
|
|
|
void llvm::initializeTransformUtils(PassRegistry &Registry) {
|
2016-06-15 21:51:30 +00:00
|
|
|
initializeAddDiscriminatorsLegacyPassPass(Registry);
|
2020-05-07 12:41:20 +01:00
|
|
|
initializeAssumeSimplifyPassLegacyPassPass(Registry);
|
2020-07-04 20:04:28 +03:00
|
|
|
initializeAssumeBuilderPassLegacyPassPass(Registry);
|
2010-10-07 17:55:47 +00:00
|
|
|
initializeBreakCriticalEdgesPass(Registry);
|
2019-01-04 19:04:54 +00:00
|
|
|
initializeCanonicalizeAliasesLegacyPassPass(Registry);
|
2020-05-08 05:28:42 +09:00
|
|
|
initializeCanonicalizeFreezeInLoopsPass(Registry);
|
2010-10-07 17:55:47 +00:00
|
|
|
initializeInstNamerPass(Registry);
|
2016-06-09 19:44:46 +00:00
|
|
|
initializeLCSSAWrapperPassPass(Registry);
|
2016-10-18 21:36:27 +00:00
|
|
|
initializeLibCallsShrinkWrapLegacyPassPass(Registry);
|
2010-10-07 17:55:47 +00:00
|
|
|
initializeLoopSimplifyPass(Registry);
|
2016-08-12 17:28:27 +00:00
|
|
|
initializeLowerInvokeLegacyPassPass(Registry);
|
2010-10-07 17:55:47 +00:00
|
|
|
initializeLowerSwitchPass(Registry);
|
2016-09-16 16:56:30 +00:00
|
|
|
initializeNameAnonGlobalLegacyPassPass(Registry);
|
2016-06-14 03:22:22 +00:00
|
|
|
initializePromoteLegacyPassPass(Registry);
|
2016-10-25 18:44:13 +00:00
|
|
|
initializeStripNonLineTableDebugInfoPass(Registry);
|
2010-10-07 17:55:47 +00:00
|
|
|
initializeUnifyFunctionExitNodesPass(Registry);
|
2018-03-28 17:44:36 +00:00
|
|
|
initializeMetaRenamerPass(Registry);
|
2016-10-21 18:43:16 +00:00
|
|
|
initializeStripGCRelocatesPass(Registry);
|
2017-02-07 21:10:46 +00:00
|
|
|
initializePredicateInfoPrinterLegacyPassPass(Registry);
|
2019-11-11 19:42:18 +00:00
|
|
|
initializeInjectTLIMappingsLegacyPass(Registry);
|
2020-04-15 15:05:51 +05:30
|
|
|
initializeFixIrreduciblePass(Registry);
|
2020-03-28 07:13:35 -04:00
|
|
|
initializeUnifyLoopExitsPass(Registry);
|
2020-04-20 14:41:30 -07:00
|
|
|
initializeUniqueInternalLinkageNamesLegacyPassPass(Registry);
|
2010-10-07 17:55:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// LLVMInitializeTransformUtils - C binding for initializeTransformUtilsPasses.
|
|
|
|
|
void LLVMInitializeTransformUtils(LLVMPassRegistryRef R) {
|
|
|
|
|
initializeTransformUtils(*unwrap(R));
|
|
|
|
|
}
|
2018-03-28 17:44:36 +00:00
|
|
|
|
|
|
|
|
void LLVMAddLowerSwitchPass(LLVMPassManagerRef PM) {
|
|
|
|
|
unwrap(PM)->add(createLowerSwitchPass());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LLVMAddPromoteMemoryToRegisterPass(LLVMPassManagerRef PM) {
|
|
|
|
|
unwrap(PM)->add(createPromoteMemoryToRegisterPass());
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-15 16:57:23 +00:00
|
|
|
void LLVMAddAddDiscriminatorsPass(LLVMPassManagerRef PM) {
|
|
|
|
|
unwrap(PM)->add(createAddDiscriminatorsPass());
|
|
|
|
|
}
|