Skip to content

Commit 00d5508

Browse files
author
Jeff Cohen
committed
Add project opt to Visual Studio.
llvm-svn: 19307
1 parent eca0d0f commit 00d5508

File tree

5 files changed

+277
-0
lines changed

5 files changed

+277
-0
lines changed
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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

llvm/tools/opt/opt.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "llvm/System/Signals.h"
2424
#include "llvm/Support/PluginLoader.h"
2525
#include "llvm/Support/SystemUtils.h"
26+
#include "llvm/Transforms/LinkAllPasses.h"
2627
#include <fstream>
2728
#include <memory>
2829
#include <algorithm>

llvm/win32/Transforms/Transforms.vcproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@
229229
<File
230230
RelativePath="..\..\lib\Transforms\Ipo\RaiseAllocations.cpp">
231231
</File>
232+
<File
233+
RelativePath="..\..\lib\Transforms\Ipo\StripSymbols.cpp">
234+
</File>
232235
</Filter>
233236
<Filter
234237
Name="Scalar"
@@ -266,6 +269,9 @@
266269
<File
267270
RelativePath="..\..\lib\Transforms\Scalar\LoopSimplify.cpp">
268271
</File>
272+
<File
273+
RelativePath="..\..\lib\Transforms\Scalar\LoopStrengthReduce.cpp">
274+
</File>
269275
<File
270276
RelativePath="..\..\lib\Transforms\Scalar\LoopUnroll.cpp">
271277
</File>
@@ -400,6 +406,9 @@
400406
<File
401407
RelativePath="..\..\include\llvm\Transforms\IPO.h">
402408
</File>
409+
<File
410+
RelativePath="..\..\include\llvm\Transforms\LinkAllPasses.h">
411+
</File>
403412
<File
404413
RelativePath="..\..\include\llvm\Transforms\Utils\Local.h">
405414
</File>

