Commit Graph

60 Commits

Author SHA1 Message Date
Duncan Sands
b0f1e1780c Add a new codegen pass that normalizes dwarf exception handling
code in preparation for code generation.  The main thing it does
is handle the case when eh.exception calls (and, in a future
patch, eh.selector calls) are far away from landing pads.  Right
now in practice you only find eh.exception calls close to landing
pads: either in a landing pad (the common case) or in a landing
pad successor, due to loop passes shifting them about.  However
future exception handling improvements will result in calls far
from landing pads:
(1) Inlining of rewinds.  Consider the following case:
In function @f:
...
  invoke @g to label %normal unwind label %unwinds
...
unwinds:
  %ex = call i8* @llvm.eh.exception()
...

In function @g:
...
  invoke @something to label %continue unwind label %handler
...
handler:
  %ex = call i8* @llvm.eh.exception()
... perform cleanups ...
  "rethrow exception"

Now inline @g into @f.  Currently this is turned into:
In function @f:
...
  invoke @something to label %continue unwind label %handler
...
handler:
  %ex = call i8* @llvm.eh.exception()
... perform cleanups ...
  invoke "rethrow exception" to label %normal unwind label %unwinds
unwinds:
  %ex = call i8* @llvm.eh.exception()
...

However we would like to simplify invoke of "rethrow exception" into
a branch to the %unwinds label.  Then %unwinds is no longer a landing
pad, and the eh.exception call there is then far away from any landing
pads.

(2) Using the unwind instruction for cleanups.
It would be nice to have codegen handle the following case:
  invoke @something to label %continue unwind label %run_cleanups
...
handler:
... perform cleanups ...
  unwind

This requires turning "unwind" into a library call, which
necessarily takes a pointer to the exception as an argument
(this patch also does this unwind lowering).  But that means
you are using eh.exception again far from a landing pad.

(3) Bugpoint simplifications.  When bugpoint is simplifying
exception handling code it often generates eh.exception calls
far from a landing pad, which then causes codegen to assert.
Bugpoint then latches on to this assertion and loses sight
of the original problem.

