Charles Davis
1084ac5bb1
Implement the rest of the SEH directive-parsing methods in the COFFAsmParser.
...
Add a size alignment check to the .seh_stackalloc directive parser. Add a
more descriptive error message to the .seh_handler directive parser.
Add methods to the TargetAsmInfo struct in support of all this.
llvm-svn: 131992
2011-05-24 20:06:30 +00:00
Devang Patel
0b44360610
Remove dead code.
...
llvm-svn: 131974
2011-05-24 18:27:52 +00:00
Charles Davis
3ac82d9bb2
Add a method to TargetRegisterInfo to get the register number that the Win64 EH
...
scheme uses internally. Implement it for x86 (the only architecture that LLVM
supports for which this matters right now).
llvm-svn: 131969
2011-05-24 16:57:53 +00:00
Cameron Zwarich
e425894eaf
Clean up the lazy initialization of DIBuilder a bit.
...
llvm-svn: 131956
2011-05-24 06:00:08 +00:00
Jakob Stoklund Olesen
222e83f44b
Work around code generation bug in Visual Studio 2010.
...
See http://llvm.org/pr9976 for details.
llvm-svn: 131954
2011-05-24 03:20:56 +00:00
Cameron Zwarich
462b5db500
Make LoadAndStorePromoter preserve debug info and create llvm.dbg.values when
...
promoting allocas to SSA variables. Fixes <rdar://problem/9479036>.
llvm-svn: 131953
2011-05-24 03:10:43 +00:00
Chris Lattner
5fd8380a35
add a helper method to get the byval alignment of an argument.
...
llvm-svn: 131883
2011-05-22 23:57:23 +00:00
Charles Davis
a4187a96c9
Add methods to parse the SEH directives to the COFFAsmParser. Implement some
...
of them, particularly the ones that don't take arguments. Also implement
.seh_proc and .seh_handler.
llvm-svn: 131866
2011-05-22 21:12:15 +00:00
Frits van Bommel
df58ece78a
Add a parameter to ConstantFoldTerminator() that callers can use to ask it to also clean up the condition of any conditional terminator it folds to be unconditional, if that turns the condition into dead code. This just means it calls RecursivelyDeleteTriviallyDeadInstructions() in strategic spots. It defaults to the old behavior.
...
I also changed -simplifycfg, -jump-threading and -codegenprepare to use this to produce slightly better code without any extra cleanup passes (AFAICT this was the only place in -simplifycfg where now-dead conditions of replaced terminators weren't being cleaned up). The only other user of this function is -sccp, but I didn't read that thoroughly enough to figure out whether it might be holding pointers to instructions that could be deleted by this.
llvm-svn: 131855
2011-05-22 16:24:18 +00:00
Chris Lattner
b2b8de15d8
another typo
...
llvm-svn: 131854
2011-05-22 15:44:02 +00:00
Chris Lattner
ddafd147a2
fix comment typo
...
llvm-svn: 131853
2011-05-22 15:34:37 +00:00
Chris Lattner
1520c4f4f0
Fix some minor typos and grammar.
...
llvm-svn: 131835
2011-05-22 04:44:48 +00:00
Charles Davis
d74119d139
Implement emission of all Win64 exception tables. Make the COFF streamer emit
...
these tables.
llvm-svn: 131833
2011-05-22 04:15:07 +00:00
Charles Davis
c23700bb65
Make the COFF streamer emit unwind info when processing a .seh_handlerdata
...
directive.
Implement emission of Win64 EH unwind info.
Pull in <cassert> in MCWin64EH.h so it can use the assert() macro.
llvm-svn: 131832
2011-05-22 03:01:05 +00:00
Chris Lattner
69a52dd280
random comment cleanups.
...
llvm-svn: 131829
2011-05-22 00:50:53 +00:00
Chris Lattner
03d83a7b9b
remove StandardPasses, it has been replaced with PassManagerBuilder
...
llvm-svn: 131827
2011-05-22 00:30:45 +00:00
Chris Lattner
6e81571c48
add support for LTO passes.
...
llvm-svn: 131820
2011-05-22 00:14:20 +00:00
Charles Davis
49f650f80b
Include DataTypes.h from this header to get the uint*_t types.
...
llvm-svn: 131817
2011-05-22 00:05:26 +00:00
Charles Davis
53b696daee
Allow access to the .pdata and .xdata sections through the TargetAsmInfo
...
class.
llvm-svn: 131816
2011-05-22 00:03:24 +00:00
Chris Lattner
03847f8199
add an extension point mechanism that allow plugins to add stuff to
...
the pass manager.
llvm-svn: 131814
2011-05-21 23:50:37 +00:00
Nick Lewycky
0539f44b9f
Add CreateLifetimeStart and CreateLifetimeEnd to the IRBuilder, with plans to
...
use these soon.
llvm-svn: 131812
2011-05-21 23:14:36 +00:00
Chris Lattner
d2e2d612c0
add a new PassManagerBuilder class to replace StandardPasses.h
...
llvm-svn: 131807
2011-05-21 20:39:42 +00:00
Chris Lattner
777808dcaf
add a copy ctor to TargetLibraryInfo.
...
llvm-svn: 131806
2011-05-21 20:09:13 +00:00
Eli Friedman
58beee1262
PR7952: Make isa<> use the same logic as cast<>, so that they both work
...
consistently.
llvm-svn: 131803
2011-05-21 19:13:10 +00:00
Charles Davis
7f9c007dce
A handler for a function in the Win64 EH scheme can be both an unwind handler
...
and an exception handler. Handle that case.
Also, add an 'Emitted' member to the MCWin64EHUnwindInfo struct. It will be
needed later.
llvm-svn: 131791
2011-05-21 15:57:49 +00:00
Andrew Trick
9f867fd2dc
Have Program::Wait return -2 for crashed and timeouts instead of embedding
...
info in the error message. Per Dan's request.
llvm-svn: 131780
2011-05-21 00:56:46 +00:00
Charles Davis
989cc73ef3
Add .pdata and .xdata sections to the COFF TLOF implementation.
...
llvm-svn: 131763
2011-05-20 22:13:55 +00:00
Argyrios Kyrtzidis
d58ffb7e7d
Add asserts in StringRef to make sure we avoid undefined behavior:
...
-strlen should not be called with NULL. Also guarantee that StringRef's Length is 0 if Data is NULL.
-memcmp should not be called with NULL (even if size is 0)
Patch by Matthieu Monrocq!
llvm-svn: 131747
2011-05-20 19:24:12 +00:00
Andrew Trick
3352db291f
indvars: Prototyping Sign/ZeroExtend elimination without canonical IVs.
...
No functionality enabled by default. Use -disable-iv-rewrite.
Extended IVUsers to keep track of the phi that represents the users' IV.
Added the WidenIV transform to replace a narrow IV with a wide IV
by doing a one-for-one replacement of IV users instead of expanding the
SCEV expressions. [sz]exts are removed and truncs are inserted.
llvm-svn: 131744
2011-05-20 18:25:42 +00:00
Benjamin Kramer
63248bc95b
Remove noisy semicolons.
...
llvm-svn: 131724
2011-05-20 09:20:25 +00:00
Rafael Espindola
c03bb178a0
Misc code refactorings:
...
* Remove unnecessary arguments now that ForceExpAbs is a method.
* Use ForceExpAbs in EmitAbsValue.
llvm-svn: 131683
2011-05-19 21:40:34 +00:00
Charles Davis
300a470f45
Implement the EndProlog Win64 EH method on the base MCStreamer.
...
llvm-svn: 131679
2011-05-19 21:24:54 +00:00
Charles Davis
925eab3fd7
Implement the Win64 EH prolog instruction methods on the base MCStreamer.
...
I had to change the API slightly to avoid overloading issues.
llvm-svn: 131666
2011-05-19 19:35:55 +00:00
Eli Friedman
1cbb521f21
Fix up the new StandardPasses to run the same scalarrepl passes as the old one.
...
llvm-svn: 131665
2011-05-19 19:14:54 +00:00
Joerg Sonnenberger
5efd18ca60
Reapply 131644 including the missing header changes:
...
Introduce -fatal-assembler-warnings for the obvious purpose
llvm-svn: 131655
2011-05-19 18:00:13 +00:00
Charles Davis
bb99a68546
Turns out GAS does have Win64 EH directives. (It also supports WinCE EH.) Make
...
ours compatible with GAS.
In retrospect, I should have emailed binutils about this earlier. Thanks to
Kai Tietz for pointing out that GAS already had SEH directives.
llvm-svn: 131652
2011-05-19 17:46:39 +00:00
Charles Davis
e6942fd10b
Implement the StartChained and EndChained Win64 EH methods on MCStreamer.
...
llvm-svn: 131629
2011-05-19 04:04:13 +00:00
Francois Pichet
8c22442446
Fix the MSVC build.
...
Use a set of overloaded functions instead of template function for CreatePassFn.
It seems that template deduction for functions type that differs only by return type doesn't work with MSVC.
llvm-svn: 131624
2011-05-19 02:54:11 +00:00
Charles Davis
2940df3099
Implement the StartProc and EndProc Win64 EH methods on the base MCStreamer.
...
Based largely on Rafael Espindola's work on CFI. Other methods soon to follow.
llvm-svn: 131623
2011-05-19 02:49:00 +00:00
Charles Davis
ce8694c82b
Fix build issues with headers, which I discovered by actually using them.
...
Also, convert all the inline functions on UnwindInfo into methods.
llvm-svn: 131622
2011-05-19 02:47:23 +00:00
Charles Davis
3322d4dee8
Add a header patterned after MCDwarf.h for supporting Win64 exception handling
...
under MC.
llvm-svn: 131593
2011-05-18 22:48:24 +00:00
David Chisnall
ef3c74e551
Some better type safety enforcement in the standard pass list, along with some small tidies and some fixes for bugs that the stricter checking found.
...
llvm-svn: 131592
2011-05-18 22:46:02 +00:00
Eli Friedman
e1ee02ff3d
Third pass at allowing plugins to modify default passes. This time with a tweak so that we don't depend on an uninitialized argument.
...
llvm-svn: 131581
2011-05-18 21:40:04 +00:00
Devang Patel
f1e313af0f
Set debug location while setting insertion point.
...
llvm-svn: 131575
2011-05-18 20:58:47 +00:00
Charles Davis
48ea9389dc
Add some more Win64 EH directives:
...
- StartChained and EndChained delimit a chained unwind area, which can contain
additional operations to be undone if an exception occurs inside of it.
- UnwindOnly declares that this function doesn't handle any exceptions. If it
has a handler, it's an unwind handler instead of an exception handler.
- Lsda declares the location and size of the LSDA, which in the Win64 EH
scheme is kept inside the UNWIND_INFO struct. Windows itself ignores the
LSDA; it's used by the Language-Specific Handler (the "Personality Function"
from DWARF).
llvm-svn: 131572
2011-05-18 20:54:10 +00:00
Eli Friedman
530e34b4af
Revert r131556; it's breaking buildbots/clang tests.
...
llvm-svn: 131567
2011-05-18 20:39:27 +00:00
David Chisnall
b2d7afdada
Second pass at allowing plugins to modify default passes. This time without bonus inter-library dependencies.
...
llvm-svn: 131556
2011-05-18 19:00:41 +00:00
Duncan Sands
d3292b9f1e
Revert commit 131534 since it seems to have broken several buildbots.
...
Original log entry:
Refactor getActionType and getTypeToTransformTo ; place all of the 'decision'
code in one place.
llvm-svn: 131536
2011-05-18 14:57:56 +00:00
Nadav Rotem
b7d689c706
Refactor getActionType and getTypeToTransformTo ; place all of the 'decision'
...
code in one place.
llvm-svn: 131534
2011-05-18 12:26:38 +00:00
Charles Davis
81fa5ec5c3
While thinking about how to know where the functions' boundaries are for
...
the purposes of the Win64 EH tables, I realized we had no way to tell where
the function ends. (MASM bounds functions with PROC and ENDP keywords.)
Add a directive to delimit the end of the function, and rename the 'frame'
directive to more accurately reflect its duality with the new directive.
llvm-svn: 131522
2011-05-18 04:47:22 +00:00