mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-26 21:20:37 +00:00
d04a8d4b33
Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
108 lines
3.8 KiB
C++
108 lines
3.8 KiB
C++
//===-- Analysis.cpp ------------------------------------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm-c/Analysis.h"
|
|
#include "llvm-c/Initialization.h"
|
|
#include "llvm/Analysis/Verifier.h"
|
|
#include "llvm/InitializePasses.h"
|
|
#include <cstring>
|
|
|
|
using namespace llvm;
|
|
|
|
/// initializeAnalysis - Initialize all passes linked into the Analysis library.
|
|
void llvm::initializeAnalysis(PassRegistry &Registry) {
|
|
initializeAliasAnalysisAnalysisGroup(Registry);
|
|
initializeAliasAnalysisCounterPass(Registry);
|
|
initializeAAEvalPass(Registry);
|
|
initializeAliasDebuggerPass(Registry);
|
|
initializeAliasSetPrinterPass(Registry);
|
|
initializeNoAAPass(Registry);
|
|
initializeBasicAliasAnalysisPass(Registry);
|
|
initializeBlockFrequencyInfoPass(Registry);
|
|
initializeBranchProbabilityInfoPass(Registry);
|
|
initializeCostModelAnalysisPass(Registry);
|
|
initializeCFGViewerPass(Registry);
|
|
initializeCFGPrinterPass(Registry);
|
|
initializeCFGOnlyViewerPass(Registry);
|
|
initializeCFGOnlyPrinterPass(Registry);
|
|
initializePrintDbgInfoPass(Registry);
|
|
initializeDependenceAnalysisPass(Registry);
|
|
initializeDominanceFrontierPass(Registry);
|
|
initializeDomViewerPass(Registry);
|
|
initializeDomPrinterPass(Registry);
|
|
initializeDomOnlyViewerPass(Registry);
|
|
initializePostDomViewerPass(Registry);
|
|
initializeDomOnlyPrinterPass(Registry);
|
|
initializePostDomPrinterPass(Registry);
|
|
initializePostDomOnlyViewerPass(Registry);
|
|
initializePostDomOnlyPrinterPass(Registry);
|
|
initializeIVUsersPass(Registry);
|
|
initializeInstCountPass(Registry);
|
|
initializeIntervalPartitionPass(Registry);
|
|
initializeLazyValueInfoPass(Registry);
|
|
initializeLibCallAliasAnalysisPass(Registry);
|
|
initializeLintPass(Registry);
|
|
initializeLoopInfoPass(Registry);
|
|
initializeMemDepPrinterPass(Registry);
|
|
initializeMemoryDependenceAnalysisPass(Registry);
|
|
initializeModuleDebugInfoPrinterPass(Registry);
|
|
initializePostDominatorTreePass(Registry);
|
|
initializeProfileEstimatorPassPass(Registry);
|
|
initializeNoProfileInfoPass(Registry);
|
|
initializeNoPathProfileInfoPass(Registry);
|
|
initializeProfileInfoAnalysisGroup(Registry);
|
|
initializePathProfileInfoAnalysisGroup(Registry);
|
|
initializeLoaderPassPass(Registry);
|
|
initializePathProfileLoaderPassPass(Registry);
|
|
initializeProfileVerifierPassPass(Registry);
|
|
initializePathProfileVerifierPass(Registry);
|
|
initializeProfileMetadataLoaderPassPass(Registry);
|
|
initializeRegionInfoPass(Registry);
|
|
initializeRegionViewerPass(Registry);
|
|
initializeRegionPrinterPass(Registry);
|
|
initializeRegionOnlyViewerPass(Registry);
|
|
initializeRegionOnlyPrinterPass(Registry);
|
|
initializeScalarEvolutionPass(Registry);
|
|
initializeScalarEvolutionAliasAnalysisPass(Registry);
|
|
initializeTypeBasedAliasAnalysisPass(Registry);
|
|
}
|
|
|
|
void LLVMInitializeAnalysis(LLVMPassRegistryRef R) {
|
|
initializeAnalysis(*unwrap(R));
|
|
}
|
|
|
|
LLVMBool LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action,
|
|
char **OutMessages) {
|
|
std::string Messages;
|
|
|
|
LLVMBool Result = verifyModule(*unwrap(M),
|
|
static_cast<VerifierFailureAction>(Action),
|
|
OutMessages? &Messages : 0);
|
|
|
|
if (OutMessages)
|
|
*OutMessages = strdup(Messages.c_str());
|
|
|
|
return Result;
|
|
}
|
|
|
|
LLVMBool LLVMVerifyFunction(LLVMValueRef Fn, LLVMVerifierFailureAction Action) {
|
|
return verifyFunction(*unwrap<Function>(Fn),
|
|
static_cast<VerifierFailureAction>(Action));
|
|
}
|
|
|
|
void LLVMViewFunctionCFG(LLVMValueRef Fn) {
|
|
Function *F = unwrap<Function>(Fn);
|
|
F->viewCFG();
|
|
}
|
|
|
|
void LLVMViewFunctionCFGOnly(LLVMValueRef Fn) {
|
|
Function *F = unwrap<Function>(Fn);
|
|
F->viewCFGOnly();
|
|
}
|