David Chisnall
950a9518b1
Added block type introspection support.
...
As per Fariborz's suggestion, committed now but can be reverted later if the used flag is problematic for Apple.
llvm-svn: 89134
2009-11-17 19:33:30 +00:00
David Chisnall
cb1b7bf79d
Fixed bug where ivar offsets were being initialized as 0 with the fragile GNU ABI.
...
llvm-svn: 89133
2009-11-17 19:32:15 +00:00
John McCall
1e9de059cc
Skip over shadow using decls during codegen.
...
llvm-svn: 89079
2009-11-17 09:33:40 +00:00
Anders Carlsson
dee9a30204
Unify the way destructor epilogues are generated for synthesized and regular destructors. Also fix PR5529.
...
llvm-svn: 89034
2009-11-17 04:44:12 +00:00
Anders Carlsson
cfd3012756
More const is always good.
...
llvm-svn: 89033
2009-11-17 03:57:07 +00:00
Mike Stump
3afea1d8fe
Fix typo. Thanks Ted.
...
llvm-svn: 89031
2009-11-17 03:01:03 +00:00
Mike Stump
8f5e6770e7
Add typeinfo support for T* and const T* for all builtin types T.
...
llvm-svn: 89030
2009-11-17 02:57:13 +00:00
Mike Stump
3f75d552a3
Add typeid for the builtin types. WIP.
...
llvm-svn: 89028
2009-11-17 02:16:21 +00:00
Mike Stump
c2c03349f3
Ensure we peer through () when handling typeid(*p).
...
llvm-svn: 89015
2009-11-17 00:45:21 +00:00
Mike Stump
4d0e9095e4
Since we always have 2 edges, we don't need to reserve 3 slot for the
...
PHI node.
llvm-svn: 89005
2009-11-17 00:10:05 +00:00
Mike Stump
e8cdcc9ab0
Minor CFG refinements for typeid and dynamic_cast.
...
llvm-svn: 89004
2009-11-17 00:08:50 +00:00
Eli Friedman
e85ef718d5
Fix up EmitMemberInitializer to handle many more cases.
...
llvm-svn: 88999
2009-11-16 23:53:01 +00:00
Eli Friedman
5e7d969526
Reorganize EmitMemberInitializer to put anonymous unions on the common codepath.
...
llvm-svn: 88995
2009-11-16 23:34:11 +00:00
Eli Friedman
c1daba3ec8
Make member initializers for union members work correctly.
...
llvm-svn: 88989
2009-11-16 22:58:01 +00:00
Mike Stump
6ca0e21de4
Implement dynamic_cast<void*>(E).
...
llvm-svn: 88988
2009-11-16 22:52:20 +00:00
Eli Friedman
c2ef215bda
Implement a few more cases for copy constructor synthesis.
...
llvm-svn: 88971
2009-11-16 21:47:41 +00:00
Douglas Gregor
1b8fe5b716
First part of changes to eliminate problems with cv-qualifiers and
...
sugared types. The basic problem is that our qualifier accessors
(getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at
the current QualType and not at any qualifiers that come from sugared
types, meaning that we won't see these qualifiers through, e.g.,
typedefs:
typedef const int CInt;
typedef CInt Self;
Self.isConstQualified() currently returns false!
Various bugs (e.g., PR5383) have cropped up all over the front end due
to such problems. I'm addressing this problem by splitting each
qualifier accessor into two versions:
- the "local" version only returns qualifiers on this particular
QualType instance
- the "normal" version that will eventually combine qualifiers from this
QualType instance with the qualifiers on the canonical type to
produce the full set of qualifiers.
This commit adds the local versions and switches a few callers from
the "normal" version (e.g., isConstQualified) over to the "local"
version (e.g., isLocalConstQualified) when that is the right thing to
do, e.g., because we're printing or serializing the qualifiers. Also,
switch a bunch of
Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType()
expressions over to
Context.hasSameUnqualifiedType(T1, T2)
llvm-svn: 88969
2009-11-16 21:35:15 +00:00
Eli Friedman
c08bdea63d
Clean up scalar cast kind handling; make cast kind handling explicitly handle
...
more cases. No intended visible change.
llvm-svn: 88968
2009-11-16 21:33:53 +00:00
Mike Stump
bf44533846
Audit done, all the required casts are already done.
...
llvm-svn: 88966
2009-11-16 21:22:19 +00:00
Devang Patel
37b4b8b1da
revert r88963.
...
llvm-svn: 88965
2009-11-16 21:17:07 +00:00
Devang Patel
b71c28db22
Use TrackingVH to hold forward decl. This one is for RecordType.
...
llvm-svn: 88963
2009-11-16 21:06:35 +00:00
Eli Friedman
00dbf4c3c6
Parallel fix to r88951: use TrackingVH to hold forward decl.
...
llvm-svn: 88962
2009-11-16 21:04:30 +00:00
Eli Friedman
b05d0824c6
Fix valgrind uninitialized error.
...
llvm-svn: 88952
2009-11-16 20:33:31 +00:00
Devang Patel
10909d5faf
Use TrackingVH to hold forward decl.
...
llvm-svn: 88951
2009-11-16 20:09:38 +00:00
David Chisnall
b3b44ce433
Fixed two minor differences between clang and GCC-generated runtime structures for the GNU runtime.
...
llvm-svn: 88937
2009-11-16 19:05:54 +00:00
Anders Carlsson
0d82fa66a5
The ssp and sspreq function attributes should only be applied to function definitions, not declarations or calls.
...
llvm-svn: 88915
2009-11-16 16:56:03 +00:00
Duncan Sands
7876dad8e7
Pass a value for the isSigned parameter of CreateIntCast, rather than
...
passing the name (an exotic way of specifying that the result is signed!).
llvm-svn: 88909
2009-11-16 13:11:21 +00:00
Mike Stump
65511704f7
Implement most of dynamic_cast. WIP.
...
llvm-svn: 88901
2009-11-16 06:50:58 +00:00
Eli Friedman
49ddc5fb94
Make GetAddrOfConstantStringFromLiteral return a constant of the correct type.
...
This doesn't have any visible effects at the moment because normally the
implicit cast code forces the type to the expected type.
llvm-svn: 88896
2009-11-16 05:55:46 +00:00
Eli Friedman
8c98dffd1f
Some minor cleanup for EmitCastLValue.
...
llvm-svn: 88894
2009-11-16 05:48:01 +00:00
Eli Friedman
e6ce354795
Fix a couple of cases where we weren't generating the right kind of call
...
for a call to a virtual function.
llvm-svn: 88891
2009-11-16 05:31:29 +00:00
Eli Friedman
011c4c341b
Implement two-argument form of delete operator.
...
llvm-svn: 88890
2009-11-16 05:16:40 +00:00
Anders Carlsson
d787204e6d
When generating the deleting ctor, emit a call to delete.
...
llvm-svn: 88878
2009-11-15 23:03:25 +00:00
Mike Stump
4ac39ef6f9
Peer through refernces for typeid. WIP.
...
llvm-svn: 88871
2009-11-15 20:30:39 +00:00
Mike Stump
1bf924b121
Finish off zero check for typeid(*p) so that it will do a __cxa_bad_typeid.
...
llvm-svn: 88852
2009-11-15 16:52:53 +00:00
Mike Stump
c9b231c8d1
Implement typeid for class types.
...
llvm-svn: 88843
2009-11-15 08:09:41 +00:00
Mike Stump
4c808dfc58
Finish off support for typeinfo generation for classes.
...
llvm-svn: 88828
2009-11-15 03:28:10 +00:00
Mike Stump
f5b2869b75
Finisgh off rest of class_type_info rtti generation.
...
llvm-svn: 88823
2009-11-14 23:32:21 +00:00
Anders Carlsson
50cb321fdc
Handle CK_BitCast in EmitCastLValue.
...
llvm-svn: 88810
2009-11-14 21:21:42 +00:00
Anders Carlsson
0acee6e0d7
Canonicalize the type before trying to create a debug type.
...
llvm-svn: 88808
2009-11-14 21:08:12 +00:00
Anders Carlsson
6037e78149
Have CGDebugInfo::getOrCreateType cache the QualType instead of having every ConvertType overload do it.
...
llvm-svn: 88807
2009-11-14 20:52:05 +00:00
Mike Stump
1acec6a41a
Build up more of the rtti info for a class. WIP.
...
llvm-svn: 88795
2009-11-14 15:55:18 +00:00
Mike Stump
14718425fa
Add the name to the rtti data structure.
...
llvm-svn: 88792
2009-11-14 14:25:18 +00:00
Eli Friedman
274ab904d0
Avoid assert-crash in a case where the expression passed to EmitConstantExpr
...
legitimately has side-effects (and needs to be generated as a non-constant).
llvm-svn: 88767
2009-11-14 08:51:33 +00:00
Eli Friedman
b210fc598f
Make __func__ and friends work correctly within the initializer for a static
...
local variable.
llvm-svn: 88766
2009-11-14 08:37:13 +00:00
Eli Friedman
b572c92674
PR5483: Generate missing form of destructor when it is virtual. (Someone
...
more familiar with this stuff should double-check that there isn't some more
general rule; this is purely from inspecting g++ output.)
llvm-svn: 88755
2009-11-14 04:19:37 +00:00
Fariborz Jahanian
da2efb091d
Generate the old API when sending message to super
...
in a category implementation (objc 32bit api related).
llvm-svn: 88741
2009-11-14 02:18:31 +00:00
Anders Carlsson
52ce3bbf57
Handle CXXDefaultArgExprs in EmitLValue. Fixes PR5484.
...
llvm-svn: 88735
2009-11-14 01:51:50 +00:00
Mike Stump
2ec5dd7160
Mangling support for typeinfo names.
...
llvm-svn: 88726
2009-11-14 00:14:13 +00:00
Mike Stump
c5a332cefb
Handle descructor printing better.
...
llvm-svn: 88723
2009-11-13 23:45:53 +00:00
Mike Stump
559387fe8b
Also track address points for primaries bases.
...
llvm-svn: 88717
2009-11-13 23:13:20 +00:00
Fariborz Jahanian
ebea005812
Code gen. For virtual destructor call on array objects
...
(still part of pr5472).
llvm-svn: 88712
2009-11-13 22:29:45 +00:00
Eli Friedman
6f04b1e605
Obvious fix for PR5474.
...
llvm-svn: 88696
2009-11-13 21:23:46 +00:00
Fariborz Jahanian
f75c1f7a73
Fixes a code gen. bug for array delete operator call
...
int 32bit abi (pr5472 related).
-This line, and those below, will be ignored--
M lib/CodeGen/CGCXXExpr.cpp
llvm-svn: 88695
2009-11-13 21:20:14 +00:00
Fariborz Jahanian
6814eaa2cc
Code gen for arrady delete operator. Fixes pr5472.
...
llvm-svn: 88680
2009-11-13 19:27:47 +00:00
Devang Patel
b40f295037
Do not store DIDescriptor directly into a container. Store MDNode directly, through TrackingVH.
...
llvm-svn: 88677
2009-11-13 19:10:24 +00:00
Mike Stump
88fc7d4202
This falls into the category of stupid pet tricks. I hate to do this,
...
but this is necessary to continue work on virtual vtables. We don't
want to penalize virtual table building testcases, just because
complex virtual conversions don't yet work.
llvm-svn: 88676
2009-11-13 18:53:35 +00:00
Anders Carlsson
fb4dda4fed
Instead of storing CXXMethodDecls in the vtable builder, store GlobalDecls so we can represent both the complete and deleting destructors. Also, when encountering a destructor decl, emit entries for both the complete and deleting destructors. Mike, please review.
...
With this change, FileCheck builds and runs the clang test suite without failures!
llvm-svn: 88663
2009-11-13 17:08:56 +00:00
Daniel Dunbar
1b4441915a
Wherein the TargetInfo argument to Preprocessor is made 'const' and propogated.
...
llvm-svn: 87087
2009-11-13 05:51:54 +00:00
Zhongxing Xu
1721ef7a53
Include header for printf.
...
llvm-svn: 87086
2009-11-13 05:46:16 +00:00
Anders Carlsson
e828c36933
Add a special BuildVirtualCall that's going to be used for building calls to destructors. This is needed because when compiling:
...
struct A {
virtual ~A();
};
void f(A* a) {
delete a;
}
A's deleting destructor should be called.
llvm-svn: 87083
2009-11-13 04:45:41 +00:00
Anders Carlsson
78cfaa9e56
Fix two bugs with temporaries:
...
1. For
A f() {
return A();
}
we were incorrectly calling the A destructor on the returned object.
2. For
void f(A);
void g() {
A a;
f(a);
}
we were incorrectly not calling the copy constructor.
llvm-svn: 87082
2009-11-13 04:34:45 +00:00
Anders Carlsson
87f84c1e72
Move GlobalDecl to its own file. Also add DenseMapInfo traits.
...
llvm-svn: 87081
2009-11-13 04:25:07 +00:00
Mike Stump
fa81808a11
Refine construction vtables; they don't include bits that don't have
...
virtual bases unless they are morally virtual.
llvm-svn: 87071
2009-11-13 02:35:38 +00:00
Mike Stump
653d0b99df
Refine the construction vtables with respect to offsets. WIP.
...
llvm-svn: 87067
2009-11-13 02:13:54 +00:00
Mike Stump
83066c8dee
Allow the tracking of address points for construction vtables as well.
...
llvm-svn: 87063
2009-11-13 01:54:23 +00:00
Mike Stump
2b34bc5a96
Refine which vtbl is refernced in VTTs.
...
llvm-svn: 87043
2009-11-12 23:36:21 +00:00
Mike Stump
ca0de33113
Refine offsets into vtables for the VTT.
...
llvm-svn: 87041
2009-11-12 23:14:15 +00:00
Mike Stump
8677bc27bf
Refine vtable pointers for secondary vtables inside VTTs to point to
...
the right base vtable. WIP.
llvm-svn: 87039
2009-11-12 22:56:32 +00:00
Mike Stump
2cefe38365
Fix the offset calculations for non-virtual bases with overrides.
...
Refine the VTT entries for virtual bases to refer to the complete
object's vtable instead of constructor vtables.
Refine the AddressPoint calculations for VTT entries for virtual bases.
llvm-svn: 87021
2009-11-12 20:47:57 +00:00
Fariborz Jahanian
eb80c98a72
Fix a code gen bug in i386-apple-darwin (objc fragile abi), sending
...
message to 'super'. Fixes radar 7205866.
llvm-svn: 87017
2009-11-12 20:14:24 +00:00
Devang Patel
94f798c079
"Attach debug info with llvm instructions" mode was enabled a month ago. Now make it permanent and remove old way of inserting intrinsics to encode debug info for locations and types.
...
llvm-svn: 87007
2009-11-12 18:21:39 +00:00
Devang Patel
6e98d7af22
Use getNameAsCString() instead of getName().data()
...
llvm-svn: 87001
2009-11-12 17:49:47 +00:00
Chandler Carruth
bc55fe26c6
Move CompileOptions -> CodeGenOptions, and sink it into the CodeGen library.
...
This resolves the layering violation where CodeGen depended on Frontend.
llvm-svn: 86998
2009-11-12 17:24:48 +00:00
Devang Patel
7bdf096f8d
Do not use StringRef while using DebugInfo interface.
...
llvm-svn: 86915
2009-11-12 00:51:46 +00:00
Mike Stump
fd84d6d808
Fix ctor vtable name. WIP.
...
llvm-svn: 86879
2009-11-11 20:32:03 +00:00
Mike Stump
eac4559790
Push ctor vtable construction down further. WIP.
...
llvm-svn: 86878
2009-11-11 20:26:26 +00:00
Devang Patel
5348515193
Do not eagerly set stop point for arguments. This misleads the debugger in identifying beginning of function body. Instead, create new location to attach with llvm.dbg.declare. This location is only used to find the context of the variable by the code generator, and it is not used to emit line number info.
...
llvm-svn: 86862
2009-11-11 19:10:19 +00:00
Fariborz Jahanian
03f62ed9bb
Value initialize non-class array members in ctor's
...
initializer list. Fixes PR5463.
llvm-svn: 86849
2009-11-11 17:55:25 +00:00
Mike Stump
c7b9f5e762
More VTT work. We now track offsets and use the ctor vtable builder
...
interface. WIP.
llvm-svn: 86793
2009-11-11 03:08:24 +00:00
Fariborz Jahanian
e6c8112572
Avoid generating additional destructor(s) for initialized constructed
...
objects.
llvm-svn: 86778
2009-11-11 01:13:34 +00:00
Mike Stump
8b2d2d0707
Stub out most of the VTT building code. WIP.
...
llvm-svn: 86772
2009-11-11 00:35:07 +00:00
Devang Patel
af993bf5cc
Attach location info with llvm.dbg.declare.
...
llvm-svn: 86750
2009-11-10 23:07:24 +00:00
Eli Friedman
d76f438369
Revert r86741; it doesn't handle virtual bases correctly.
...
llvm-svn: 86745
2009-11-10 22:48:10 +00:00
Eli Friedman
0960059c0c
Minor optimization to skip null check in generated code where it isn't
...
necessary.
llvm-svn: 86741
2009-11-10 22:42:26 +00:00
Eli Friedman
3ad2645430
Fix for PR5454: make sure to use the right block as the predecessor in the
...
generated PHI node for the null check of a new operator.
llvm-svn: 86738
2009-11-10 22:39:09 +00:00
Fariborz Jahanian
1254a0978c
This patch implements Code gen. for destruction of
...
global array of objects.
llvm-svn: 86701
2009-11-10 19:24:06 +00:00
Mike Stump
b47222144b
Only generate a VTT for classes that need a VTT.
...
llvm-svn: 86699
2009-11-10 19:13:04 +00:00
Mike Stump
d846d0825b
Add vtable caching to prevent multiple vtables for the same class from
...
being generated.
Add the most derived vtable pointer to the VTT.
llvm-svn: 86671
2009-11-10 07:44:33 +00:00
Mike Stump
9f23a149cb
Be sure to clear out VCall when we clear out VCalls.
...
Start implementing VTTs. WIP.
llvm-svn: 86650
2009-11-10 02:30:51 +00:00
Mike Stump
3b9176985d
Finish off mangling for the VTT.
...
llvm-svn: 86647
2009-11-10 01:58:37 +00:00
Mike Stump
ef15744092
Add mangling for the construction vtable.
...
llvm-svn: 86643
2009-11-10 01:41:59 +00:00
Jeffrey Yasskin
612e38026a
Fix clang's use of DenseMap iterators after r86636 fixed their constness.
...
Patch by Victor Zverovich!
llvm-svn: 86638
2009-11-10 01:17:45 +00:00
Mike Stump
68ec7ee0e8
Enable the use of the new llvm objectsize intrinsic.
...
llvm-svn: 86607
2009-11-09 22:40:09 +00:00
Douglas Gregor
4ef1d400d9
Make sure that Type::getAs<ArrayType>() (or Type::getAs<subclass of
...
ArrayType>()) does not instantiate. Update all callers that used this
unsafe feature to use the appropriate ASTContext::getAs*ArrayType method.
llvm-svn: 86596
2009-11-09 22:08:55 +00:00
Eli Friedman
cc522d9ab3
Rearrange function to avoid recursive use-after-free.
...
llvm-svn: 86516
2009-11-09 05:07:37 +00:00
Eli Friedman
a72bf0fae8
Explicitly note that pre-inc/dec lvalues are not supported yet, so that it
...
doesn't crash. (Such expressions are valid in C++, but not in C.)
llvm-svn: 86513
2009-11-09 04:20:47 +00:00
Daniel Dunbar
11c08c8e5b
Rename areAllFields32Or64BitBasicType to canExpandIndirectArgument to closer match what it is semantically used for.
...
Also, fix a major bug where fields from a C++ struct might be dropped -- the expand action doesn't handle them correctly yet.
llvm-svn: 86502
2009-11-09 01:33:53 +00:00
Eli Friedman
d7686ef31c
Unify the codepaths used to verify base and member initializers for explicitly
...
and implicitly defined constructors. This has a number of benefits:
1. Less code.
2. Explicit and implicit constructors get the same diagnostics.
3. The AST explicitly contains constructor calls from implicit default
constructors. This allows handing some cases that previously weren't handled
correctly in IRGen without any additional code. Specifically, implicit default
constructors containing calls to constructors with default arguments are now
handled correctly.
llvm-svn: 86500
2009-11-09 01:05:47 +00:00
Daniel Dunbar
7e215ea165
Add clarifying parens.
...
llvm-svn: 86457
2009-11-08 09:46:46 +00:00
Anders Carlsson
5bbdc9f857
Handle member expressions where the member declaration is actually a static variable. Fixes PR5392.
...
llvm-svn: 86414
2009-11-07 23:16:50 +00:00
Anders Carlsson
ea4c30b39a
More LValue related code cleanup.
...
llvm-svn: 86413
2009-11-07 23:06:58 +00:00
Anders Carlsson
2ff6395ddc
More cleanup, the code is much easier to follow now.
...
llvm-svn: 86412
2009-11-07 22:53:10 +00:00
Anders Carlsson
6eee97276b
Reduce nesting, no functionality change.
...
llvm-svn: 86411
2009-11-07 22:46:42 +00:00
Anders Carlsson
03f83e58f7
We only need to call SetObjCNonGC for local variables. No functionality change.
...
llvm-svn: 86410
2009-11-07 22:43:34 +00:00
Anders Carlsson
509850ebec
Change EmitPointerToDataMemberLValue to take a FieldDecl. No intended functionality change.
...
llvm-svn: 86407
2009-11-07 22:00:15 +00:00
Chris Lattner
15275e55ce
add missing #include
...
llvm-svn: 86368
2009-11-07 09:22:46 +00:00
Anders Carlsson
c0a3561f0f
Always mangle functions with special names. Fixes PR5420.
...
llvm-svn: 86350
2009-11-07 07:15:03 +00:00
Anders Carlsson
ce21431fc4
When looking up and adding substitutions to the substitution table, make sure to always use the canonical declaration. With tihs change, FileCheck compiles and links but crashes during startup.
...
llvm-svn: 86339
2009-11-07 04:26:04 +00:00
Anders Carlsson
3d888e4548
Revert r86315 and add Type::FixedWidthInt to the FIXME cases.
...
llvm-svn: 86320
2009-11-07 01:19:37 +00:00
Devang Patel
5b39e2382f
Do not assert if debug info for certain type is not generated.
...
llvm-svn: 86315
2009-11-07 00:29:05 +00:00
Devang Patel
eef461c230
Do not emit linkage name for global variables. It confuses gdb, because it picks up AT_MIPS_linkage_name and ignores AT_name.
...
llvm-svn: 86308
2009-11-07 00:10:18 +00:00
Mike Stump
cd6f9ed906
Refine the non-virtual this adjustment. Optimize out virtual this
...
adjustments of zero.
llvm-svn: 86300
2009-11-06 23:27:42 +00:00
Fariborz Jahanian
e8e631c912
Prevent a code gen. crash on empty unions - pr5408.
...
llvm-svn: 86287
2009-11-06 20:47:40 +00:00
Anders Carlsson
443f677302
Simplify the debug info code, handle lvalue references and template specializations.
...
llvm-svn: 86277
2009-11-06 19:19:55 +00:00
Fariborz Jahanian
c2d71b531c
This patch fixes code gen. part of pr5333 (Conversion
...
using elipsis conversion).
llvm-svn: 86276
2009-11-06 18:47:57 +00:00
Anders Carlsson
8a6512961f
Handle QualifiedNameType and SubstTemplateTypeParmType types in CGDebugInfo::CreateTypeNode.
...
llvm-svn: 86274
2009-11-06 18:45:16 +00:00
Anders Carlsson
25ed5c2f42
Don't assert when trying to generate debug info for vector types. This needs to be fixed eventually...
...
llvm-svn: 86268
2009-11-06 18:24:04 +00:00
Chris Lattner
353fc1e447
update comment, pointed out by Gabor
...
llvm-svn: 86263
2009-11-06 18:10:47 +00:00
Chris Lattner
4f24225e8e
indirectbr seems to work! Rip out the old code.
...
llvm-svn: 86256
2009-11-06 17:38:18 +00:00
Anders Carlsson
eb9bc2ba82
Instead of returning a null DIType for unhandled types, assert.
...
llvm-svn: 86254
2009-11-06 17:01:39 +00:00
Anders Carlsson
421a5c9651
If a member variable of reference type is bound to a temporary in its member initializer it needs to be destroyed at the end of the constructor.
...
llvm-svn: 86230
2009-11-06 04:19:02 +00:00
Anders Carlsson
5852b13827
If a member initializer create temporaries we need to destroy them. Fixes PR5077.
...
llvm-svn: 86225
2009-11-06 04:11:09 +00:00
Anders Carlsson
a7cb98b202
More cleanup.
...
llvm-svn: 86224
2009-11-06 03:23:06 +00:00
Anders Carlsson
438cf92533
Cleanup ctor/dtor emission.
...
llvm-svn: 86222
2009-11-06 02:55:43 +00:00
Anders Carlsson
9e4e0237e4
Handle ParenExprs in mangleExpression.
...
llvm-svn: 86218
2009-11-06 02:50:19 +00:00
Mike Stump
72431bd9ea
Refine the vcall for a function that is defined in a virtual base
...
class that is overridden in a base that isn't morally virtual.
llvm-svn: 86217
2009-11-06 02:38:24 +00:00
Devang Patel
ba3c6681f0
Enable debug info for global variables at -O1+
...
llvm-svn: 86156
2009-11-05 19:13:29 +00:00
Fariborz Jahanian
4127b8ef97
Added support for static variables which require
...
initialization before main. Fixes pr5396.
llvm-svn: 86145
2009-11-05 18:03:03 +00:00
Mike Stump
c550768a11
References can't be zero; omit zero check for return value adjustments
...
in covariant thunks that return references.
llvm-svn: 86121
2009-11-05 06:32:02 +00:00
Mike Stump
b8da7a046d
Refine covariant return value adjustments for thunks when null
...
pointers are returned.
llvm-svn: 86120
2009-11-05 06:12:26 +00:00
Fariborz Jahanian
18bc195473
Add code gen for pointer-to-member function in
...
ctor's initializer. Fixes pr5178.
llvm-svn: 86040
2009-11-04 19:13:37 +00:00
Fariborz Jahanian
09cc10f9f8
This patch extends CleanupScope to support destruction
...
of array objects on block exit. Patch is by Anders Calrsson.
llvm-svn: 86032
2009-11-04 17:57:40 +00:00
Douglas Gregor
615ac67fb8
Store the unresolved class type in MemberPointerType's Class field,
...
from Peter Collingbourne!
llvm-svn: 86030
2009-11-04 16:49:01 +00:00
Tanya Lattner
f9d41df093
Merge constant array and structures. This will create a global variables for arrays and structs that are constant and their initializer is constant. It is on by default but can be disable with the flag -fno-merge-all-constants.
...
llvm-svn: 85991
2009-11-04 01:18:09 +00:00
Mike Stump
b9c9b351e9
Fix 80-col violations.
...
llvm-svn: 85990
2009-11-04 01:11:15 +00:00
Mike Stump
71609a2874
Split out return adjustments in thunks from this adjustment in thunks
...
so the optimizer can tailcall into the return value adjustment thunk.
This improves codesize for complex hierarchies.
llvm-svn: 85988
2009-11-04 00:53:51 +00:00
Mike Stump
8117848174
Misc cleanups.
...
llvm-svn: 85978
2009-11-03 23:50:34 +00:00
Mike Stump
53f9ded62b
Refine volatile handling, specifically, we must have the canonical
...
type to look at the volatile specifier. I found these all from just
hand auditing the code.
llvm-svn: 85967
2009-11-03 23:25:48 +00:00
Mike Stump
4627132ebc
Refine codegen for covariant thunks that return references.
...
llvm-svn: 85916
2009-11-03 19:03:17 +00:00
Mike Stump
77738205e6
Refine return value adjustments for thunks.
...
llvm-svn: 85905
2009-11-03 16:59:27 +00:00
Mike Stump
462a4aa787
Fix documentation.
...
llvm-svn: 85901
2009-11-03 16:11:57 +00:00
Mike Stump
92e5f8cb39
Refine codegen for non-virtual this adjustments for thunks.
...
llvm-svn: 85856
2009-11-03 03:16:46 +00:00
Mike Stump
f358972fdc
Add virtual adjustments for this for thunks.
...
llvm-svn: 85852
2009-11-03 02:12:59 +00:00
Mike Stump
31e1d43729
Add basic codegen for thunks that return values.
...
llvm-svn: 85842
2009-11-02 23:47:45 +00:00
Mike Stump
33ccd9e354
Refine codegen for thunks.
...
llvm-svn: 85839
2009-11-02 23:22:01 +00:00
Mike Stump
75ce573815
Refine vcall/vbase ordering with vtable construction.
...
llvm-svn: 85677
2009-10-31 20:06:59 +00:00
Anders Carlsson
32e1b1c169
Get throws limping along, still a bunch of FIXMEs. Too bad we don't support catching anything yet :)
...
llvm-svn: 85574
2009-10-30 02:27:02 +00:00
Anders Carlsson
958c9f8524
Fix thinko, mangleCXXRtti should obviously take a QualType!
...
llvm-svn: 85565
2009-10-30 01:52:02 +00:00
Anders Carlsson
4b08db7a62
Add CGException.cpp, to be used for exception related code generation.
...
llvm-svn: 85560
2009-10-30 01:42:31 +00:00
Anders Carlsson
430046321b
mangleCXXRtti obviously needs to take a type, what was I thinking...
...
llvm-svn: 85555
2009-10-30 01:26:12 +00:00
Fariborz Jahanian
c9076fecdf
Patch for destruction of array of objects on block exit.
...
llvm-svn: 85512
2009-10-29 16:22:54 +00:00
Nuno Lopes
09bd8656c3
make clang emit undefs for padding of structs and unions instead of zeros. this enables constant compaction optimizations.
...
llvm-svn: 85504
2009-10-29 11:27:06 +00:00
Chris Lattner
edc56ef41c
optimize out some ifdefs.
...
llvm-svn: 85453
2009-10-29 00:22:00 +00:00
Chris Lattner
6c4d255bf3
Implement clang support for indirect branch and address of label
...
using the new LLVM support for this. This is temporarily hiding
behind horrible and ugly #ifdefs until the time when the optimizer
is stable (hopefully a week or so). Until then, lets make it "opt in" :)
llvm-svn: 85446
2009-10-28 23:59:40 +00:00
Fariborz Jahanian
29baa2b1ba
Minor cleanup.
...
llvm-svn: 85434
2009-10-28 21:07:28 +00:00
Fariborz Jahanian
f1639fffbc
Code gen for array construction - WIP
...
llvm-svn: 85432
2009-10-28 20:55:41 +00:00
Mike Stump
476e2dfe19
Refactor a bit.
...
llvm-svn: 85424
2009-10-28 20:44:03 +00:00
Chris Lattner
a0c0d88ba8
factor a creation of Int32Ty.
...
llvm-svn: 85422
2009-10-28 20:36:47 +00:00
Chris Lattner
ab5e0af8bc
random tidying
...
llvm-svn: 85408
2009-10-28 17:39:19 +00:00
Douglas Gregor
05925031f7
Mangle based on the declaration we're given, not the canonical
...
declaration, since attributes that affect mangling may have been added
to subsequent declarations. However, to determine the linkage of the
declaration, we need to look at the canonical declaration. Fixes PR4412.
llvm-svn: 85400
2009-10-28 16:31:34 +00:00
Chris Lattner
5e71d43155
adjust for a pending LLVM change.
...
llvm-svn: 85373
2009-10-28 05:12:07 +00:00
Mike Stump
82d25e4e5e
Add mangling for VTTs.
...
llvm-svn: 85363
2009-10-28 01:51:46 +00:00
Mike Stump
375faa8dd7
Finish off pure virtual function handling.
...
llvm-svn: 85354
2009-10-28 00:35:46 +00:00
Mike Stump
bb9ff05778
Prep work for putting ___cxa_pure_virtual in the vtables for pure functions.
...
llvm-svn: 85345
2009-10-27 23:46:47 +00:00
Mike Stump
18e8b477e8
Refactor code a little.
...
llvm-svn: 85343
2009-10-27 23:36:26 +00:00
Douglas Gregor
b7e5c847c4
Implement proper linkage for explicit instantiation declarations of
...
inlined functions. For example, given
template<typename T>
class string {
unsigned Len;
public:
unsigned size() const { return Len; }
};
extern template class string<char>;
we now give the instantiation of string<char>::size
available_externally linkage (if it is ever instantiated!), as
permitted by the C++0x standard.
llvm-svn: 85340
2009-10-27 23:26:40 +00:00
Mike Stump
876387ba4f
__builtin_object_size refinements. Ensure we handle expressions with
...
side-effects up front, as when we switch to the llvm intrinsic call
for __builtin_object_size later, it will have two evaluations.
We also finish off the intrinsic version of the code so we can just
turn it on once llvm has the intrinsic.
llvm-svn: 85324
2009-10-27 22:09:17 +00:00
Douglas Gregor
583dcafce4
Introduce FunctionDecl::isInlined() to tell whether a function should
...
be inlined.
llvm-svn: 85307
2009-10-27 21:11:48 +00:00
Douglas Gregor
35b5753e17
Rename FunctionDecl::isInline/setInline to
...
FunctionDecl::isInlineSpecified/setInlineSpecified.
llvm-svn: 85305
2009-10-27 21:01:01 +00:00
Daniel Dunbar
c369d73405
Set OptimizeForSize LLVM function attribute with -Os.
...
llvm-svn: 85278
2009-10-27 19:48:08 +00:00
Daniel Dunbar
c14753b781
Fix crash when synthesizing property setters when the property type and ivar
...
type have mismatched Objective-C types.
- <rdar://problem/7336352> [irgen] crash in synthesized property construction
llvm-svn: 85275
2009-10-27 19:21:30 +00:00
Anders Carlsson
29295bff61
Add a PrettyStackTraceDecl in CodeGenModule::EmitGlobalDefinition.
...
llvm-svn: 85237
2009-10-27 14:32:27 +00:00
Mike Stump
7a484dd6a9
Prep for future __builtin_object_size refinements. The theory is that
...
someone will add an llvm intrinsic for us to use, so the optimizer can
figure out the hard cases. WIP.
For those that want to help, double check with Eric before starting.
He has a bit of code this will plug into.
llvm-svn: 85175
2009-10-26 23:39:48 +00:00
Fariborz Jahanian
038374f887
Add Code gen support for '->*' operator which fell
...
through the crack.
llvm-svn: 85160
2009-10-26 21:58:25 +00:00
Chandler Carruth
6e0df53865
Switch vtable to linkeonce_odr. Patch by nlewycky.
...
llvm-svn: 85131
2009-10-26 17:14:14 +00:00
Douglas Gregor
e0105ad38b
assert -> llvm_unreachable
...
llvm-svn: 85125
2009-10-26 16:27:58 +00:00
Chandler Carruth
a3f084ce16
Update location of DataTypes.h to reflect move in LLVM with r85086.
...
llvm-svn: 85087
2009-10-26 01:37:10 +00:00
Nate Begeman
b8326be4d9
Fix a bug in calculating shufflevector indices when constructing vectors from other vectors.
...
If I can find it again, I will check in a testcase.
llvm-svn: 85032
2009-10-25 02:26:01 +00:00
John McCall
48f2d5860d
Store the builtin types as CanQualTypes. Expand a bit on the CanQual API,
...
but also remove some methods that cause ambiguities, and generally
make CanQual<blah> more analogous to QualType.
llvm-svn: 84976
2009-10-23 23:03:21 +00:00
Douglas Gregor
4bd90e53c2
Eliminate QualifiedDeclRefExpr, which captured the notion of a
...
qualified reference to a declaration that is not a non-static data
member or non-static member function, e.g.,
namespace N { int i; }
int j = N::i;
Instead, extend DeclRefExpr to optionally store the qualifier. Most
clients won't see or care about the difference (since
QualifierDeclRefExpr inherited DeclRefExpr). However, this reduces the
number of top-level expression types that clients need to cope with,
brings the implementation of DeclRefExpr into line with MemberExpr,
and simplifies and unifies our handling of declaration references.
Extended DeclRefExpr to (optionally) store explicitly-specified
template arguments. This occurs when naming a declaration via a
template-id (which will be stored in a TemplateIdRefExpr) that,
following template argument deduction and (possibly) overload
resolution, is replaced with a DeclRefExpr that refers to a template
specialization but maintains the template arguments as written.
llvm-svn: 84962
2009-10-23 18:54:35 +00:00
John McCall
6fd4c23324
Emit calls using the canonical prototype of the called function.
...
llvm-svn: 84947
2009-10-23 08:22:42 +00:00
Mike Stump
ae2559a221
Fixup the return type of functions.
...
llvm-svn: 84922
2009-10-23 01:52:13 +00:00
Fariborz Jahanian
ffba662dd2
Complete code gen for '.*' binary expression for
...
both scalar and aggregates.
llvm-svn: 84910
2009-10-22 22:57:31 +00:00
John McCall
fc93cf9777
When building types from declarators, instead of building two types (one for
...
the DeclaratorInfo, one for semantic analysis), just build a single type whose
canonical type will reflect the semantic analysis (assuming the type is
well-formed, of course).
To make that work, make a few changes to the type system:
* allow the nominal pointee type of a reference type to be a (possibly sugared)
reference type. Also, preserve the original spelling of the reference type.
Both of these can be ignored on canonical reference types.
* Remove ObjCProtocolListType and preserve the associated source information on
the various ObjC TypeLocs. Preserve the spelling of protocol lists except in
the canonical form.
* Preserve some level of source type structure on parameter types, but
canonicalize on the canonical function type. This is still a WIP.
Drops code size, makes strides towards accurate source location representation,
slight (~1.7%) progression on Cocoa.h because of complexity drop.
llvm-svn: 84907
2009-10-22 22:37:11 +00:00
John McCall
b692a098c6
Canonicality is a property of qualified types, not unqualified types.
...
llvm-svn: 84891
2009-10-22 20:10:53 +00:00
Mike Stump
c9f1efe6b3
Remove some misguided code.
...
llvm-svn: 84823
2009-10-22 01:31:24 +00:00
Mike Stump
e1b19ba05b
Extend out the block descriptor structure for debug information with
...
the copy/dispose helpers as appropriate.
llvm-svn: 84817
2009-10-22 00:49:09 +00:00
Fariborz Jahanian
52987dc581
Code gen for '.*' binary expressions - WIP.
...
llvm-svn: 84800
2009-10-21 23:45:42 +00:00
Mike Stump
f23b0ead3d
Turn on the preallocation of all BlockDeclRefExprs.
...
llvm-svn: 84789
2009-10-21 22:02:08 +00:00
Mike Stump
066b616684
Refine collection of BlockDeclRefExprs. WIP.
...
llvm-svn: 84787
2009-10-21 22:01:24 +00:00
Fariborz Jahanian
b25817ac1f
Expand on code gen. for pointer to data members so it works
...
for base classe members as well. Test case enhanced for this.
llvm-svn: 84780
2009-10-21 21:01:47 +00:00
Fariborz Jahanian
4ebdff5e1c
Code gen for pointer-to-datamember - WIP.
...
llvm-svn: 84771
2009-10-21 18:38:00 +00:00
Mike Stump
945fec05dd
Fix typo.
...
llvm-svn: 84770
2009-10-21 18:24:18 +00:00
Mike Stump
41eb02d496
Refactor.
...
llvm-svn: 84769
2009-10-21 18:23:01 +00:00
Edward O'Callaghan
437ec1ed6e
Add AuroraUX ABI Triple in correct place.
...
llvm-svn: 84758
2009-10-21 11:58:24 +00:00
Mike Stump
7fe9cc1dd5
Prep work to always preallocate BlockDeclRefExprs so that we can
...
generate the debug information for the first parameter to the block
invoke functions. WIP.
llvm-svn: 84737
2009-10-21 03:49:08 +00:00
Mike Stump
70197d5441
Fix 80-col violation.
...
llvm-svn: 84719
2009-10-21 00:42:55 +00:00
Fariborz Jahanian
e4d94cee05
Code-gen for CXXZeroInitValueExpr AST passed
...
as argument to a function call. Removes a FIXME.
llvm-svn: 84694
2009-10-20 23:29:04 +00:00
Anders Carlsson
5789c497a0
Fix the 32-bit ABI to return structures with non-trivial copy ctors or dtors indirectly.
...
llvm-svn: 84686
2009-10-20 22:07:59 +00:00
Mike Stump
38382028c7
For now, we need to have the llvm type of the block pointer remain as
...
it was. Fixes codegen bug introduced yesterday.
llvm-svn: 84668
2009-10-20 20:30:01 +00:00
Devang Patel
e21912d1ae
Do not eagerly cache DITypes because it allows real struct type to be shadowed by forward declared struct type.
...
llvm-svn: 84659
2009-10-20 19:55:01 +00:00
Devang Patel
e4f2b2a8ac
Encode global variable name in debug info.
...
llvm-svn: 84653
2009-10-20 18:26:30 +00:00
Daniel Dunbar
710a80d3ba
Add missing semi-colon.
...
llvm-svn: 84650
2009-10-20 18:07:06 +00:00
Edward O'Callaghan
462e4ab4ac
Bring Darwin into the switch-case statement instead of its own if for readability.
...
llvm-svn: 84646
2009-10-20 17:22:50 +00:00
Mike Stump
d015328f15
Refine the type of the first parameter to block invoke functions.
...
WIP. I have yet to find the magic incantation to get the structure
type to be defined. If someone has a pointer, love to hear it.
llvm-svn: 84590
2009-10-20 02:12:22 +00:00
Anders Carlsson
0999aafda5
Handle emitting the assignment operator when the lhs is a reference. Fixes PR5227.
...
llvm-svn: 84518
2009-10-19 18:28:22 +00:00
Daniel Dunbar
d238681113
Avoid std::string concatenation.
...
llvm-svn: 84458
2009-10-19 01:21:19 +00:00
Daniel Dunbar
b5aacc282c
Twinify CodeGenFunction::CreateTempAlloca
...
llvm-svn: 84456
2009-10-19 01:21:05 +00:00
Anders Carlsson
69c2c4becc
When binding a reference to a temporary, it's important that other temporaries created as on the RHS are destroyed before emitting the dtor for the temporary.
...
llvm-svn: 84451
2009-10-18 23:09:21 +00:00
Daniel Dunbar
07d0785dbb
PR5218: Replace IdentifierInfo::getName with StringRef version, now that clients
...
are updated.
llvm-svn: 84447
2009-10-18 21:17:35 +00:00
Daniel Dunbar
349e6fbfce
Twinify CGObjCMac, this simplifies the code and should reduce std::string
...
trashing.
llvm-svn: 84439
2009-10-18 20:48:59 +00:00
Anders Carlsson
9500ad13b0
Use CK_BitCast for member function pointer casts. Fixes PR5138.
...
llvm-svn: 84438
2009-10-18 20:31:03 +00:00
Daniel Dunbar
70e7eadd15
Move misc clients to IdentifierInfo StringRef API.
...
- strcmp -> ==
- OS.write(II->getName() ...) -> OS << II->getNameStr()
- Avoid std::string concatenation
- Use getNameStr().str() when an std::string is really needed.
llvm-svn: 84437
2009-10-18 20:26:27 +00:00
Daniel Dunbar
2c422dc9ca
Move clients to use IdentifierInfo::getNameStart() instead of getName()
...
llvm-svn: 84436
2009-10-18 20:26:12 +00:00
Nate Begeman
19351639fb
Support IRgen of OpenCL vector initializers, ensuring the resulting IR is in a
...
form that LLVM code generators can turn into efficient code. For example,
int4 a, b, c;
a = (int4)(b.yzw, a.x)
llvm-svn: 84434
2009-10-18 20:10:40 +00:00
Anders Carlsson
094c459525
Add some more cast kinds.
...
llvm-svn: 84423
2009-10-18 18:12:03 +00:00
Nuno Lopes
ff3507b951
add support for codegening CXXZeroInitValueExprs
...
llvm-svn: 84418
2009-10-18 15:18:11 +00:00
Daniel Dunbar
1d4172c52b
Suppress -Asserts warning.
...
llvm-svn: 84329
2009-10-17 09:39:30 +00:00
Chris Lattner
671fec8727
Fix PR5211: codegen shouldn't assume that the result of ||/&& is int
...
anymore. In C++ it is bool.
llvm-svn: 84308
2009-10-17 04:24:20 +00:00
Fariborz Jahanian
da21efb566
Implement derived-to-base AST/code gen. There is a
...
FIXME in CGCXX.cpp that I would like Anders to
take a look at.
llvm-svn: 84265
2009-10-16 19:20:59 +00:00
Nuno Lopes
8550cb250c
ignore 'using' directive in CodeGenFunction::EmitDecl(). this fixes PR5085
...
llvm-svn: 84255
2009-10-16 14:40:52 +00:00
Anders Carlsson
f847117ac8
Builtin types are subsitutable if they are qualified. Fixes PR5196.
...
llvm-svn: 84237
2009-10-16 02:06:06 +00:00
John McCall
c5b8225285
Remove the ConstantArrayType subtypes. This information is preserved in the
...
TypeLoc records for declarations; it should not be necessary to represent it
directly in the type system.
Please complain if you were using these classes and feel you can't replicate
previous functionality using the TypeLoc API.
llvm-svn: 84222
2009-10-16 00:14:28 +00:00
Mike Stump
8bccbfdafe
Refine non-virtual part of the this adjustment for thunks. Refine
...
non-virtual part of the return result adjustments for covariant
thunks. WIP.
llvm-svn: 84178
2009-10-15 09:30:16 +00:00
Mike Stump
37dbe96a06
Track the offset to the current virtual base in CurrentVBaseOffset.
...
Track path information completely to ensure we get all the overrides. WIP.
llvm-svn: 84166
2009-10-15 02:04:03 +00:00
Anders Carlsson
66413c29d3
Handle
...
struct A { };
struct B : A { };
void f() {
const A& a = B();
}
correctly. (This now does the offset conversion if necessary and calls the destructor when a goes out of scope).
llvm-svn: 84162
2009-10-15 00:51:46 +00:00
Douglas Gregor
819c3ddda8
Fix a thinko that John pointed out
...
llvm-svn: 84142
2009-10-14 21:36:34 +00:00
Douglas Gregor
3cc3cdeea9
Give explicit and implicit instantiations of static data members of
...
class templates the proper linkage.
Daniel, please look over the CodeGenModule bits.
llvm-svn: 84140
2009-10-14 21:29:40 +00:00
Mike Stump
b21c4eede4
Shift the vcall slots for non-virtual bases of a virtual base, up into
...
the virtual base so they can be reused properly. Don't reuse vcall
slots across a virtual boundary. WIP. I have a testcase, but there
are still things that need to be fixed before the testcase can go in.
llvm-svn: 84120
2009-10-14 18:14:51 +00:00
Devang Patel
f33cfaf760
Copy metadata associated with CI
...
llvm-svn: 84114
2009-10-14 17:03:29 +00:00
Duncan Sands
cef56992b0
There is now only one version of eh.selector and eh.typeid.for.
...
Fix the clang build.
llvm-svn: 84107
2009-10-14 16:13:30 +00:00
Sanjiv Gupta
84a0287497
Few targets like PIC16 mangle the names of global variables, so retrieve the name
...
from Var itself rather than the decl for DebugInfo metadata.
llvm-svn: 84102
2009-10-14 15:08:34 +00:00
Chris Lattner
4f8a2e22c0
fix some cfstring related issues:
...
1) -fwritable-string does affect the non-utf16 version of cfstrings
just not the utf16 ones.
2) utf16 strings should always be marked constant, as the __TEXT segment
is readonly.
3) The name of the global doesn't matter, remove it from TargetInfo.
4) Trust the asmprinter to drop cstrings into the right section, like llvmgcc does now.
This fixes rdar://7115750
llvm-svn: 84077
2009-10-14 05:55:45 +00:00
Chris Lattner
734351d214
unbreak test/CodeGen/builtins.c, reverting Devang's change.
...
llvm-svn: 84075
2009-10-14 05:49:21 +00:00
Devang Patel
3b3f0f6b65
Check void type before using replaceAllUsesWith().
...
llvm-svn: 84050
2009-10-13 22:59:11 +00:00
Mike Stump
284312176a
Refine handling for non-virtual bases in return value adjustments for
...
covariant thunks. WIP.
llvm-svn: 84046
2009-10-13 22:54:56 +00:00
Chris Lattner
a2f9bd5339
fix test/CodeGen/statements.c on 32-bit hosts.
...
llvm-svn: 84039
2009-10-13 22:12:09 +00:00
Mike Stump
7373095ebf
Ensure we sign extend.
...
llvm-svn: 84031
2009-10-13 21:31:09 +00:00
Anders Carlsson
6bfee8f3e3
Don't assume that the LHS and RHS of a member pointer expression is a DeclRefExpr. Fixes PR5177.
...
llvm-svn: 83986
2009-10-13 17:41:28 +00:00
Mike Stump
ad47e7ea81
Remove FIXME. We construct VBIndex very early, before any calls to OverrideMethod.
...
llvm-svn: 83981
2009-10-13 17:23:44 +00:00
Devang Patel
9f73552852
Remove extra white space line.
...
llvm-svn: 83979
2009-10-13 17:02:38 +00:00
Devang Patel
7468489deb
Do not check use_empty() before invoking replaceAllUsesWith().
...
Let replaceAllUsesWith() adjust VHs even though there are no uses.
llvm-svn: 83978
2009-10-13 17:02:04 +00:00
Mike Stump
87876a0053
Refine handling for return value conversions with respect to virtual
...
offsets for covariant thunks.
llvm-svn: 83965
2009-10-13 10:55:21 +00:00
Benjamin Kramer
abd5b90e4c
Simplify pointer creation with the new Type::getInt*Ptr methods.
...
llvm-svn: 83964
2009-10-13 10:07:13 +00:00
Chris Lattner
3eb172a02b
Teach sema and codegen about the difference between address of labels,
...
which is a common idiom to improve PIC'ness of code using the addr of
label extension. This implementation is a gross hack, but the only other
alternative would be to teach evalutate about this horrid combination.
While GCC allows things like "&&foo - &&bar + 1", people don't use this
in practice. This implements PR5131.
llvm-svn: 83957
2009-10-13 07:14:16 +00:00
Chris Lattner
2bb5cb490c
reimplement codegen for indirect goto with the following advantages:
...
1. CGF now has fewer bytes of state (one pointer instead of a vector).
2. The generated code is determinstic, instead of getting labels in
'map order' based on pointer addresses.
3. Clang now emits one 'indirect goto switch' for each function, instead
of one for each indirect goto. This fixes an M*N = N^2 IR size issue
when there are lots of address-taken labels and lots of indirect gotos.
4. This also makes the default cause do something useful, reducing the
size of the jump table needed (by one).
llvm-svn: 83952
2009-10-13 06:55:33 +00:00
Chris Lattner
92ae16b0ae
number address-taken labels from 1. This allows 0 to be used as a sentinel
...
for a null pointer. In other words, "&&foo != NULL" will always work out to
true.
llvm-svn: 83948
2009-10-13 06:04:29 +00:00
Chris Lattner
dd7eaad7d4
Use the new Type::getInt8PtrTy method. This should probably be used in a lot
...
more places in clang codegen now.
llvm-svn: 83947
2009-10-13 06:02:42 +00:00
Devang Patel
5b294f4330
Enable "debug info attached to an instruction" mode.
...
llvm-svn: 83928
2009-10-12 23:31:25 +00:00
Devang Patel
dac79decf3
There is no need to attach debug location info with alloca instruction.
...
llvm-svn: 83913
2009-10-12 22:29:02 +00:00
Devang Patel
551e112e99
Encode long double.
...
llvm-svn: 83912
2009-10-12 22:28:31 +00:00
Anders Carlsson
1d116976b4
Store the key function of a record decl inside CGRecordLayout.
...
llvm-svn: 83900
2009-10-12 21:16:22 +00:00
Anders Carlsson
a1b54fdbe1
Even more devirtualization cleverness.
...
llvm-svn: 83886
2009-10-12 19:59:15 +00:00
Anders Carlsson
2a01709204
More devirtualization improvements.
...
llvm-svn: 83883
2009-10-12 19:51:33 +00:00
Anders Carlsson
b61301f353
Devirtualize calls on temporaries. A().f() for example.
...
llvm-svn: 83882
2009-10-12 19:45:47 +00:00
Anders Carlsson
d7432dfb0a
Factor out devirtualization checking into a separate function and make it handle references correctly.
...
llvm-svn: 83880
2009-10-12 19:41:04 +00:00
Anders Carlsson
b5296558f1
If the base type of a member call is a record type we don't need to emit a virtual call.
...
llvm-svn: 83816
2009-10-11 23:55:52 +00:00
Benjamin Kramer
bb0a07bf92
Remove dead variable.
...
llvm-svn: 83808
2009-10-11 22:57:54 +00:00
Benjamin Kramer
2e8301dd62
Add CGVtable.cpp to CMakeLists.
...
llvm-svn: 83800
2009-10-11 22:22:38 +00:00
Anders Carlsson
2bb27f53e0
Move the vtable builder to CGVtable.cpp, general cleanup.
...
llvm-svn: 83798
2009-10-11 22:13:54 +00:00
Anders Carlsson
2295f31810
Change mangleCXXVtable and mangleCXXRtti to take CXXRecordDecls instead of QualTypes.
...
llvm-svn: 83793
2009-10-11 21:24:51 +00:00
Anders Carlsson
6ce51fdf43
Move our (non-existing) RTTI emission code into CGRtti.cpp. No functionality change.
...
llvm-svn: 83732
2009-10-10 20:49:04 +00:00
Fariborz Jahanian
07ca72725a
Generate weak read barriers when reading a weak __block
...
variable inside the block.
llvm-svn: 83729
2009-10-10 20:07:56 +00:00
Devang Patel
3028a43f57
Revert 83567.
...
llvm-svn: 83676
2009-10-09 22:06:15 +00:00
Mike Stump
fc8ff639cb
Allow customization for the producer information in the debug output.
...
llvm-svn: 83659
2009-10-09 18:38:12 +00:00
Mike Stump
0d479e6653
Avoid warning.
...
llvm-svn: 83609
2009-10-09 01:25:47 +00:00
Douglas Gregor
01249503fe
Installation of Clang libraries and headers, from Axel Naumann!
...
llvm-svn: 83582
2009-10-08 22:15:31 +00:00
Devang Patel
abf71fa9fc
Record location info before emiting alloca for arguments. This allows arguments to have proper location info.
...
llvm-svn: 83567
2009-10-08 18:53:37 +00:00
Anders Carlsson
a18ed9b113
If a global initializer has a non-trivial constructor or destructor, we never want to defer generation of it, even if it is declared static.
...
With this change we're finally able to compile and run the (infamous)
#include <string>
#include <iostream>
int main(int argc, char **argv) {
std::cout << "Hello, World" << std::endl;
}
$ clang hello.cpp -lstdc++ -o hello
$ ./hello
Hello, World
llvm-svn: 83559
2009-10-08 17:28:59 +00:00
Anders Carlsson
3482b819db
Mangle std::basic_ostream<char, std::char_traits<char>> as So.
...
llvm-svn: 83557
2009-10-08 17:20:26 +00:00
Anders Carlsson
1e39bd944b
Mangle anonymous structs/unions correctly. Fixes PR5139.
...
llvm-svn: 83448
2009-10-07 01:45:02 +00:00
Anders Carlsson
ff971e8bf4
Add a MangleContext and pass it to all mangle functions. It will be used for keeping state, such as identifiers assigned to anonymous structs as well as scope encoding.
...
llvm-svn: 83442
2009-10-07 01:06:45 +00:00
Anders Carlsson
b703fd2216
Uncomment some commented out code.
...
llvm-svn: 83428
2009-10-06 23:02:00 +00:00
Anders Carlsson
c6d171ec77
Change GetAddressCXXOfBaseClass to use CXXBasePaths for calculating base class offsets. Fix the code to handle virtual bases as well.
...
llvm-svn: 83426
2009-10-06 22:43:30 +00:00
Anders Carlsson
11d00cf972
When mangling names, always use the canonical decl. Fixes PR5144.
...
llvm-svn: 83420
2009-10-06 21:58:01 +00:00
Devang Patel
542ab5f551
InsertSubprogramStart if ATTACH_DEBUG_INFO_TO_AN_INSN is not defined.
...
llvm-svn: 83419
2009-10-06 21:53:41 +00:00
Devang Patel
5d90d62701
Add support to attach debug info to an instruction.
...
This is not yet enabled.
llvm-svn: 83399
2009-10-06 18:36:08 +00:00
Anders Carlsson
6b7378bbe1
Emit the destructor epilogue in a cleanup block so a return from a destructor body still calls the epilogue.
...
llvm-svn: 83397
2009-10-06 18:09:57 +00:00
Anders Carlsson
80ef6f1a46
Pass the right type to GetAddrOfFunction when getting functions for the VTable. Fixes PR5021.
...
llvm-svn: 83395
2009-10-06 17:54:23 +00:00
Devang Patel
faf7e9ad24
Set appropriate context for a global variable while emitting debug info.
...
llvm-svn: 83352
2009-10-06 00:35:31 +00:00
Mike Stump
916c006735
Fix thinko and simplify.
...
llvm-svn: 83342
2009-10-05 23:08:21 +00:00
Mike Stump
3472ae5bac
Ensure we have atleast 2-byte alignment for member functions.
...
llvm-svn: 83337
2009-10-05 22:49:20 +00:00
Mike Stump
c5e153c50e
Respect alignments better.
...
llvm-svn: 83328
2009-10-05 21:58:44 +00:00
Benjamin Kramer
dde0fee82e
Use new predicates for some type equality tests.
...
llvm-svn: 83303
2009-10-05 13:47:21 +00:00
Anders Carlsson
d5931cd2b7
Pass the canonical method decl to GetVtableIndex. Fixes PR5120.
...
llvm-svn: 83272
2009-10-03 19:56:56 +00:00
Anders Carlsson
2ee3c011d9
Implement code generation of member function pointer calls. Fixes PR5121.
...
llvm-svn: 83271
2009-10-03 19:43:08 +00:00
Anders Carlsson
c46bf276e1
Teach AggExprEmitter about pointers to member functions.
...
llvm-svn: 83266
2009-10-03 15:43:24 +00:00
Anders Carlsson
3162e4945a
Handle base-to-derived casts of member function pointers in CGExprConstant.cpp
...
llvm-svn: 83265
2009-10-03 15:13:22 +00:00
Anders Carlsson
128a5d5147
Handle members to function pointers in CGExprConstant.
...
llvm-svn: 83264
2009-10-03 15:02:02 +00:00
Anders Carlsson
32bfb1ce8f
Move some functions from CodeGenFunctions to CodeGenModule so they can be used by CGExprConstant.
...
llvm-svn: 83263
2009-10-03 14:56:57 +00:00
Anders Carlsson
8a744ad8a6
Don't update the struct alignment when adding fields to a packed struct. Fixes PR5118.
...
llvm-svn: 83235
2009-10-02 04:52:12 +00:00
Mike Stump
581b9ad124
More magic pixie dust.
...
llvm-svn: 83232
2009-10-02 02:30:50 +00:00
Mike Stump
440af3d903
Fix up debug information for block pointers a bit more.
...
llvm-svn: 83231
2009-10-02 02:23:37 +00:00
Anders Carlsson
39e3eb12ae
When building constant structs, check if the resulting LLVM struct will be bigger than the record layout size and use a packed struct if that's the case. Fixes PR5108.
...
llvm-svn: 83230
2009-10-02 02:15:20 +00:00
Mike Stump
017460ab6c
Implement a FIXME. This improves codegen just a tad.
...
llvm-svn: 83221
2009-10-01 22:29:41 +00:00
Douglas Gregor
369acf9304
CodeGen may see out-of-line declarations of the various special member
...
functions when they are explicitly declared, e.g., via a function
template specialization or explicit template instantiation
declaration. Don't try to synthesize bodies for the special member
functions in this case; rather, check whether we have an implicit
declaration and, if so, synthesize the appropriate function
body. Fixes PR5084.
llvm-svn: 83212
2009-10-01 20:44:19 +00:00
Douglas Gregor
e364e7bc2b
Fix a lame regression in IR gen for C++ delete expressions. PR5102
...
llvm-svn: 83195
2009-10-01 05:49:51 +00:00
Mike Stump
7d69911a1f
A couple of refinements for laying out debug information for
...
BlockDeclRefDecls.
llvm-svn: 83185
2009-10-01 00:27:30 +00:00
John McCall
4fa5342758
Anonymous namespaces, sema + codegen. A lot of semantics are still broken,
...
apparently because using directives aren't quite working correctly.
llvm-svn: 83184
2009-10-01 00:25:31 +00:00
Fariborz Jahanian
e01e434aef
<rdar://problem/7263113> Make clang produce gcc's objc_assign_StrongCast as a result of type-cast of an ivar in assignment.
...
llvm-svn: 83150
2009-09-30 17:10:29 +00:00
Mike Stump
2e722b915c
Improve debugging information for BlockDeclRefExpr. WIP. Given this
...
scheme, we can switch the previous scheme over to using this code
path. There's a bit of simplifications yet to do as well.
llvm-svn: 83138
2009-09-30 02:43:10 +00:00
Douglas Gregor
bb3e12fc0b
Handle C++ delete expressions when the overloaded delete operator is a
...
"usual deallocation function" with two arguments. CodeGen will have to
handle this case specifically, since the value for the second argument
(the size of the allocated object) may have to be computed at run
time.
Fixes the Sema part of PR4782.
llvm-svn: 83080
2009-09-29 18:16:17 +00:00
Anders Carlsson
8f4fd60c47
Handle CXXMemberCallExprs that point to a static method. Fixes PR5093.
...
llvm-svn: 83045
2009-09-29 03:54:11 +00:00
Anders Carlsson
9150a2a8c0
Handle CK_BaseToDerivedMemberPointer for member function pointers. Fixes PR5091.
...
llvm-svn: 83041
2009-09-29 03:13:20 +00:00
Anders Carlsson
b05a3e551b
Improve support for member function pointers.
...
llvm-svn: 83039
2009-09-29 02:09:01 +00:00
Anders Carlsson
1fb7ae9e3c
Use a switch statement in VisitCastExpr.
...
llvm-svn: 83038
2009-09-29 01:23:39 +00:00
Anders Carlsson
d30d820dc4
Make hasAggregateLLVMType use positive checks.
...
llvm-svn: 83037
2009-09-29 01:15:29 +00:00
Mike Stump
e7a2b48572
Fix http://llvm.org/PR5090 .
...
llvm-svn: 83035
2009-09-29 00:50:50 +00:00
Anders Carlsson
02bca738b4
Mangle dependent name expressions. Fixes PR5063.
...
llvm-svn: 82915
2009-09-27 20:11:34 +00:00
Anders Carlsson
d122de5f32
Use mangleTemplatePrefix when we know that we're mangling a nested template name.
...
llvm-svn: 82912
2009-09-27 19:53:49 +00:00
Anders Carlsson
52d78a518a
CodeGen for try statements. (We just emit the body for now).
...
llvm-svn: 82910
2009-09-27 18:58:34 +00:00
Anders Carlsson
9bf787ad1f
Look for substitutions when mangling TypenameTypes.
...
llvm-svn: 82885
2009-09-27 01:06:07 +00:00
Anders Carlsson
e00745b285
Better template parameter type mangling.
...
llvm-svn: 82883
2009-09-27 00:38:53 +00:00
Anders Carlsson
2e5935241a
Mangle std::basic_string<char, std::char_traits<char>, std::allocator<char> > as Ss.
...
llvm-svn: 82882
2009-09-27 00:12:57 +00:00
Anders Carlsson
853bb50382
Mangle ::std::basic_string as Sb.
...
llvm-svn: 82881
2009-09-26 23:14:39 +00:00
Anders Carlsson
872ce0dc31
Mangle ::std::allocator as Sa.
...
llvm-svn: 82880
2009-09-26 23:10:05 +00:00
Anders Carlsson
3e83c30c4c
Handle substitutions in mangleTemplatePrefix.
...
llvm-svn: 82879
2009-09-26 22:18:22 +00:00
Anders Carlsson
aa9e3c8793
Substitute "::std::" as "St".
...
llvm-svn: 82874
2009-09-26 20:53:44 +00:00
Anders Carlsson
49232b9f42
Don't crash when trying to mangle function templates.
...
llvm-svn: 82872
2009-09-26 20:13:56 +00:00
Anders Carlsson
26e67afd1e
mangleTemplatePrefix and mangleUnscopedTemplateName should take a TemplateDecl.
...
llvm-svn: 82871
2009-09-26 19:45:45 +00:00
Anders Carlsson
677475206c
Use the qualified name for tag types.
...
llvm-svn: 82870
2009-09-26 19:03:24 +00:00
Anders Carlsson
e33eed5c1e
Set alignment on static function level decls and VLAs. Fixes PR5060.
...
llvm-svn: 82868
2009-09-26 18:16:06 +00:00
Anders Carlsson
0374742326
Use ABIArgInfo::getDirect() for all types that have a pointer representation.
...
llvm-svn: 82845
2009-09-26 03:56:53 +00:00
Anders Carlsson
296f8dc52f
Mangle record types as decls.
...
llvm-svn: 82843
2009-09-26 03:55:37 +00:00
Anders Carlsson
9f8e3d1929
Change isTemplate to return the actual template declaration.
...
llvm-svn: 82839
2009-09-26 03:24:57 +00:00
Anders Carlsson
bdaaab4671
Improve mangling of typename types.
...
llvm-svn: 82833
2009-09-26 02:26:02 +00:00
Mike Stump
1dbb8f78a3
Fix 80-col violation.
...
llvm-svn: 82782
2009-09-25 18:11:00 +00:00
John McCall
0cf155174e
Fix an infinite loop arising when trying to generate debug information
...
for a ObjC class with an ivar of weak self type.
llvm-svn: 82745
2009-09-25 01:40:47 +00:00
Fariborz Jahanian
1f9ed58277
Fixed another code gen bug in objc's new write-barrier API.
...
llvm-svn: 82735
2009-09-25 00:00:20 +00:00
Mike Stump
d2a3e61798
Fix 80-col violation.
...
llvm-svn: 82725
2009-09-24 22:31:14 +00:00
Fariborz Jahanian
7a95d72b10
Patch fixes a code gen. bug in generation of objc_assign_ivar
...
(objc GC's API).
llvm-svn: 82724
2009-09-24 22:25:38 +00:00
John McCall
8ccfcb51ee
Refactor the representation of qualifiers to bring ExtQualType out of the
...
Type hierarchy. Demote 'volatile' to extended-qualifier status. Audit our
use of qualifiers and fix a few places that weren't dealing with qualifiers
quite right; many more remain.
llvm-svn: 82705
2009-09-24 19:53:00 +00:00
Daniel Dunbar
b3b1e53d33
Darwin/x86-32: Enumerated types and block pointer types in structures were not
...
handled correctly.
- <rdar://problem/7247671> Function arguments incorrect when function returns a
struct on i386 w/ llvm-g++ and clang
llvm-svn: 82681
2009-09-24 05:12:36 +00:00
Anders Carlsson
649a17e861
Handle namespace aliases.
...
llvm-svn: 82644
2009-09-23 19:19:16 +00:00
Anders Carlsson
f771681e63
Emit new[] cookie when needed.
...
llvm-svn: 82642
2009-09-23 18:59:48 +00:00
Anders Carlsson
b4bd0666d2
Basic support for new[].
...
llvm-svn: 82628
2009-09-23 16:07:23 +00:00
Anders Carlsson
d49844b715
Add a new variant of EmitCXXAggrConstructorCall that takes a Value that holds the number of elements to construct, to be used when implementing new[].
...
llvm-svn: 82602
2009-09-23 02:45:36 +00:00
Anders Carlsson
cc52f65500
Move codegen of new and delete to CGCXXExpr.cpp
...
llvm-svn: 82585
2009-09-22 22:53:17 +00:00
Mike Stump
17abe2a620
Remove now fixed FIXME.
...
llvm-svn: 82584
2009-09-22 22:31:44 +00:00
Anders Carlsson
8c978b4fc2
No need to null check implicit lvalue cast exprs.
...
llvm-svn: 82580
2009-09-22 22:00:46 +00:00
Anders Carlsson
8fef09cd80
When doing a derived-to-base class and the class offset is 0 we can just do a simple bitcast.
...
llvm-svn: 82579
2009-09-22 21:58:22 +00:00
Anders Carlsson
1d3b6f62df
CXXMethodDecls should always be mangled, even if they are inside an extern "C" block. Fixes PR5017.
...
llvm-svn: 82567
2009-09-22 20:33:31 +00:00
Anders Carlsson
fc51cc968b
Don't assert that linkage decls are always C++, it's not true. Fixes PR5019.
...
llvm-svn: 82557
2009-09-22 17:23:30 +00:00
Daniel Dunbar
b879c3c125
Revert "Switch a few clients over to StringLiteral::getString.", this is breaking some projects, but I don't have a test case yet.
...
llvm-svn: 82539
2009-09-22 10:03:52 +00:00
Daniel Dunbar
5de27daf93
Switch a few clients over to StringLiteral::getString.
...
- Switching all of them out-of-my-current-scope-of-interest, sorry.
llvm-svn: 82515
2009-09-22 03:27:52 +00:00
Mike Stump
207c680ff3
Fix some typos. WIP. Large alignments don't work yet.
...
llvm-svn: 82512
2009-09-22 02:44:17 +00:00
Mike Stump
2114d7c299
Improve debug info generation for __block variables.
...
llvm-svn: 82508
2009-09-22 02:12:52 +00:00
John McCall
9dd450bb78
Change all the Type::getAsFoo() methods to specializations of Type::getAs().
...
Several of the existing methods were identical to their respective
specializations, and so have been removed entirely. Several more 'leaf'
optimizations were introduced.
The getAsFoo() methods which imposed extra conditions, like
getAsObjCInterfacePointerType(), have been left in place.
llvm-svn: 82501
2009-09-21 23:43:11 +00:00
Fariborz Jahanian
71848a3ff1
Removed -fobjc-newgc-api option. clang now conforms to
...
gcc-style write-barrier api only.
llvm-svn: 82493
2009-09-21 23:03:37 +00:00
Fariborz Jahanian
38c3ae9bc4
Miscellanous fixes in generatation of objc gc's write-barriers.
...
llvm-svn: 82472
2009-09-21 18:54:29 +00:00
Chris Lattner
bf20638966
Implement __builtin_unreachable(), a GCC 4.5 extension.
...
llvm-svn: 82433
2009-09-21 03:09:59 +00:00
Anders Carlsson
a18322cea5
Start mangling expressions.
...
llvm-svn: 82423
2009-09-21 01:21:10 +00:00
Daniel Dunbar
9996138a80
Ok, an AssertingVH definitely doesn't work for now because we free our cache after the optimizer may have hacked on the module. Use a WeakVH instead.
...
llvm-svn: 82324
2009-09-19 20:17:48 +00:00
Nick Lewycky
41eaf0ac57
Make clang stop relying on ConstantStruct::get's default value for isPacked
...
which will be going away (ie. it's becoming a required parameter) later today.
llvm-svn: 82323
2009-09-19 20:00:52 +00:00
Daniel Dunbar
1cbaae56cf
Switch CGDebugInfo type cache to using an AssertingVH.
...
llvm-svn: 82321
2009-09-19 19:27:24 +00:00
Daniel Dunbar
de870bdcf2
Factor out CGDebugInfo::CreateTypeNode method.
...
- No functionality change.
llvm-svn: 82320
2009-09-19 19:27:14 +00:00
Anders Carlsson
82b688e423
More mangling work.
...
llvm-svn: 82265
2009-09-18 20:11:09 +00:00
Anders Carlsson
c3773bd669
Make the mangler conform even better to the grammar.
...
llvm-svn: 82262
2009-09-18 19:44:50 +00:00
Mike Stump
f9c95be2f6
Generate more of the vbase virtual offset for covariant thunks. WIP.
...
llvm-svn: 82253
2009-09-18 19:06:35 +00:00
Anders Carlsson
559d9741a8
More mangler mangling.
...
llvm-svn: 82250
2009-09-18 19:00:18 +00:00
Anders Carlsson
caf4a646f8
Call mangleTemplatePrefix.
...
llvm-svn: 82247
2009-09-18 18:47:07 +00:00
Anders Carlsson
c1370cb49b
Change manglePrefix to return early if the DC is the translation unit.
...
llvm-svn: 82246
2009-09-18 18:39:58 +00:00
Anders Carlsson
2b5e1dda69
More mangling goodness.
...
llvm-svn: 82193
2009-09-18 04:29:09 +00:00
Anders Carlsson
7a8a74f704
Handle mangling of TemplateSpecializationType.
...
llvm-svn: 82189
2009-09-18 02:42:01 +00:00
Fariborz Jahanian
2e32ddc7ba
Fixed a bug in generation of the new write-barriers when
...
array syntax is used to derefernce and assign to ivar pointee.
llvm-svn: 82183
2009-09-18 00:04:00 +00:00
Anders Carlsson
ca51ef156b
Ignore extern "C++" { } when mangling.
...
llvm-svn: 82146
2009-09-17 16:12:20 +00:00
Anders Carlsson
f96da57adb
Revert r82123 for now.
...
llvm-svn: 82125
2009-09-17 05:31:47 +00:00
Anders Carlsson
49fe8b4f97
Treat an unqualified RecordType as a RecordDecl when substituting.
...
llvm-svn: 82123
2009-09-17 04:38:23 +00:00
Anders Carlsson
4245bf9e13
Substitution for prefixes.
...
llvm-svn: 82122
2009-09-17 04:16:28 +00:00
Anders Carlsson
a2fb9bcd19
Substitute unscoped template names.
...
llvm-svn: 82119
2009-09-17 04:02:31 +00:00
Daniel Dunbar
df0e62d0a1
IRgen/ObjC: Correctly construct the function info for variadic message sends.
...
This fixes some bad -O0 codegen and the unnecessary clearing of al on entry to objc_msgSend for most message sends.
<rdar://problem/7102824> [irgen] unnecessary xorb on calls to objc_msgSend on x86_64
llvm-svn: 82118
2009-09-17 04:01:40 +00:00
Daniel Dunbar
aff9fcaa02
IRgen/ObjC: Make the target method decl available to GenerateMessageSendSuper.
...
llvm-svn: 82117
2009-09-17 04:01:22 +00:00
Anders Carlsson
a96f56fba8
Add mangleSubstitution/addSubstitution variants that take a NamedDecl.
...
llvm-svn: 82116
2009-09-17 03:53:28 +00:00
Anders Carlsson
df644fb773
When mangling function template specialization, mangle the type encoding of the original function template. Also, port mangle.cpp and function-template-specialization.cpp over to using FileCheck.
...
llvm-svn: 82114
2009-09-17 03:46:43 +00:00
Anders Carlsson
98e00bb162
Add new functions to the mangler for the <unscoped-name> and <unscoped-template-name> productions.
...
llvm-svn: 82113
2009-09-17 03:17:01 +00:00
Anders Carlsson
feb60501a8
Add basic substitution to the C++ mangler. It currently only looks at types.
...
llvm-svn: 82102
2009-09-17 00:43:46 +00:00
Fariborz Jahanian
de1d324dce
patch for generating objc'2 objc_assign_ivar. WIP.
...
llvm-svn: 82090
2009-09-16 23:11:23 +00:00
Fariborz Jahanian
a7fa6beb2e
Starting patch to generate more specific API for objc's
...
GC. Currently, new API will be generated under
clang-cc's -fobjc-newgc-api flag which will eventually
become the default. WIP.
llvm-svn: 82082
2009-09-16 21:37:16 +00:00
Fariborz Jahanian
4141deb68e
Removed a superfluous check before setting
...
a flag (objc GC).
llvm-svn: 82052
2009-09-16 16:49:08 +00:00
Anders Carlsson
20759ad54c
x86-64 ABI: If a type is a C++ record with either a non-trivial destructor or a non-trivial copy constructor, it should be passed in a pointer. Daniel, plz review.
...
llvm-svn: 82050
2009-09-16 15:53:40 +00:00
Mike Stump
c3844bea75
Be sure to use the correct version instead of inventing the wrong one.
...
llvm-svn: 81924
2009-09-15 21:48:34 +00:00
Anders Carlsson
1450adbbf9
Code generation of Conditional operators that are lvalues (but that aren't bitfields).
...
llvm-svn: 81867
2009-09-15 16:35:24 +00:00
Anders Carlsson
7cd39e0721
Handle reinterpret_cast between integral types and pointer types.
...
llvm-svn: 81837
2009-09-15 04:48:33 +00:00
Anders Carlsson
04c3bf4fab
Codegen support for nullptr from C++0x.
...
llvm-svn: 81835
2009-09-15 04:39:46 +00:00
Daniel Dunbar
09d3362bf5
ARM/[A]APCS: Ignore empty records passed as arguments.
...
llvm-svn: 81798
2009-09-14 21:54:03 +00:00
David Chisnall
2997982ab4
Small fix to stop CGObjCGNU emitting symbols that break some versions of gas.
...
llvm-svn: 81778
2009-09-14 19:04:10 +00:00
Anders Carlsson
ddf57d3df9
Remove an unnecessary FunctionDecl parameter to the synthesizing functions.
...
llvm-svn: 81759
2009-09-14 05:32:02 +00:00
Daniel Dunbar
ff0553ec61
Fix subtle bug in generating LLVM function declarations for builtin functions.
...
The decl wasn't being passed down, which meant that function attributes were not
being set correctly. This is particularly important for ARM, since it wants to
override the calling convention. Instead we would emit the builtin with the
wrong calling convention, and instcombine would come along and merrily shred all
the calls to it. :)
llvm-svn: 81756
2009-09-14 04:33:21 +00:00
Daniel Dunbar
d53bac7fa4
ARM/APCS: Don't treat structs w/ floating point types as "integer like".
...
llvm-svn: 81748
2009-09-14 02:20:34 +00:00
Anders Carlsson
aedb46fe21
If a function call returns a reference, don't bind it to a temporary.
...
llvm-svn: 81743
2009-09-14 01:30:44 +00:00
Anders Carlsson
96bad9a5cd
Implement CodeGenFunction::EmitCXXExprWithTemporariesLValue.
...
llvm-svn: 81738
2009-09-14 01:10:45 +00:00
Daniel Dunbar
1ce7251a0a
Some minor clang/ARM/AAPCS tweaks.
...
llvm-svn: 81737
2009-09-14 00:56:55 +00:00
Daniel Dunbar
b4091a9c6a
Add TargetInfo::getABI(), and base ARM APCS vs AAPCS choice on that.
...
llvm-svn: 81735
2009-09-14 00:35:03 +00:00
Anders Carlsson
8783737029
Handle delete where the class has a virtual destructor.
...
llvm-svn: 81733
2009-09-14 00:16:25 +00:00
Anders Carlsson
ccbabc9645
Fix another byref bug. This should hopefully get QuickLookPlugins building successfully.
...
llvm-svn: 81681
2009-09-13 17:55:13 +00:00
Daniel Dunbar
626f1d8c3a
ARM/APCS: Only "integer like" aggregates should be returned in r0 (following
...
gcc's interpretation of APCS' somewhat loose specification).
llvm-svn: 81671
2009-09-13 08:03:58 +00:00
Douglas Gregor
299d76e901
Rework the way we determine whether an externally visible symbol is
...
generated for an inline function definition, taking into account C99
and GNU inline/extern inline semantics. This solution is simpler,
cleaner, and fixes PR4536.
llvm-svn: 81670
2009-09-13 07:46:26 +00:00
Daniel Dunbar
0482cfd790
Don't use the PredefinedExpr string as the global variable name, these don't
...
make very nice symbols, just use the function name.
llvm-svn: 81653
2009-09-12 23:06:21 +00:00
Chris Lattner
ee7bd3b204
whitespace fix
...
llvm-svn: 81644
2009-09-12 22:45:21 +00:00