Eli Friedman
c08711e840
Minor simplification.
...
llvm-svn: 68992
2009-04-13 21:41:57 +00:00
Daniel Dunbar
f77e292a0f
Fix a subtle bug where the cleanup scope entries had a dangling block reference
...
- <rdar://problem/6732143> Crash when generating @synchronize for
zero-cost exception
- Thanks to Anders for helping track down the problem.
llvm-svn: 68186
2009-04-01 04:37:47 +00:00
Chris Lattner
cda4d7e196
introduce a new -fheinous-gnu-extensions flag that enables really
...
really horrible extensions that are disabled by default but that can
be accepted by -fheinous-gnu-extensions (but which always emit a
warning when enabled).
As our first instance of this, implement PR3788/PR3794, which allows
non-lvalues in inline asms in contexts where lvalues are required. bleh.
llvm-svn: 66910
2009-03-13 17:38:01 +00:00
Chris Lattner
d8c7ba278e
add plumbing to report diagnostics back through sema for malformed asmstrings.
...
llvm-svn: 66598
2009-03-10 23:41:04 +00:00
Chris Lattner
35b5836147
move the asm string analysis code out of codegen into common
...
code where Sema can get to it. No functionality change.
llvm-svn: 66596
2009-03-10 23:21:44 +00:00
Chris Lattner
f85a938985
Fix PR3682 by just disabling a broken assertion. This check should be
...
done in sema, and is reflected by the existing PR3258. In the meantime,
fix PR3682 by disabling a bogus assertion (which doesn't account for +
operands).
llvm-svn: 66533
2009-03-10 06:42:37 +00:00
Chris Lattner
6dd0f9263d
reduce duplication of parsing code between %0 and %x0 and
...
add support for modifiers on named references, like %c[foo].
llvm-svn: 66532
2009-03-10 06:38:02 +00:00
Chris Lattner
d7d5fdf090
move matching of named operands into AsmStmt class. At the same
...
time handle + operands in operand counting, fixing asm.c:t7 to
expand into $2 instead of $1.
llvm-svn: 66531
2009-03-10 06:33:24 +00:00
Chris Lattner
80337892f4
reduce nesting, use memchr instead of explicit loop, eliminate a
...
temporary std::string to fix a fixme.
llvm-svn: 66530
2009-03-10 06:11:34 +00:00
Chris Lattner
2d43eaefa2
Expand %= into ${:uid} so that the code generator emits a unique ID for the
...
asm. This allows us to properly handle the case when an optimizer duplicates
the asm, such as here:
void bar() {
int i;
for (i = 0; i < 3; ++i)
asm("foo %=" : : "r"(0));
}
we now produce:
_bar:
xorl %eax, %eax
## InlineAsm Start
foo 0
## InlineAsm End
## InlineAsm Start
foo 1
## InlineAsm End
## InlineAsm Start
foo 2
## InlineAsm End
ret
instead of:
_bar:
xorl %eax, %eax
## InlineAsm Start
foo 1
## InlineAsm End
## InlineAsm Start
foo 1
## InlineAsm End
## InlineAsm Start
foo 1
## InlineAsm End
ret
This also fixes a fixme by eliminating a static.
llvm-svn: 66528
2009-03-10 05:39:21 +00:00
Chris Lattner
72bbf17340
add some helper methods to AsmStmt and add some comments.
...
llvm-svn: 66521
2009-03-10 04:59:06 +00:00
Chris Lattner
57e673772e
slightly simplify some code, pull the 'is simple asm' case up in
...
ConvertAsmString and shrink it a bit. No functionality change.
llvm-svn: 66520
2009-03-10 04:38:46 +00:00
Chris Lattner
ff9fbcaa8a
if we die in IR generation of a compound statement, include
...
it in the stack trace, giving us stuff like:
Stack dump:
0. Program arguments: clang t.c -emit-llvm
1. <eof> parser at end of file
2. t.c:1:5: LLVM IR generation of declaration 'a'
3. t.c:1:9: LLVM IR generation of compound statement ('{}')
4. t.c:2:3: LLVM IR generation of compound statement ('{}')
Abort
llvm-svn: 66154
2009-03-05 08:04:57 +00:00
Chris Lattner
4192bce91b
add a special case for codegen that improves the case where we have
...
multiple sequential cases to a) not create tons of fall-through basic blocks
and b) not recurse deeply. This fixes codegen on 100K deep cases, and improves
codegen on moderate cases from this:
switch i32 %tmp, label %sw.epilog [
i32 1000, label %sw.bb
i32 1001, label %sw.bb1
i32 1002, label %sw.bb2
i32 1003, label %sw.bb3
i32 1004, label %sw.bb4
...
sw.bb: ; preds = %entry
br label %sw.bb1
sw.bb1: ; preds = %entry, %sw.bb
br label %sw.bb2
sw.bb2: ; preds = %entry, %sw.bb1
br label %sw.bb3
sw.bb3: ; preds = %entry, %sw.bb2
br label %sw.bb4
to:
switch i32 %tmp, label %sw.epilog [
i32 1000, label %sw.bb
i32 1001, label %sw.bb
i32 1002, label %sw.bb
i32 1003, label %sw.bb
i32 1004, label %sw.bb
sw.bb: ;; many preds
llvm-svn: 66015
2009-03-04 04:46:18 +00:00
Anders Carlsson
b3b675c35e
inline asm calls should be nounwind. Chris, please review.
...
llvm-svn: 65866
2009-03-02 19:58:15 +00:00
Anders Carlsson
e14282e274
Make sure to reset the DidCallStackSave variable before emitting a compound statement. Fixes PR3649.
...
llvm-svn: 65291
2009-02-22 18:44:21 +00:00
Anders Carlsson
63784f4e5e
Add CodeGen support for the nodebug attribute.
...
llvm-svn: 64445
2009-02-13 08:11:52 +00:00
Anders Carlsson
7ccf3e4e28
Handle the case where EmitBlock might be called multiple times for the same block. Fixes PR3536.
...
llvm-svn: 64252
2009-02-10 22:50:24 +00:00
Anders Carlsson
33c1b6528f
Remove the last remnants of the Obj-C EH stack code.
...
llvm-svn: 64205
2009-02-10 06:07:49 +00:00
Anders Carlsson
33747b6c41
Start removing the old Obj-C EH stack now that the cleanup stack is used instead.
...
llvm-svn: 64203
2009-02-10 05:52:02 +00:00
Anders Carlsson
1ac6282c5b
Replace a bunch of EmitBranch calls with EmitBranchThroughCleanup. No functionality change (yet).
...
llvm-svn: 64159
2009-02-09 20:31:03 +00:00
Anders Carlsson
ff0bb6ce62
Save and restore the DidCallStackSave variable
...
llvm-svn: 64157
2009-02-09 20:23:40 +00:00
Mike Stump
a6dbd7b25a
When we're at the stack depth we want, there isn't anything to do.
...
llvm-svn: 64095
2009-02-08 22:00:53 +00:00
Mike Stump
284d177c7f
Wire up break and continue processing to the new stack depth adjuster.
...
If people could beat on it and let me know if there are any new
semantics required by newer language standards or DRs or any little
details I goofed on, I'd be happy to fix any issues found.
llvm-svn: 64079
2009-02-08 09:22:19 +00:00
Anders Carlsson
fbfb5e6530
When emitting blocks, keep track of which cleanup scope they have. Minor fixes and cleanup.
...
llvm-svn: 64053
2009-02-08 00:16:35 +00:00
Anders Carlsson
be0f76a712
Add support for emitting cleanup blocks. Make EmitCompoundStatement emit cleanup blocks if necessary
...
llvm-svn: 64051
2009-02-07 23:50:39 +00:00
Mike Stump
0509d9635b
Ensure we track all the stack depths for all break and continue points
...
correctly. This should lay the ground work to throw the big switch
and start code gening break and continue in the presense of vlas.
llvm-svn: 64046
2009-02-07 23:02:10 +00:00
Mike Stump
56d2a15829
Format for 80-cols.
...
llvm-svn: 64030
2009-02-07 20:14:12 +00:00
Mike Stump
dc0d6be7b9
Arrange to have the correct StackDepth for while statements.
...
llvm-svn: 64021
2009-02-07 18:08:12 +00:00
Mike Stump
1f8be1b9ac
Fit into 80-col.
...
llvm-svn: 64020
2009-02-07 17:18:33 +00:00
Mike Stump
1d91dd98ad
Fixup goto codegen in and around VLAs.
...
llvm-svn: 64014
2009-02-07 12:52:26 +00:00
Anders Carlsson
570c357ded
If an input constraint refers to an output constraint, it should have the same constraint info as the output constraint. Fixes PR3417
...
llvm-svn: 63127
2009-01-27 20:38:24 +00:00
Chris Lattner
66c6562e24
silence a couple unused variable 'result' warnings.
...
llvm-svn: 62674
2009-01-21 07:35:26 +00:00
Anders Carlsson
a92271d067
CG support for inline asm constraints with symbolic names. Fixes PR3345
...
llvm-svn: 62444
2009-01-18 02:06:20 +00:00
Anders Carlsson
a79203be85
Add sema support for symbolic names in inline asm statements.
...
llvm-svn: 62441
2009-01-18 01:56:57 +00:00
Anders Carlsson
19aa04d270
Change TargetInfo::validateInputConstraint to take begin/end name iterators instead of the number of outputs. No functionality change.
...
llvm-svn: 62433
2009-01-17 23:36:15 +00:00
Anders Carlsson
00057e4e09
Handle multi-value inputs
...
llvm-svn: 62069
2009-01-12 02:22:13 +00:00
Anders Carlsson
431acd1129
More inline asm fixes
...
llvm-svn: 62049
2009-01-11 21:23:27 +00:00
Anders Carlsson
a948c34b0b
Handle readwrite constraints correctly
...
llvm-svn: 62043
2009-01-11 19:46:50 +00:00
Anders Carlsson
da5f56939b
Use a common function for emitting asm inputs and remove a FIXME
...
llvm-svn: 62041
2009-01-11 19:32:54 +00:00
Eli Friedman
dea4193e8a
Fix for PR3246: an empty clobber list is the empty string, not a null
...
string.
That said, we should probably try and track down the correct clobber
lists for the targets that don't have them (PPC, ARM, and Sparc),
so that we can generate correct code.
llvm-svn: 61298
2008-12-21 01:15:32 +00:00
Eli Friedman
5ad3c91b27
Extend the unsupported error to include break and continue, and fix a
...
warning by using an unsigned index.
llvm-svn: 61292
2008-12-20 23:18:29 +00:00
Anders Carlsson
fbef9c208f
Check the entire StackSaveValues stack for VLAs when dealing with goto and return statements. Noticed by Eli Friedman.
...
llvm-svn: 61289
2008-12-20 21:33:38 +00:00
Anders Carlsson
6200f0c533
Add some ErrorUnsupported calls and turn on VLA codegen again.
...
llvm-svn: 61283
2008-12-20 19:33:21 +00:00
Anders Carlsson
6b958f9634
Store the size of the EH stack inside each BreakContinue struct so we know when a break/continue won't cross a try block.
...
llvm-svn: 60998
2008-12-13 22:52:24 +00:00
Anders Carlsson
8a472c3151
Work in preparation for VLAs. Make sure to restore the stack if necessary (Saving the stack isn't implemented right now :)
...
llvm-svn: 60925
2008-12-12 05:52:00 +00:00
Anders Carlsson
59689ed764
Use Expr::Evaluate for case statements. Fixes PR2525
...
llvm-svn: 59881
2008-11-22 21:04:56 +00:00
Chris Lattner
e132e2432a
Start implementing support for @synchonized with the darwin ObjC API.
...
Patch by Fariborz!
llvm-svn: 59377
2008-11-15 21:26:17 +00:00
Daniel Dunbar
df21c6e203
Supply finished flag to EmitBlock for common statements which use
...
landing pads.
- Primarily a cleanliness issue instead of a performance issue (this
eliminates all blocks w/o predecessors on 176.gcc/expr.c), but this
also allows subsequent code to recognize it is unreachable and
potentially avoid IRgen.
llvm-svn: 59211
2008-11-13 01:54:24 +00:00
Daniel Dunbar
a612e79be4
Normalize many BasicBlock names.
...
- Use dotted notation for blocks related to a particular statement
type.
- Use .end for landing pads.
No functionality change in NDEBUG mode. :)
llvm-svn: 59210
2008-11-13 01:38:36 +00:00