Add project opt to Visual Studio.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19307 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jeff Cohen 2005-01-06 06:02:53 +00:00
parent f5e58f8f43
commit 4b807e0381
5 changed files with 277 additions and 0 deletions

View File

@ -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

View File

@ -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>

View File

@ -229,6 +229,9 @@
<File
RelativePath="..\..\lib\Transforms\Ipo\RaiseAllocations.cpp">
</File>
<File
RelativePath="..\..\lib\Transforms\Ipo\StripSymbols.cpp">
</File>
</Filter>
<Filter
Name="Scalar"
@ -266,6 +269,9 @@
<File
RelativePath="..\..\lib\Transforms\Scalar\LoopSimplify.cpp">
</File>
<File
RelativePath="..\..\lib\Transforms\Scalar\LoopStrengthReduce.cpp">
</File>
<File
RelativePath="..\..\lib\Transforms\Scalar\LoopUnroll.cpp">
</File>
@ -400,6 +406,9 @@
<File
RelativePath="..\..\include\llvm\Transforms\IPO.h">
</File>
<File
RelativePath="..\..\include\llvm\Transforms\LinkAllPasses.h">
</File>
<File
RelativePath="..\..\include\llvm\Transforms\Utils\Local.h">
</File>

View File

@ -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

137
win32/opt/opt.vcproj Normal file
View File

@ -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>