Commit Graph

2104 Commits

Author SHA1 Message Date
Devang Patel a1a6882519 Remove dead code.
llvm-svn: 47700
2008-02-27 23:33:51 +00:00
Devang Patel 5bc621c680 Add comment.
llvm-svn: 47653
2008-02-27 01:20:54 +00:00
Devang Patel f287e7dcc6 Add assert to check return type.
llvm-svn: 47637
2008-02-26 22:55:21 +00:00
Devang Patel a58b1c9b6b Remove unncessary ReturnInst constructors.
llvm-svn: 47633
2008-02-26 22:12:58 +00:00
Devang Patel a736c001b6 Use SmallVector while constructing ReturnInst.
llvm-svn: 47619
2008-02-26 19:38:17 +00:00
Devang Patel 060e79c729 Avoid const_casts
llvm-svn: 47616
2008-02-26 19:15:26 +00:00
Devang Patel 85e38bfb2e Remove unnecessary getOperand/setOperand overriders.
Simplify getReturnValue()

llvm-svn: 47614
2008-02-26 19:08:13 +00:00
Devang Patel c38eb52787 Unify to ReturnInst::init() member functions.
llvm-svn: 47611
2008-02-26 18:49:29 +00:00
Devang Patel ae682fb940 Optimize most common case by using single RetVal in ReturnInst.
llvm-svn: 47607
2008-02-26 17:56:20 +00:00
Devang Patel 767338ccec Pass const vectors by reference.
llvm-svn: 47577
2008-02-26 00:12:13 +00:00
Devang Patel d995551261 print getresult operand and its type directly.
llvm-svn: 47514
2008-02-23 01:04:26 +00:00
Devang Patel 2f2ff159a5 Use dyn_cast instead of isa + cast.
llvm-svn: 47511
2008-02-23 00:47:00 +00:00
Devang Patel 59643e575f To support multiple return values, now ret instruction supports multiple operands instead of one aggregate operand.
llvm-svn: 47508
2008-02-23 00:35:18 +00:00
Dale Johannesen 09f410b6d7 Split ParameterAttributes.h, putting the complicated
stuff into ParamAttrsList.h.  Per feedback from
ParamAttrs changes.

llvm-svn: 47504
2008-02-22 22:17:59 +00:00
Dale Johannesen eabc5f39af Pass alignment on ByVal parameters, from FE, all
the way through.  It is now used for codegen.

llvm-svn: 47484
2008-02-22 17:49:45 +00:00
Devang Patel e665095da1 Print getresult instruction properly.
llvm-svn: 47473
2008-02-22 03:10:23 +00:00
Devang Patel b5f5073a1a Print ret instruction that returns aggregates.
llvm-svn: 47472
2008-02-22 02:50:49 +00:00
Devang Patel 35519d51d6 print getresult instruction.
llvm-svn: 47461
2008-02-21 23:02:20 +00:00
Devang Patel 9fea019759 Use isa<> instead of getTypeID() to check StructType.
llvm-svn: 47460
2008-02-21 22:24:17 +00:00
Devang Patel ad582fc34b Let invoke return aggregate value.
llvm-svn: 47425
2008-02-21 02:14:01 +00:00
Devang Patel 1f00b535e1 Let function call return aggregate.
Now, we have very first multiple return value testcase!

llvm-svn: 47424
2008-02-21 01:54:02 +00:00
Devang Patel 616f0e02be What if functions can return aggregate values ?
One small step towards multiple return value support.

llvm-svn: 47406
2008-02-20 22:36:03 +00:00
Devang Patel cf193b8320 getresult does not support nested aggregates.
llvm-svn: 47396
2008-02-20 19:39:41 +00:00
Devang Patel 6b30fd310d Verifier should use Assert1 instead of assert.
llvm-svn: 47394
2008-02-20 19:32:20 +00:00
Devang Patel dcad9da0bc getresult type is the type of indexed aggregate element
llvm-svn: 47392
2008-02-20 19:26:55 +00:00
Devang Patel 666d45195a Specify GetResultInst index as an unsigned.
llvm-svn: 47390
2008-02-20 19:10:47 +00:00
Devang Patel 3ef1b793c1 Use isValidOperands() to verify GetResultInst.
llvm-svn: 47387
2008-02-20 18:36:46 +00:00
Anton Korobeynikov 18991d78fa Fix newly-introduced 4.3 warnings
llvm-svn: 47375
2008-02-20 12:07:57 +00:00
Anton Korobeynikov 579f07135a Unbreak build with gcc 4.3: provide missed includes and silence most annoying warnings.
llvm-svn: 47367
2008-02-20 11:08:44 +00:00
Dale Johannesen 11a555e94a Add Alignment field to ParameterAttributes and
treat more or less rationally in interface
functions, subject to change.  No functional change.

