|
| 1 | +//===- llvm/Transforms/IPO.h - Interprocedural Transformations --*- 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 | +#include "llvm/Config/config.h" |
| 20 | + |
| 21 | +#ifdef LLVM_ON_WIN32 |
| 22 | + |
| 23 | +#include "llvm/Transforms/Instrumentation.h" |
| 24 | +#include "llvm/Transforms/IPO.h" |
| 25 | +#include "llvm/Transforms/Scalar.h" |
| 26 | +#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h" |
| 27 | + |
| 28 | +// Trying not to include <windows.h>, though maybe we should... |
| 29 | +extern "C" __declspec(dllimport) void* __stdcall GetCurrentProcess(); |
| 30 | + |
| 31 | +namespace { |
| 32 | + struct ForceLinking { |
| 33 | + ForceLinking() { |
| 34 | + // We must reference the passes in such a way that VC++ will not |
| 35 | + // delete it all as dead code, even with whole program optimization, |
| 36 | + // yet is effectively a NO-OP. As the compiler isn't smart enough |
| 37 | + // to know that GetCurrentProcess() never returns |
| 38 | + // INVALID_HANDLE_VALUE, this will do the job. |
| 39 | + if (GetCurrentProcess() != (void *) -1) |
| 40 | + return; |
| 41 | + |
| 42 | + std::vector<llvm::BasicBlock*> bbv; |
| 43 | + |
| 44 | + // The commented out calls below refer to non-existant creation |
| 45 | + // functions. They will be uncommented as the functions are added. |
| 46 | + |
| 47 | + // (void) llvm::createADCEPass(); |
| 48 | + // (void) llvm::createArgPromotionPass(); |
| 49 | + // (void) llvm::createBasicBlockTracerPass(); |
| 50 | + (void) llvm::createBlockExtractorPass(bbv); |
| 51 | + // (void) llvm::createBlockPlacementPass(); |
| 52 | + // (void) llvm::createBlockProfilerPass(); |
| 53 | + (void) llvm::createBreakCriticalEdgesPass(); |
| 54 | + // (void) llvm::createCEEPass(); |
| 55 | + // (void) llvm::createCFGSimplifyPass(); |
| 56 | + (void) llvm::createCombineBranchesPass(); |
| 57 | + // (void) llvm::createConstantExpressionsLowerPass(); |
| 58 | + (void) llvm::createConstantMergePass(); |
| 59 | + (void) llvm::createConstantPropagationPass(); |
| 60 | + // (void) llvm::createDAEPass(); |
| 61 | + // (void) llvm::createDCEPass(); |
| 62 | + // (void) llvm::createDSEPass(); |
| 63 | + // (void) llvm::createDTEPass(); |
| 64 | + (void) llvm::createDeadInstEliminationPass(); |
| 65 | + // (void) llvm::createEdgeProfilerPass(); |
| 66 | + (void) llvm::createEmitFunctionTablePass(); |
| 67 | + // (void) llvm::createFunctionProfilerPass(); |
| 68 | + (void) llvm::createFunctionResolvingPass(); |
| 69 | + // (void) llvm::createFunctionTracerPass(); |
| 70 | + (void) llvm::createGCSEPass(); |
| 71 | + (void) llvm::createGlobalDCEPass(); |
| 72 | + (void) llvm::createGlobalOptimizerPass(); |
| 73 | + // (void) llvm::createIPCPPass(); |
| 74 | + (void) llvm::createIPSCCPPass(); |
| 75 | + (void) llvm::createIndVarSimplifyPass(); |
| 76 | + // (void) llvm::createInstCombinerPass(); |
| 77 | + // (void) llvm::createInstLoopsPass(); |
| 78 | + (void) llvm::createInternalizePass(); |
| 79 | + (void) llvm::createLICMPass(); |
| 80 | + // (void) llvm::createLoopExtractorPass(); |
| 81 | + (void) llvm::createLoopSimplifyPass(); |
| 82 | + (void) llvm::createLoopStrengthReducePass(); |
| 83 | + (void) llvm::createLoopUnrollPass(); |
| 84 | + (void) llvm::createLoopUnswitchPass(); |
| 85 | + (void) llvm::createLowerAllocationsPass(); |
| 86 | + (void) llvm::createLowerGCPass(); |
| 87 | + (void) llvm::createLowerInvokePass(); |
| 88 | + (void) llvm::createLowerPackedPass(); |
| 89 | + (void) llvm::createLowerSelectPass(); |
| 90 | + (void) llvm::createLowerSetJmpPass(); |
| 91 | + (void) llvm::createLowerSwitchPass(); |
| 92 | + // (void) llvm::createPREPass(); |
| 93 | + // (void) llvm::createProfilePathsPass(); |
| 94 | + // (void) llvm::createPromotePass(); |
| 95 | + (void) llvm::createPruneEHPass(); |
| 96 | + // (void) llvm::createRPRPass(); |
| 97 | + (void) llvm::createRaiseAllocationsPass(); |
| 98 | + (void) llvm::createReassociatePass(); |
| 99 | + (void) llvm::createSCCPPass(); |
| 100 | + // (void) llvm::createSROAPass(); |
| 101 | + // (void) llvm::createSimpleInlinerPass(); |
| 102 | + (void) llvm::createSingleLoopExtractorPass(); |
| 103 | + (void) llvm::createStripSymbolsPass(); |
| 104 | + (void) llvm::createTailCallEliminationPass(); |
| 105 | + (void) llvm::createTailDuplicationPass(); |
| 106 | + // (void) llvm::createTraceBasicBlocksPass(); |
| 107 | + (void) llvm::createUnifyFunctionExitNodesPass(); |
| 108 | + } |
| 109 | + } X; |
| 110 | +}; |
| 111 | + |
| 112 | +#endif // LLVM_ON_WIN32 |
| 113 | + |
| 114 | +#endif |
0 commit comments