aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Cohen <jeffc@jolt-lang.org>2005-01-06 06:02:53 +0000
committerJeff Cohen <jeffc@jolt-lang.org>2005-01-06 06:02:53 +0000
commit4b807e0381be558f3c9173c971ecf640cb9a9176 (patch)
treeabc2cb365e472f5f50d90b87ea3c83d7ee5619bc
parentf5e58f8f436259656886161792127b3630ab7bfd (diff)
downloadexternal_llvm-4b807e0381be558f3c9173c971ecf640cb9a9176.zip
external_llvm-4b807e0381be558f3c9173c971ecf640cb9a9176.tar.gz
external_llvm-4b807e0381be558f3c9173c971ecf640cb9a9176.tar.bz2
Add project opt to Visual Studio.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19307 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Transforms/LinkAllPasses.h114
-rw-r--r--tools/opt/opt.cpp1
-rw-r--r--win32/Transforms/Transforms.vcproj9
-rw-r--r--win32/llvm.sln16
-rw-r--r--win32/opt/opt.vcproj137
5 files changed, 277 insertions, 0 deletions
diff --git a/include/llvm/Transforms/LinkAllPasses.h b/include/llvm/Transforms/LinkAllPasses.h
new file mode 100644
index 0000000..5d58064
--- /dev/null
+++ b/include/llvm/Transforms/LinkAllPasses.h
@@ -0,0 +1,114 @@
+//===- llvm/Transforms/IPO.h - Interprocedural Transformations --*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by Jeff Cohen and is distributed under the
+// University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This header file is required for building with Microsoft's VC++, as it has
+// no way of linking all registered passes into executables other than by
+// explicit use.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TRANSFORMS_LINKALLPASSES_H
+#define LLVM_TRANSFORMS_LINKALLPASSES_H
+
+#include "llvm/Config/config.h"
+
+#ifdef LLVM_ON_WIN32
+
+#include "llvm/Transforms/Instrumentation.h"
+#include "llvm/Transforms/IPO.h"
+#include "llvm/Transforms/Scalar.h"
+#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
+
+// Trying not to include <windows.h>, though maybe we should...
+extern "C" __declspec(dllimport) void* __stdcall GetCurrentProcess();
+
+namespace {
+ struct ForceLinking {
+ ForceLinking() {
+ // We must reference the passes in such a way that VC++ will not
+ // delete it all as dead code, even with whole program optimization,
+ // yet is effectively a NO-OP. As the compiler isn't smart enough
+ // to know that GetCurrentProcess() never returns
+ // INVALID_HANDLE_VALUE, this will do the job.
+ if (GetCurrentProcess() != (void *) -1)
+ return;
+
+ std::vector<llvm::BasicBlock*> bbv;
+
+ // The commented out calls below refer to non-existant creation
+ // functions. They will be uncommented as the functions are added.
+
+ // (void) llvm::createADCEPass();
+ // (void) llvm::createArgPromotionPass();
+ // (void) llvm::createBasicBlockTracerPass();
+ (void) llvm::createBlockExtractorPass(bbv);
+ // (void) llvm::createBlockPlacementPass();
+ // (void) llvm::createBlockProfilerPass();
+ (void) llvm::createBreakCriticalEdgesPass();
+ // (void) llvm::createCEEPass();
+ // (void) llvm::createCFGSimplifyPass();
+ (void) llvm::createCombineBranchesPass();
+ // (void) llvm::createConstantExpressionsLowerPass();
+ (void) llvm::createConstantMergePass();
+ (void) llvm::createConstantPropagationPass();
+ // (void) llvm::createDAEPass();
+ // (void) llvm::createDCEPass();
+ // (void) llvm::createDSEPass();
+ // (void) llvm::createDTEPass();
+ (void) llvm::createDeadInstEliminationPass();
+ // (void) llvm::createEdgeProfilerPass();
+ (void) llvm::createEmitFunctionTablePass();
+ // (void) llvm::createFunctionProfilerPass();
+ (void) llvm::createFunctionResolvingPass();
+ // (void) llvm::createFunctionTracerPass();
+ (void) llvm::createGCSEPass();
+ (void) llvm::createGlobalDCEPass();
+ (void) llvm::createGlobalOptimizerPass();
+ // (void) llvm::createIPCPPass();
+ (void) llvm::createIPSCCPPass();
+ (void) llvm::createIndVarSimplifyPass();
+ // (void) llvm::createInstCombinerPass();
+ // (void) llvm::createInstLoopsPass();
+ (void) llvm::createInternalizePass();
+ (void) llvm::createLICMPass();
+ // (void) llvm::createLoopExtractorPass();
+ (void) llvm::createLoopSimplifyPass();
+ (void) llvm::createLoopStrengthReducePass();
+ (void) llvm::createLoopUnrollPass();
+ (void) llvm::createLoopUnswitchPass();
+ (void) llvm::createLowerAllocationsPass();
+ (void) llvm::createLowerGCPass();
+ (void) llvm::createLowerInvokePass();
+ (void) llvm::createLowerPackedPass();
+ (void) llvm::createLowerSelectPass();
+ (void) llvm::createLowerSetJmpPass();
+ (void) llvm::createLowerSwitchPass();
+ // (void) llvm::createPREPass();
+ // (void) llvm::createProfilePathsPass();
+ // (void) llvm::createPromotePass();
+ (void) llvm::createPruneEHPass();
+ // (void) llvm::createRPRPass();
+ (void) llvm::createRaiseAllocationsPass();
+ (void) llvm::createReassociatePass();
+ (void) llvm::createSCCPPass();
+ // (void) llvm::createSROAPass();
+ // (void) llvm::createSimpleInlinerPass();
+ (void) llvm::createSingleLoopExtractorPass();
+ (void) llvm::createStripSymbolsPass();
+ (void) llvm::createTailCallEliminationPass();
+ (void) llvm::createTailDuplicationPass();
+ // (void) llvm::createTraceBasicBlocksPass();
+ (void) llvm::createUnifyFunctionExitNodesPass();
+ }
+ } X;
+};
+
+#endif // LLVM_ON_WIN32
+
+#endif
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index 56bc16b..fd339d9 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -23,6 +23,7 @@
#include "llvm/System/Signals.h"
#include "llvm/Support/PluginLoader.h"
#include "llvm/Support/SystemUtils.h"
+#include "llvm/Transforms/LinkAllPasses.h"
#include <fstream>
#include <memory>
#include <algorithm>
diff --git a/win32/Transforms/Transforms.vcproj b/win32/Transforms/Transforms.vcproj
index 547c238..ba900b2 100644
--- a/win32/Transforms/Transforms.vcproj
+++ b/win32/Transforms/Transforms.vcproj
@@ -229,6 +229,9 @@
<File
RelativePath="..\..\lib\Transforms\Ipo\RaiseAllocations.cpp">
</File>
+ <File
+ RelativePath="..\..\lib\Transforms\Ipo\StripSymbols.cpp">
+ </File>
</Filter>
<Filter
Name="Scalar"
@@ -267,6 +270,9 @@
RelativePath="..\..\lib\Transforms\Scalar\LoopSimplify.cpp">
</File>
<File
+ RelativePath="..\..\lib\Transforms\Scalar\LoopStrengthReduce.cpp">
+ </File>
+ <File
RelativePath="..\..\lib\Transforms\Scalar\LoopUnroll.cpp">
</File>
<File
@@ -401,6 +407,9 @@
RelativePath="..\..\include\llvm\Transforms\IPO.h">
</File>
<File
+ RelativePath="..\..\include\llvm\Transforms\LinkAllPasses.h">
+ </File>
+ <File
RelativePath="..\..\include\llvm\Transforms\Utils\Local.h">
</File>
<File
diff --git a/win32/llvm.sln b/win32/llvm.sln
index 4a23fbc..df24ada 100644
--- a/win32/llvm.sln
+++ b/win32/llvm.sln
@@ -163,6 +163,18 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CBackend", "CBackend\CBacke
{19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opt", "opt\opt.vcproj", "{006D8B41-C3C7-4448-85E1-AF8907E591E5}"
+ ProjectSection(ProjectDependencies) = postProject
+ {0622E827-8464-489D-8B1C-B0B496F35C08} = {0622E827-8464-489D-8B1C-B0B496F35C08}
+ {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
+ {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
+ {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}
+ {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}
+ {C59374C1-9FC0-4147-B836-327DFDC52D99} = {C59374C1-9FC0-4147-B836-327DFDC52D99}
+ {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
+ {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
@@ -261,6 +273,10 @@ Global
{057777CD-DED5-46DF-BF9A-6B76DE212549}.Debug.Build.0 = Debug|Win32
{057777CD-DED5-46DF-BF9A-6B76DE212549}.Release.ActiveCfg = Release|Win32
{057777CD-DED5-46DF-BF9A-6B76DE212549}.Release.Build.0 = Release|Win32
+ {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Debug.ActiveCfg = Debug|Win32
+ {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Debug.Build.0 = Debug|Win32
+ {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Release.ActiveCfg = Release|Win32
+ {006D8B41-C3C7-4448-85E1-AF8907E591E5}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
diff --git a/win32/opt/opt.vcproj b/win32/opt/opt.vcproj
new file mode 100644
index 0000000..0c6efc5
--- /dev/null
+++ b/win32/opt/opt.vcproj
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="opt"
+ ProjectGUID="{006D8B41-C3C7-4448-85E1-AF8907E591E5}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(IntDir)"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\include;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ ForceConformanceInForLoopScope="TRUE"
+ RuntimeTypeInfo="TRUE"
+ UsePrecompiledHeader="0"
+ BrowseInformation="1"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="FALSE"
+ DebugInformationFormat="4"
+ DisableSpecificWarnings="4146,4800"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/opt.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/opt.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(IntDir)"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..\..\include;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;__STDC_LIMIT_MACROS"
+ RuntimeLibrary="2"
+ ForceConformanceInForLoopScope="TRUE"
+ RuntimeTypeInfo="TRUE"
+ UsePrecompiledHeader="0"
+ BrowseInformation="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="FALSE"
+ DebugInformationFormat="3"
+ DisableSpecificWarnings="4146,4800"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/opt.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath="..\..\tools\opt\opt.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>