llvm-svn: 47352
2008-02-19 23:51:49 +00:00
Devang Patel 295711f583 Add GetResultInst. First step for multiple return value support.
llvm-svn: 47348
2008-02-19 22:15:16 +00:00
Dale Johannesen 89268bc6e2 Expand ParameterAttributes to 32 bits (in preparation
for adding alignment info, not there yet).  Clean up
interfaces to reference ParameterAttributes consistently.

llvm-svn: 47342
2008-02-19 21:38:47 +00:00
Chris Lattner b4c6cc9587 Fix some minor issues folding undef, PR2052
llvm-svn: 47314
2008-02-19 06:22:12 +00:00
Duncan Sands 85fab3a3ad Simplify caller updating using a CallSite, as
requested by Chris.  While there, do the same
for an existing function committed by someone
called "lattner" :)

llvm-svn: 47273
2008-02-18 17:32:13 +00:00
Owen Anderson a54570d2d2 I got the predicate backwards in my last patch. The comment is correct, the code was not.
llvm-svn: 47264
2008-02-18 09:22:21 +00:00
Owen Anderson c66655e14c Duncan pointed out that we can fast fail here, because the sret parameter of
a function must be the first parameter.

llvm-svn: 47254
2008-02-18 04:06:26 +00:00
Owen Anderson c64dfb4317 Add a predicate to Argument to check for the StructRet attribute.
llvm-svn: 47248
2008-02-17 23:22:28 +00:00
Duncan Sands 2efbc7f9e8 Some micro-optimizations.
llvm-svn: 47219
2008-02-16 20:53:06 +00:00
Chris Lattner 536ddedea3 targets that support quotes for mangled names still need to escape newlines
when they occur in the name, just like " is escaped.

llvm-svn: 47169
2008-02-15 18:54:56 +00:00
Chris Lattner 7f5c2553c7 check that terminators only occur at the end of a block. This catches the
common problem of putting two terminators in the same block.  I can't write
a testcase for this because the .ll parser rejects this before the verifier
can, but this can occur when generating IR.

llvm-svn: 46900
2008-02-09 01:06:01 +00:00
Dan Gohman b3efe03672 Fix a typo in a comment.
llvm-svn: 46836
2008-02-07 02:30:40 +00:00
Devang Patel 8df7cc1119 Add comment explaining what is lower level analysis pass.
llvm-svn: 46658
2008-02-02 01:43:30 +00:00
Gordon Henriksen 931e121ad1 Fixing a bug creating floating point constants of type other
than double through the C bindings. Thanks to Tomas Lindquist
Olsen for reporting it.

llvm-svn: 46656
2008-02-02 01:07:50 +00:00
Dan Gohman 929391a19a Fix 80-col violations.
llvm-svn: 46510
2008-01-29 12:09:55 +00:00
Dan Gohman 242223abd5 Add explicit keywords.
llvm-svn: 46506
2008-01-29 11:36:12 +00:00
Nick Lewycky 8ea81e8ba4 Handle some more combinations of extend and icmp. Fixes PR1940.
llvm-svn: 46431
2008-01-28 03:48:02 +00:00
Chris Lattner e30f09d0c5 Add hasByValAttr() and hasNoAliasAttr() methods to the Argument class.
llvm-svn: 46314
2008-01-24 17:47:11 +00:00
Duncan Sands 92a56b5499 It turns out that in C++ it is legal to declare functions
that return an opaque type by value, as long as you don't
call it or provide a body (you can take the address of it).
So it is wrong to insist that sret parameters not be an
opaque*.  And I guess it is really up to codegen to complain
if someone tries to call such a function.  I'm also removing
the analogous check from byval parameters, since I don't
see why we shouldn't allow them as long as no-one tries to
call the function or give it a body.

llvm-svn: 46216
2008-01-21 21:37:41 +00:00
Duncan Sands 262e54eb7b Check that sret is only used on pointers to types
with a size, like byval.

llvm-svn: 46207
2008-01-21 11:28:49 +00:00
Duncan Sands a59f396cba Be consistent with other attribute methods, and
check the callee also if it is known.

llvm-svn: 46206
2008-01-21 11:27:55 +00:00