Devang Patel
066973767f
Print getresult instruction properly.
...
llvm-svn: 47473
2008-02-22 03:10:23 +00:00
Devang Patel
2754d59c53
Print ret instruction that returns aggregates.
...
llvm-svn: 47472
2008-02-22 02:50:49 +00:00
Devang Patel
c5dccfdd74
print getresult instruction.
...
llvm-svn: 47461
2008-02-21 23:02:20 +00:00
Devang Patel
298b5f1d6c
Use isa<> instead of getTypeID() to check StructType.
...
llvm-svn: 47460
2008-02-21 22:24:17 +00:00
Devang Patel
e60ebc7744
Let invoke return aggregate value.
...
llvm-svn: 47425
2008-02-21 02:14:01 +00:00
Devang Patel
702c4a60a6
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
d2142aeb44
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
4034343b67
getresult does not support nested aggregates.
...
llvm-svn: 47396
2008-02-20 19:39:41 +00:00
Devang Patel
f114189912
Verifier should use Assert1 instead of assert.
...
llvm-svn: 47394
2008-02-20 19:32:20 +00:00
Devang Patel
de35f122f2
getresult type is the type of indexed aggregate element
...
llvm-svn: 47392
2008-02-20 19:26:55 +00:00
Devang Patel
6266d7147e
Specify GetResultInst index as an unsigned.
...
llvm-svn: 47390
2008-02-20 19:10:47 +00:00
Devang Patel
019b5585e8
Use isValidOperands() to verify GetResultInst.
...
llvm-svn: 47387
2008-02-20 18:36:46 +00:00
Anton Korobeynikov
c41f5b6af4
Fix newly-introduced 4.3 warnings
...
llvm-svn: 47375
2008-02-20 12:07:57 +00:00
Anton Korobeynikov
0c5e186924
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
7eccf11cfb
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
a74d2cbb6f
Add GetResultInst. First step for multiple return value support.
...
llvm-svn: 47348
2008-02-19 22:15:16 +00:00
Dale Johannesen
ecb2b233b1
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
85482657eb
Fix some minor issues folding undef, PR2052
...
llvm-svn: 47314
2008-02-19 06:22:12 +00:00
Duncan Sands
a85448506d
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
e4e1706f95
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
18a7d290cb
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
48dd6a0f96
Add a predicate to Argument to check for the StructRet attribute.
...
llvm-svn: 47248
2008-02-17 23:22:28 +00:00
Duncan Sands
753597d1cf
Some micro-optimizations.
...
llvm-svn: 47219
2008-02-16 20:53:06 +00:00
Chris Lattner
bab03a1b50
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
22696c10f0
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
b4aa0b2a15
Fix a typo in a comment.
...
llvm-svn: 46836
2008-02-07 02:30:40 +00:00
Devang Patel
cad20dbdb0
Add comment explaining what is lower level analysis pass.
...
llvm-svn: 46658
2008-02-02 01:43:30 +00:00
Gordon Henriksen
b75d9e974d
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
241714222a
Fix 80-col violations.
...
llvm-svn: 46510
2008-01-29 12:09:55 +00:00
Dan Gohman
522401f26e
Add explicit keywords.
...
llvm-svn: 46506
2008-01-29 11:36:12 +00:00
Nick Lewycky
6b070b1b93
Handle some more combinations of extend and icmp. Fixes PR1940.
...
llvm-svn: 46431
2008-01-28 03:48:02 +00:00
Chris Lattner
5740a10d2c
Add hasByValAttr() and hasNoAliasAttr() methods to the Argument class.
...
llvm-svn: 46314
2008-01-24 17:47:11 +00:00
Duncan Sands
fe83650649
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
50df31d59a
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
26de25066c
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
Chris Lattner
2595fd0ca7
improve compatibility with mingw, patch by Alain Frisch
...
llvm-svn: 46026
2008-01-15 22:50:50 +00:00
Bill Wendling
0ad07f292c
Reformatted. It was confusing the other way. No functionality change.
...
llvm-svn: 46009
2008-01-15 21:16:32 +00:00
Duncan Sands
087d6020ee
Simplify CallInst::hasByValArgument using a new method.
...
llvm-svn: 45974
2008-01-14 19:57:00 +00:00
Duncan Sands
81e35b4d47
I noticed that the trampoline straightening transformation could
...
drop attributes on varargs call arguments. Also, it could generate
invalid IR if the transformed call already had the 'nest' attribute
somewhere (this can never happen for code coming from llvm-gcc,
but it's a theoretical possibility). Fix both problems.
llvm-svn: 45973
2008-01-14 19:52:09 +00:00
Evan Cheng
12fb1dc67e
Simplify code.
...
llvm-svn: 45950
2008-01-14 02:38:45 +00:00
Duncan Sands
86c17f2ebf
Allow the byval attribute for pointers to any type with
...
a size, not just structs.
llvm-svn: 45938
2008-01-13 21:19:12 +00:00
Evan Cheng
a5183224b0
Add hasByValArgument() to test if a call instruction has byval argument(s).
...
llvm-svn: 45913
2008-01-12 18:57:32 +00:00
Duncan Sands
3b617cbe30
Be more liberal in what parameter attributes are
...
allowed on the vararg arguments of a call.
llvm-svn: 45909
2008-01-12 16:42:01 +00:00
Duncan Sands
e55a5806ac
Do not allow attributes beyond a function's last
...
parameter, even if it is a varargs function. Do
allow attributes on the varargs part of a call,
but not beyond the last argument. Only allow
selected attributes to be on the varargs part of
a call (currently only 'byval' is allowed). The
reasoning here is that most attributes, eg inreg,
simply make no sense here.
llvm-svn: 45887
2008-01-11 22:36:48 +00:00
Evan Cheng
63753b7be7
Allow parameter attributes on varargs function parameters.
...
llvm-svn: 45850
2008-01-11 02:13:09 +00:00
Duncan Sands
7955cf0cd7
Small cleanup for handling of type/parameter attribute
...
incompatibility.
llvm-svn: 45704
2008-01-07 17:16:06 +00:00
Duncan Sands
fd975e4b3d
The transform that tries to turn calls to bitcast functions into
...
direct calls bails out unless caller and callee have essentially
equivalent parameter attributes. This is illogical - the callee's
attributes should be of no relevance here. Rework the logic, which
incidentally fixes a crash when removed arguments have attributes.
llvm-svn: 45658
2008-01-06 18:27:01 +00:00
Duncan Sands
b8489f09a2
When transforming a call to a bitcast function into
...
a direct call with cast parameters and cast return
value (if any), instcombine was prepared to cast any
non-void return value into any other, whether castable
or not. Add a new predicate for testing whether casting
is valid, and check it both for the return value and
(as a cleanup) for the parameters.
llvm-svn: 45657
2008-01-06 10:12:28 +00:00
Gordon Henriksen
8e4ae9a345
Trying that again.
...
llvm-svn: 45529
2008-01-03 03:32:33 +00:00
Gordon Henriksen
b28803a63f
Fix a compile error on Windows.
...
llvm-svn: 45528
2008-01-03 03:21:18 +00:00