llvm/win32/llvm.sln

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,18 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CBackend", "CBackend\CBacke
163163
{19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
164164
EndProjectSection
165165
EndProject
166+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opt", "opt\opt.vcproj", "{006D8B41-C3C7-4448-85E1-AF8907E591E5}"
167+
ProjectSection(ProjectDependencies) = postProject
168+
{0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08}
169+
{28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
170+
{19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
171+
{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}
172+
{059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}
173+
{C59374C1-9FC0-4147-B836-327DFDC52D99} = {C59374C1-9FC0-4147-B836-327DFDC52D99}
174+
{45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
175+
{0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
176+
EndProjectSection
177+
EndProject
166178
Global
167179
GlobalSection(SolutionConfiguration) = preSolution
168180
Debug = Debug
@@ -261,6 +273,10 @@ Global
261273
{057777CD-DED5-46DF-BF9A-6B76DE212549}.Debug.Build.0 = Debug|Win32
262274
{057777CD-DED5-46DF-BF9A-6B76DE212549}.Release.ActiveCfg = Release|Win32
263275
{057777CD-DED5-46DF-BF9A-6B76DE212549}.Release.Build.0 = Release|Win32
276+
{006D8B41-C3C7-4448-85E1-AF8907E591E5}.Debug.ActiveCfg = Debug|Win32
277+
{006D8B41-C3C7-4448-85E1-AF8907E591E5}.Debug.Build.0 = Debug|Win32
278+
{006D8B41-C3C7-4448-85E1-AF8907E591E5}.Release.ActiveCfg = Release|Win32
279+
{006D8B41-C3C7-4448-85E1-AF8907E591E5}.Release.Build.0 = Release|Win32
264280
EndGlobalSection
265281
GlobalSection(ExtensibilityGlobals) = postSolution
266282
EndGlobalSection

llvm/win32/opt/opt.vcproj

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
<?xml version="1.0" encoding="Windows-1252"?>
2+
<VisualStudioProject
3+
ProjectType="Visual C++"
4+
Version="7.10"
5+
Name="opt"
6+
ProjectGUID="{006D8B41-C3C7-4448-85E1-AF8907E591E5}"
7+
Keyword="Win32Proj">
8+
<Platforms>
9+
<Platform
10+
Name="Win32"/>
11+
</Platforms>
12+
<Configurations>
13+
<Configuration
14+
Name="Debug|Win32"
15+
OutputDirectory="$(SolutionDir)$(IntDir)"
16+
IntermediateDirectory="Debug"
17+
ConfigurationType="1"
18+
CharacterSet="2">
19+
<Tool
20+
Name="VCCLCompilerTool"
21+
Optimization="0"
22+
AdditionalIncludeDirectories="..\..\include;.."
23+
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
24+
MinimalRebuild="TRUE"
25+
BasicRuntimeChecks="3"
26+
RuntimeLibrary="3"
27+
ForceConformanceInForLoopScope="TRUE"
28+
RuntimeTypeInfo="TRUE"
29+
UsePrecompiledHeader="0"
30+
BrowseInformation="1"
31+
WarningLevel="3"
32+
Detect64BitPortabilityProblems="FALSE"
33+
DebugInformationFormat="4"
34+
DisableSpecificWarnings="4146,4800"/>
35+
<Tool
36+
Name="VCCustomBuildTool"/>
37+
<Tool
38+
Name="VCLinkerTool"
39+
OutputFile="$(OutDir)/opt.exe"
40+
LinkIncremental="2"
41+
GenerateDebugInformation="TRUE"
42+
ProgramDatabaseFile="$(OutDir)/opt.pdb"
43+
SubSystem="1"
44+
TargetMachine="1"/>
45+
<Tool
46+
Name="VCMIDLTool"/>
47+
<Tool
48+
Name="VCPostBuildEventTool"/>
49+
<Tool
50+
Name="VCPreBuildEventTool"/>
51+
<Tool
52+
Name="VCPreLinkEventTool"/>
53+
<Tool
54+
Name="VCResourceCompilerTool"/>
55+
<Tool
56+
Name="VCWebServiceProxyGeneratorTool"/>
57+
<Tool
58+
Name="VCXMLDataGeneratorTool"/>
59+
<Tool
60+
Name="VCWebDeploymentTool"/>
61+
<Tool
62+
Name="VCManagedWrapperGeneratorTool"/>
63+
<Tool
64+
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
65+
</Configuration>
66+
<Configuration
67+
Name="Release|Win32"
68+
OutputDirectory="$(SolutionDir)$(IntDir)"
69+
IntermediateDirectory="Release"
70+
ConfigurationType="1"
71+
CharacterSet="2">
72+
<Tool
73+
Name="VCCLCompilerTool"
74+
AdditionalIncludeDirectories="..\..\include;.."
75+
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
76+
RuntimeLibrary="2"
77+
ForceConformanceInForLoopScope="TRUE"
78+
RuntimeTypeInfo="TRUE"
79+
UsePrecompiledHeader="0"
80+
BrowseInformation="0"
81+
WarningLevel="3"
82+
Detect64BitPortabilityProblems="FALSE"
83+
DebugInformationFormat="3"
84+
DisableSpecificWarnings="4146,4800"/>
85+
<Tool
86+
Name="VCCustomBuildTool"/>
87+
<Tool
88+
Name="VCLinkerTool"
89+
OutputFile="$(OutDir)/opt.exe"
90+
LinkIncremental="1"
91+
GenerateDebugInformation="TRUE"
92+
SubSystem="1"
93+
OptimizeReferences="2"
94+
EnableCOMDATFolding="2"
95+
TargetMachine="1"/>
96+
<Tool
97+
Name="VCMIDLTool"/>
98+
<Tool
99+
Name="VCPostBuildEventTool"/>
100+
<Tool
101+
Name="VCPreBuildEventTool"/>
102+
<Tool
103+
Name="VCPreLinkEventTool"/>
104+
<Tool
105+
Name="VCResourceCompilerTool"/>
106+
<Tool
107+
Name="VCWebServiceProxyGeneratorTool"/>
108+
<Tool
109+
Name="VCXMLDataGeneratorTool"/>
110+
<Tool
111+
Name="VCWebDeploymentTool"/>
112+
<Tool
113+
Name="VCManagedWrapperGeneratorTool"/>
114+
<Tool
115+
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
116+
</Configuration>
117+
</Configurations>
118+
<References>
119+
</References>
120+
<Files>
121+
<Filter
122+
Name="Source Files"
123+
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
124+
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
125+
<File
126+
RelativePath="..\..\tools\opt\opt.cpp">
127+
</File>
128+
</Filter>
129+
<Filter
130+
Name="Header Files"
131+
Filter="h;hpp;hxx;hm;inl;inc;xsd"
132+
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
133+
</Filter>
134+
</Files>
135+
<Globals>
136+
</Globals>
137+
</VisualStudioProject>

0 commit comments

Comments
 (0)