Chris Lattner
3517f14219
PR10337 reminds me that calls return values, lets handle them just
...
like arguments. Thanks PR10337! :)
llvm-svn: 135030
2011-07-13 03:59:32 +00:00
Chris Lattner
d59d867ca5
insert a bitcast in the 'expand' case of argument passing when needed. This
...
fixes the -m32 build of oggenc.
llvm-svn: 134971
2011-07-12 06:29:11 +00:00
Chris Lattner
3ce8668273
fix PR10335 by watching out for IR type compatibility in call argument lists.
...
llvm-svn: 134966
2011-07-12 04:53:39 +00:00
Chris Lattner
bb1952cfda
add some aggressive assertions that call arguments match up to callee
...
expectations in EmitCall. Next patch will take this further.
llvm-svn: 134962
2011-07-12 04:46:18 +00:00
Chris Lattner
35bd5be2a2
how about we initialize RecursionState.
...
llvm-svn: 134855
2011-07-10 01:10:18 +00:00
Chris Lattner
8806e32f16
Rename CGT::VerifyFuncTypeComplete to isFuncTypeConvertible since
...
it is a predicate, not an action. Change the return type to be a bool,
not the incomplete member. Enhace it to detect the recursive compilation
case, allowing us to compile Eli's testcase on llvmdev:
struct T {
struct T (*p)(void);
} t;
into:
%struct.T = type { {}* }
@t = common global %struct.T zeroinitializer, align 8
llvm-svn: 134853
2011-07-10 00:18:59 +00:00
Chris Lattner
a5f58b05e8
clang side to match the LLVM IR type system rewrite patch.
...
llvm-svn: 134831
2011-07-09 17:41:47 +00:00
John McCall
55e1fbc848
LValue carries a type now, so simplify the main EmitLoad/Store APIs
...
by removing the redundant type parameter.
llvm-svn: 133860
2011-06-25 02:11:03 +00:00
John McCall
31168b077c
Automatic Reference Counting.
...
Language-design credit goes to a lot of people, but I particularly want
to single out Blaine Garst and Patrick Beard for their contributions.
Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself,
in no particular order.
llvm-svn: 133103
2011-06-15 23:02:42 +00:00
Eli Friedman
f7456194a3
Per Chris's suggestion, simplify code using llvm::getOrEnforceKnownAlignment.
...
llvm-svn: 133095
2011-06-15 22:09:18 +00:00
Eli Friedman
7e68c88bf7
Fix a regression from r132957 involving complex integers. (Fixes failures on gcc-testsuite bot.)
...
llvm-svn: 133069
2011-06-15 18:26:32 +00:00
Eli Friedman
eb7fab61bd
The LLVM IR representation of byval arguments has a rather strange property: if the alignment of an argument to a call is less than the specified byval alignment for that argument, there is no way to specify the alignment of the implied copy. Therefore, we must ensure that the alignment of the argument is at least the byval alignment. To do this, we have to mess with the alignment of relevant alloca's in some cases, and insert a copy that conceptually shouldn't be necessary in some cases.
...
This patch tries relatively hard to avoid creating an extra copy if it can be avoided (see test3 in the included testcase), but it is not possible to avoid in some cases (like test2 in the included testcase).
rdar://9483886
llvm-svn: 132957
2011-06-14 01:37:52 +00:00
Eli Friedman
df96819daf
Skip extra copy from aggregate where it isn't necessary; rdar://problem/8139919 . This shouldn't make much of a difference at -O3, but should substantially reduce the number of generated memcpy's at -O0.
...
Originally r130717, but was backed out due to an ObjC regression.
llvm-svn: 132102
2011-05-26 00:10:27 +00:00
Douglas Gregor
6ab2fa8f78
Introduce Type::isSignedIntegerOrEnumerationType() and
...
Type::isUnsignedIntegerOrEnumerationType(), which are like
Type::isSignedIntegerType() and Type::isUnsignedIntegerType() but also
consider the underlying type of a C++0x scoped enumeration type.
Audited all callers to the existing functions, switching those that
need to also handle scoped enumeration types (e.g., those that deal
with constant values) over to the new functions. Fixes PR9923 /
<rdar://problem/9447851>.
llvm-svn: 131735
2011-05-20 16:38:50 +00:00
Eli Friedman
af9b325d23
For calls returning first-class aggregates, store by element instead of creating aggregate stores in common cases. This is more friendly to fast-isel.
...
llvm-svn: 131490
2011-05-17 21:08:01 +00:00
John McCall
85dd2c5039
More killing of std::vector.
...
llvm-svn: 131374
2011-05-15 02:19:42 +00:00
Douglas Gregor
9ca5465500
Revert r130717, which caused a regression (<rdar://problem/9402621>).
...
llvm-svn: 131057
2011-05-07 20:12:26 +00:00
Eli Friedman
30458b51e3
Skip extra copy from aggregate where it isn't necessary; rdar://problem/8139919 . This shouldn't make much of a difference at -O3, but should substantially reduce the number of generated memcpy's at -O0.
...
llvm-svn: 130717
2011-05-02 20:24:29 +00:00
Eli Friedman
f4258eb484
Switch CallArgList from an std::pair to a new CallArg struct (which will eventually gain more members). Working towards modifying call emission to avoid unnecessary copies.
...
llvm-svn: 130700
2011-05-02 18:05:27 +00:00
Anton Korobeynikov
231e875b5c
Implement ARM pcs attribute. Basically it's another way of calling convention selection (AAPCS or
...
AAPCS+VFP), similar to fastcall / stdcall / whatevercall seen on x86.
In particular, all library functions should always be AAPCS regardless of floating point ABI used.
llvm-svn: 129534
2011-04-14 20:06:49 +00:00
Eli Friedman
c5b20b5283
PR8369: make __attribute((regparm(0))) work correctly. Original patch by
...
pageexec@freemail.hu , tweaks by me.
llvm-svn: 129206
2011-04-09 08:18:08 +00:00
Peter Collingbourne
599cb8e430
Add support for language-specific address spaces. On top of that,
...
add support for the OpenCL __private, __local, __constant and
__global address spaces, as well as the __read_only, _read_write and
__write_only image access specifiers. Patch originally by ARM;
language-specific address space support by myself.
llvm-svn: 127915
2011-03-18 22:38:29 +00:00
Sebastian Redl
31ad754c96
Instead of storing an ASTContext* in FunctionProtoTypes with computed noexcept specifiers, unique FunctionProtoTypes with a ContextualFoldingSet, as suggested by John McCall.
...
llvm-svn: 127568
2011-03-13 17:09:40 +00:00
Sebastian Redl
fa453cfdc3
Propagate the new exception information to FunctionProtoType.
...
Change the interface to expose the new information and deal with the enormous fallout.
Introduce the new ExceptionSpecificationType value EST_DynamicNone to more easily deal with empty throw specifications.
Update the tests for noexcept and fix the various bugs uncovered, such as lack of tentative parsing support.
llvm-svn: 127537
2011-03-12 11:50:43 +00:00
John McCall
32ea969415
Use a slightly more semantic interface for emitting call arguments.
...
llvm-svn: 127494
2011-03-11 20:59:21 +00:00
NAKAMURA Takumi
dd63436808
lib/CodeGen/CGCall.cpp: Don't invoke multiple Builder.CreateBitCast() on Builder.CreateMemCpy. Or we would see sideeffect incompatibility among gcc and clang.
...
llvm-svn: 127405
2011-03-10 14:02:21 +00:00
John McCall
a738c25f5e
Use the "undergoes default argument promotion" bit on parameters to
...
simplify the logic of initializing function parameters so that we don't need
both a variable declaration and a type in FunctionArgList. This also means
that we need to propagate the CGFunctionInfo down in a lot of places rather
than recalculating it from the FAL. There's more we can do to eliminate
redundancy here, and I've left FIXMEs behind to do it.
llvm-svn: 127314
2011-03-09 04:27:21 +00:00
Devang Patel
68a1525290
Encode argument numbering in debug info so that code generator can emit them in order.
...
This fixes few blocks.exp regressions.
llvm-svn: 126960
2011-03-03 20:13:15 +00:00
Tilmann Scheller
99cc30c371
Revert "Add CC_Win64ThisCall and set it in the necessary places."
...
This reverts commit 126863.
llvm-svn: 126886
2011-03-02 21:36:49 +00:00
Devang Patel
bd6f7f9770
revert r126858.
...
llvm-svn: 126874
2011-03-02 20:31:22 +00:00
Tilmann Scheller
454464b491
Add CC_Win64ThisCall and set it in the necessary places.
...
llvm-svn: 126863
2011-03-02 19:36:23 +00:00
Devang Patel
31e5fb52d1
Encode argument numbering in debug info so that code generator can emit them in order.
...
This fixes few blocks.exp regressions.
Reapply r126795 with a fix (one character change) for gdb testsuite regressions.
llvm-svn: 126858
2011-03-02 19:11:22 +00:00
Devang Patel
a54696de8a
Revert r126794.
...
llvm-svn: 126848
2011-03-02 17:54:58 +00:00
Devang Patel
3bc2dedb40
Encode argument numbering in debug info so that code generator can emit them in order.
...
This fixes few blocks.exp regressions.
llvm-svn: 126795
2011-03-01 22:59:40 +00:00
Fariborz Jahanian
cf7f66f16f
objc IRGen for Next runtime message API.
...
The prototype for objc_msgSend() is technically variadic -
`id objc_msgSend(id, SEL, ...)`.
But all method calls should use a prototype that matches the method,
not the prototype for objc_msgSend itself().
// rdar://9048030
llvm-svn: 126754
2011-03-01 17:28:13 +00:00
Devang Patel
25468059e5
Simplify test to check an aggregate argument that has non trivial constructor or destructor.
...
This patch rewrites r125142.
llvm-svn: 125632
2011-02-16 01:11:51 +00:00
Daniel Dunbar
cb2b3d051d
Fix family-friendly-o, tsk tsk.
...
llvm-svn: 125293
2011-02-10 18:10:07 +00:00
Daniel Dunbar
0bb0331d95
Driver/Frontend: Wire up -mregparm=.
...
llvm-svn: 125201
2011-02-09 17:54:19 +00:00
Devang Patel
14524e0f24
If an aggregate argument is passed indirectly because it has non trivial
...
destructor or copy constructor than let debug info know about it.
Radar 8945514.
llvm-svn: 125142
2011-02-09 00:37:30 +00:00
John McCall
ad7c5c1657
Reorganize CodeGen{Function,Module} to eliminate the unfortunate
...
Block{Function,Module} base class. Minor other refactorings.
Fixed a few address-space bugs while I was there.
llvm-svn: 125085
2011-02-08 08:22:06 +00:00
Ken Dyck
705ba07ef0
Replace calls to getTypeSize() and getTypeAlign() with their 'InChars'
...
counterparts where char units are needed.
llvm-svn: 123805
2011-01-19 01:58:38 +00:00
Benjamin Kramer
acc6b4e2fd
Simplify mem{cpy, move, set} creation with IRBuilder.
...
llvm-svn: 122634
2010-12-30 00:13:21 +00:00
Michael J. Spencer
f5a1fbcdf3
Fix Whitespace.
...
llvm-svn: 116798
2010-10-19 06:39:39 +00:00
Daniel Dunbar
7b7c2937ef
IRgen/ABI: Add support for realigning structures which are passed by indirect
...
reference.
llvm-svn: 114114
2010-09-16 20:42:02 +00:00
Dawn Perchik
335e16bad4
Add symantic support for the Pascal calling convention via
...
"__attribute((pascal))" or "__pascal" (and "_pascal" under
-fborland-extensions). Support still needs to be added to llvm.
llvm-svn: 112939
2010-09-03 01:29:35 +00:00
John McCall
0d635f53a8
Re-commit r112916 with an additional fix for the self-host failures.
...
I've audited the remaining getFunctionInfo call sites.
llvm-svn: 112936
2010-09-03 01:26:39 +00:00
John McCall
c32f94b4ce
Revert r112916, it's breaking selfhost pretty badly.
...
llvm-svn: 112925
2010-09-03 00:40:45 +00:00
John McCall
12d3891a27
It's not safe to use the generic CXXMethodDecl overload of CGT::getFunctionInfo
...
to set up a destructor call, because ABIs can tweak these conventions.
Fixes rdar://problem/8386802.
llvm-svn: 112916
2010-09-03 00:01:57 +00:00
John McCall
5d865c3292
Teach IR generation to return 'this' from constructors and destructors
...
under the ARM ABI.
llvm-svn: 112588
2010-08-31 07:33:07 +00:00
Daniel Dunbar
2e442a00b3
IRgen: Switch more MakeAddr() users to MakeAddrLValue; this time for calls which were previously not computing the qualifier list. In most cases, I don't think it matters, but I believe this is conservatively more correct / consistent.
...
llvm-svn: 111717
2010-08-21 03:15:20 +00:00