Note that it is currently rare for this pass to actually do
anything.  And in fact it normally shouldn't do anything at
all given the code coming out of llvm-gcc!  But it does fire
a few times in the testsuite.  As far as I can see this is
almost always due to the LoopStrengthReduce codegen pass
introducing pointless loop preheader blocks which are landing
pads and only contain a branch to another block.  This other
block contains an eh.exception call.  So probably by tweaking
LoopStrengthReduce a bit this can be avoided.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72276 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22 20:36:31 +00:00
Steve Naroff
544526885b Update VS project files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63017 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 18:08:55 +00:00
Steve Naroff
d94aa403b7 Handful of fixes to the VC project files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62807 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-22 23:05:37 +00:00
Steve Naroff
e11eb620ef Update VC++ projects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58798 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 06:24:59 +00:00
Steve Naroff
b1e5edc27e Add file to VC++ project.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58060 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24 01:21:47 +00:00
Chris Lattner
1b8f4bb4a1 update win32 project file, patch provided by OvermindDL1 on llvmdev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57386 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-11 22:14:59 +00:00
Cedric Venet
8e4018e2de Update VS projects.
Change some class to struct for coherency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56389 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-20 18:02:18 +00:00
Argyrios Kyrtzidis
076055ccd3 Update VC++ project files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55985 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-09 11:38:37 +00:00
Cedric Venet
a3f343f4cd Updating VC++ project.
Adding one include file and correct one declaration from class to struct in order to make llvm compile on VC2005.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55279 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-24 11:56:40 +00:00
Gordon Henriksen
b20d685c6f Update VC++ project.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54905 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 19:57:31 +00:00
Cedric Venet
94fb5f2a70 Make it compile on VC2005:
- update VC projects.
- Add an overload to llvm::Stream for <<, since std::hex and std::dec have type std::ios_base& (*)(std::ios_base&) in VC++. (templating the function don't work, due to ambiguities)
- add ../ on several include in X86/AsmPrinter/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54898 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 18:24:26 +00:00
Cedric Venet
1c5afa3767 update VS project.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54580 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 11:57:39 +00:00
Chris Lattner
d28516e3b1 This replaces all $(SolutionDir) macros with $(ProjectDir)..\
Patch by Nicolas Capens!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53571 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-14 18:46:16 +00:00
Cedric Venet
9322fe02dd Remove deleted files from VC++ project.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53521 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-13 11:12:36 +00:00
Cedric Venet
5e950627f9 Add an include file needed for VS.
Add two new file to codegen project (VS).
This unbreak the build for VS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52831 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 18:00:09 +00:00
Ted Kremenek
6fa1c051dc Updated VS build system. Patch provided by Cedric Venet:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-June/015446.html



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52564 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 22:19:12 +00:00
Chris Lattner
f6af087cb9 "Just a small update for the project files for adding a missing preprocessor
definition for VS2005 (without SP1). It suppress the (bogus) M$ deprecated
warning."

Patch by Cédric Venet!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52530 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 05:35:58 +00:00
Chris Lattner
e562a2f499 Update VC project files, patch by Cédric Venet!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52077 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-07 19:33:54 +00:00
Devang Patel
0c87f2d824 Revert 51067 check-in for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51155 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-15 18:46:28 +00:00
Chris Lattner
9b43ac042e Update the Win32 project files, patch by Razvan Aciu!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51067 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 20:56:51 +00:00
Chuck Rose III
5b0c85588a Updating win32 VStudio project files with new file references and removing dead references.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48849 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 00:02:53 +00:00
Chuck Rose III
9a79de3d09 Add files to windows project files. Also include <algorithm> explicitly so that vstudio build works
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46013 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 21:43:17 +00:00
Chuck Rose III
0b589912a8 Adding new files to win32 build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45545 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-03 19:53:03 +00:00
Chris Lattner
b08b8e6f59 Fix PR1888, patch by Wilhansen Li.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45501 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-02 21:30:58 +00:00
Chuck Rose III
1a4ab520d5 Add StringPool + new CodeGen files to win32 build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44805 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 19:31:09 +00:00
Chuck Rose III
e5839f8788 Adding MachineLoopInfo.h,.cpp and MachineLICP.cpp to VStudio build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44690 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 00:53:13 +00:00
Chuck Rose III
0ccb93034a This change does a couple of things. First it gets the Visual Studio builds working.
I added the lexing files to the VStudio projects and removed the .l files from the 
VStudio projects.  There was a problem with use of strtoll in TGLexer.cpp and Chris
suggested switching to strtol, so that's included here.

Additionally, this checkin adds minimal x64 builds to the VStudio builds.  Build issues
related to x64 in the windows specific files for DynamicLibrary.inc and Singals.inc
are worked around, but not ultimately solved.  Binaries used to be stored in

...\win32\{Debug|Release}

but are now kept in

...\win32\bin\{win32|x64}\{Debug|Release}

intermediate files will continue to be stored in the individual project directories under 
win32.  

Some names will likely change in the future to reflect that the vstudio projects
are no longer 32-bit only, but I wanted to get things up and running today so kept away
from bigger restructuring.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44260 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-21 00:37:56 +00:00
Hartmut Kaiser
7de5a94099 Updated VC++ build system
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44004 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12 01:24:50 +00:00
Chuck Rose III
77819419b8 Adding some recently added files to the VStudio projects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43919 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09 00:48:27 +00:00
Hartmut Kaiser
abaff883ba Updated VC++ build system
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43837 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-07 19:34:09 +00:00
Hartmut Kaiser
f2af25b2c1 Updated VC++ build system
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43631 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-02 01:44:08 +00:00
Hartmut Kaiser
e476a66761 Updated VC++ build system
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43479 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 21:56:15 +00:00
Hartmut Kaiser
73184fcdc3 Updated VC++ build system.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42835 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 19:50:09 +00:00
Chuck Rose III
7c2c2e71ed Updates to the VStudio project files:
1. Switch from VStudio 2k3 to VStudio 2k5

2. All pdb files now will be placed as $(OutputDir)/$(ProjectName).pdb.  This puts them alongside the 
binaries with the same base name as the binary.  If you need to copy the results of your llvm build 
into another project's tree, this will simplify that process.

3. Recent files added to the tree were added to the proejects within the VStudio project

4. Project build dependency order fixed so that the build can take place in one pass.  A generated
file was not being built at the correct time, causing a build error in about half the projects until
the build was run a second time.

Note you will need flex and bison installed an in your path in order to build properly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40557 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-27 18:20:11 +00:00
Jeff Cohen
ca5183d445 Unbreak VC++ build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34917 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 00:00:42 +00:00
Jeff Cohen
1b30754ba9 Unbreak VC++ build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33242 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 20:27:18 +00:00
Jeff Cohen
d41b30def3 Unbreak VC++ build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31464 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-05 19:31:28 +00:00
Jeff Cohen
196d9b680e Keep Visual Studio happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28067 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-03 00:28:50 +00:00
Jeff Cohen
84bfed087b Keep Visual Studio informed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27951 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-23 04:37:08 +00:00
Jeff Cohen
b52a5d944d Get Visual Studio happy again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27031 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-24 02:18:52 +00:00
Jeff Cohen
9247d0b12b Add _CRT_SECURE_NO_DEPRECATE preprocessor symbol to make VS2005 happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25801 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-30 04:07:08 +00:00
Jeff Cohen
93c56e755f Add new files to Visual Studio.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25574 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-24 04:40:54 +00:00
Jeff Cohen
96f20d94f8 Visual Studio still has issues at being left out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25507 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-22 20:37:25 +00:00
Jeff Cohen
b4c4f09d76 Teach Visual Studio about new file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25097 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-04 17:19:48 +00:00
Jeff Cohen
0b4e244a05 Add new files to Visual Studio.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24929 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-22 01:50:11 +00:00
Jeff Cohen
6f0e680ca6 Turn on string pooling for smaller binaries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24749 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-17 00:14:47 +00:00
Jeff Cohen
00e1a70289 Keep Visual Studio up to date.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23964 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-24 15:21:58 +00:00
Jeff Cohen
a48283baa3 Fix VC++ build errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23431 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-25 19:04:43 +00:00
Jeff Cohen
c4dd1a4bbe Fix more Visual Studio build problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23308 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-10 02:33:17 +00:00
Jeff Cohen
373f9e7692 Add ElfWriter stuff to Visual Studio
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22304 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-28 02:43:03 +00:00