9d27437ea8a55559c45739f9c07ff966888d7bee
[oota-llvm.git] / include / llvm / Transforms / LinkAllPasses.h
1 //===- llvm/Transforms/LinkAllPasses.h - Reference All Passes ---*- C++ -*-===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by Jeff Cohen and is distributed under the
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9 //
10 // This header file is required for building with Microsoft's VC++, as it has
11 // no way of linking all registered passes into executables other than by
12 // explicit use.
13 //
14 //===----------------------------------------------------------------------===//
15
16 #ifndef LLVM_TRANSFORMS_LINKALLPASSES_H
17 #define LLVM_TRANSFORMS_LINKALLPASSES_H
18
19 #ifdef _MSC_VER
20
21 #include "llvm/Transforms/Instrumentation.h"
22 #include "llvm/Transforms/IPO.h"
23 #include "llvm/Transforms/Scalar.h"
24 #include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
25
26 // Trying not to include <windows.h>, though maybe we should...  Problem is,
27 // it pollutes the global namespace in some really nasty ways.
28 extern "C" __declspec(dllimport) void* __stdcall GetCurrentProcess();
29
30 namespace {
31     struct ForceLinking {
32         ForceLinking() {
33             // We must reference the passes in such a way that VC++ will not
34             // delete it all as dead code, even with whole program optimization,
35             // yet is effectively a NO-OP.  As the compiler isn't smart enough
36             // to know that GetCurrentProcess() never returns
37             // INVALID_HANDLE_VALUE, this will do the job.
38             if (GetCurrentProcess() != (void *) -1)
39                 return;
40
41             std::vector<llvm::BasicBlock*> bbv;
42
43             // The commented out calls below refer to non-existent creation
44             // functions.  They will be uncommented as the functions are added.
45
46             (void) llvm::createAggressiveDCEPass();
47             (void) llvm::createArgumentPromotionPass();
48             (void) llvm::createBreakCriticalEdgesPass();
49             (void) llvm::createCFGSimplificationPass();
50             (void) llvm::createCombineBranchesPass();
51             (void) llvm::createConstantMergePass();
52             (void) llvm::createConstantPropagationPass();
53             (void) llvm::createCorrelatedExpressionEliminationPass();
54             (void) llvm::createDeadArgEliminationPass();
55             (void) llvm::createDeadCodeEliminationPass();
56             (void) llvm::createDeadInstEliminationPass();
57             (void) llvm::createDeadStoreEliminationPass();
58             (void) llvm::createDeadTypeEliminationPass();
59             (void) llvm::createEmitFunctionTablePass();
60             (void) llvm::createFunctionInliningPass();
61             (void) llvm::createFunctionResolvingPass();
62             (void) llvm::createGCSEPass();
63             (void) llvm::createGlobalDCEPass();
64             (void) llvm::createGlobalOptimizerPass();
65             (void) llvm::createIPConstantPropagationPass();
66             (void) llvm::createIPSCCPPass();
67             (void) llvm::createIndVarSimplifyPass();
68             (void) llvm::createInstructionCombiningPass();
69             (void) llvm::createInternalizePass();
70             (void) llvm::createLICMPass();
71             (void) llvm::createLoopInstrumentationPass();
72             (void) llvm::createLoopSimplifyPass();
73             (void) llvm::createLoopStrengthReducePass();
74             (void) llvm::createLoopUnrollPass();
75             (void) llvm::createLoopUnswitchPass();
76             (void) llvm::createLowerAllocationsPass();
77             (void) llvm::createLowerGCPass();
78             (void) llvm::createLowerInvokePass();
79             (void) llvm::createLowerPackedPass();
80             (void) llvm::createLowerSetJmpPass();
81             (void) llvm::createLowerSwitchPass();
82             (void) llvm::createPromoteMemoryToRegister();
83             (void) llvm::createPruneEHPass();
84             (void) llvm::createRaiseAllocationsPass();
85             (void) llvm::createRaisePointerReferencesPass();
86             (void) llvm::createReassociatePass();
87             (void) llvm::createSCCPPass();
88             (void) llvm::createScalarReplAggregatesPass();
89             (void) llvm::createSingleLoopExtractorPass();
90             (void) llvm::createTailCallEliminationPass();
91             (void) llvm::createTailDuplicationPass();
92             (void) llvm::createTraceValuesPassForBasicBlocks();
93             (void) llvm::createTraceValuesPassForFunction();
94         }
95     } X;
96 };
97
98 #endif // _MSC_VER
99
100 #endif