Fariborz Jahanian
bb67b827d9
Patch to provide cast of objects in member access
...
excpression, if needed, and remove some ir-gen code
now unnencessary.
llvm-svn: 77490
2009-07-29 18:40:24 +00:00
Fariborz Jahanian
a399dfae19
More cleanup of data member access and then some.
...
llvm-svn: 77351
2009-07-28 18:54:57 +00:00
Fariborz Jahanian
5142fbd02e
More work toward data member access ir-gen.
...
llvm-svn: 77332
2009-07-28 17:38:28 +00:00
Owen Anderson
e05f2ed478
Update for LLVM API change.
...
llvm-svn: 77249
2009-07-27 21:00:51 +00:00
Anders Carlsson
cabdeb4932
Use the CGRecordLayoutBuilder even if there are no fields, because in C++ an empty class will have a padding byte.
...
llvm-svn: 77205
2009-07-27 17:10:54 +00:00
Fariborz Jahanian
dedf1e4b1a
ir-gen for non-virtual base class initialization
...
in constructors.
llvm-svn: 77087
2009-07-25 21:12:28 +00:00
Douglas Gregor
e8925dbc1d
Improve code generation for function template specializations:
...
- Track implicit instantiations vs. the not-yet-supported explicit
specializations
- Give implicit instantiations of function templates (and member
functions of class templates) linkonce_odr linkage.
- Improve name mangling for function template specializations,
including the template arguments of the instantiation and the return
type of the function.
Note that our name-mangling is improved, but not correct: we still
don't mangle substitutions, although the manglings we produce can be
demangled.
llvm-svn: 74466
2009-06-29 22:39:32 +00:00
Douglas Gregor
8f5d4423ca
Keep track of function template specializations, to eliminate
...
redundant, implicit instantiations of function templates and provide a
place where we can hang function template specializations.
llvm-svn: 74454
2009-06-29 20:59:39 +00:00
Douglas Gregor
77b50e1126
Implement implicit instantiation of the member functions of a class template
...
specialization. At present, all implicit instantiations occur at the
end of the translation unit.
llvm-svn: 73915
2009-06-22 23:06:13 +00:00
Anders Carlsson
a42ab8f3d5
Handle temporaries in default arguments.
...
llvm-svn: 73462
2009-06-16 03:37:31 +00:00
Anders Carlsson
8783543a6f
Don't assert when generating code with static_asserts.
...
llvm-svn: 73208
2009-06-11 21:22:55 +00:00
Anders Carlsson
fa7c608ecc
Fix a thinko.
...
llvm-svn: 72679
2009-06-01 00:26:14 +00:00
Anders Carlsson
ca50119a31
Check for null correctly for new expressions.
...
llvm-svn: 72678
2009-06-01 00:05:16 +00:00
Anders Carlsson
cba81fc4de
Improve irgen of 'new' further.
...
llvm-svn: 72677
2009-05-31 21:53:59 +00:00
Anders Carlsson
96c012ff8b
...and aggregate POD types.
...
llvm-svn: 72676
2009-05-31 21:12:26 +00:00
Anders Carlsson
60d0c2c1c2
Support for complex types.
...
llvm-svn: 72675
2009-05-31 21:07:58 +00:00
Anders Carlsson
ec71f61608
Better support for scalar POD types in 'new' expressions.
...
llvm-svn: 72674
2009-05-31 20:56:36 +00:00
Anders Carlsson
6f9dabff6d
Make sure to copy back arguments that can be changed by FindAllocationOverload. This fixes placement new. (Sebastian, please review).
...
llvm-svn: 72673
2009-05-31 20:26:12 +00:00
Anders Carlsson
1832f52b10
Very basic irgen support for new expressions.
...
llvm-svn: 72672
2009-05-31 20:21:44 +00:00
Eli Friedman
f7f9f68722
Some small fixes for fields of reference type.
...
llvm-svn: 72636
2009-05-30 21:09:44 +00:00
Douglas Gregor
14f5c132c1
Add a target triple, because this test depends on details of the x86-64 ABI
...
llvm-svn: 72503
2009-05-27 23:32:34 +00:00
Anders Carlsson
ddcbfe7b53
IRgen support for calls to functions that return references to aggregate exressions.
...
llvm-svn: 72479
2009-05-27 16:45:02 +00:00
Eli Friedman
751aa72b72
Fix up constant expression handling to deal with the address
...
of a reference correctly.
llvm-svn: 72463
2009-05-27 06:04:58 +00:00
Eli Friedman
55422ad068
Add IRGen support for local variables of reference type.
...
llvm-svn: 72462
2009-05-27 05:39:06 +00:00
Eli Friedman
b909bf4937
Add IRGen support for return statements in functions with reference
...
type.
llvm-svn: 72459
2009-05-27 04:56:12 +00:00
Anders Carlsson
4034a95dc8
Handle operator call expressions where the callee is a member function.
...
llvm-svn: 72458
2009-05-27 04:18:27 +00:00
Anders Carlsson
d8b7ae205e
Functions that return references can be rvalues as well.
...
llvm-svn: 72457
2009-05-27 03:37:57 +00:00
Anders Carlsson
ace7215dd4
Add another test.
...
llvm-svn: 72450
2009-05-27 01:46:48 +00:00
Anders Carlsson
4ae70ff9a3
Add support for emitting calls to functions that return references (as lvalues only for now)
...
llvm-svn: 72449
2009-05-27 01:45:47 +00:00
Douglas Gregor
28ad4b5da1
Make sure that CodeGen sees template instantiations.
...
llvm-svn: 72433
2009-05-26 20:50:29 +00:00
Eli Friedman
c21cb44de2
Handle the remaining unhandled cases in EmitReferenceBindingToExpr.
...
It would be nice if someone could write an ObjC++ testcase for the case
of passing a property returning a struct to a function taking a const
reference.
llvm-svn: 72159
2009-05-20 02:31:19 +00:00
Anders Carlsson
02bb7f0ac8
irgen for references to complex rvales (Very important...)
...
llvm-svn: 72157
2009-05-20 01:35:03 +00:00
Anders Carlsson
387f863dde
Bad anders.
...
llvm-svn: 72156
2009-05-20 01:27:39 +00:00
Anders Carlsson
ad007d44b6
Create a temporary if the lvalue is a bitfield. Reported by Eli.
...
llvm-svn: 72155
2009-05-20 01:24:22 +00:00
Anders Carlsson
145eae5224
Add support for binding references to scalar rvalues.
...
llvm-svn: 72153
2009-05-20 01:03:17 +00:00
Anders Carlsson
7d4c083c19
Bind references to lvalues correctly.
...
llvm-svn: 72150
2009-05-20 00:36:58 +00:00
Anders Carlsson
2d228cef50
Improve support for irgen of references.
...
llvm-svn: 72133
2009-05-19 20:40:02 +00:00
Anders Carlsson
23ca0b4869
Add support for converting member pointer types to LLVM types. Also mangle pointer to member functions correctly and add tests.
...
llvm-svn: 71981
2009-05-17 17:41:20 +00:00
Anders Carlsson
d3a69ceaaf
extern "C" should preserve the 'extern' qualifier for VarDecls. Fixes 6853728.
...
llvm-svn: 71957
2009-05-16 21:02:39 +00:00
Anders Carlsson
37604a0984
A C++ member function always has either weak linkage (if it's inline or defined inline) or strong linkage (other cases).
...
llvm-svn: 71873
2009-05-15 18:35:39 +00:00
Anders Carlsson
f6e9ece507
Name mangling for class template specializations and template arguments.
...
llvm-svn: 71861
2009-05-15 16:09:15 +00:00
Chris Lattner
e0be0dfced
push GlobalDecl through enough of the CodeGenModule interfaces
...
to allow us to support generation of deferred ctors/dtors.
It looks like codegen isn't emitting a call to the dtor in
member-functions.cpp:test2, but when it does, its body should
get emitted.
llvm-svn: 71594
2009-05-12 21:21:08 +00:00
Chris Lattner
d035ebda2f
add an initial stab at emitting deferred c++ inline functions. This handles static
...
functions and methods declared inline, but not ctors/dtors or methods not declared
inline (apparently my previous patch wasn't good enough).
llvm-svn: 71591
2009-05-12 21:02:27 +00:00
Chris Lattner
7d4f5c47ce
only support int128_t on 64-bit and larger targets. 32-bit targets don't
...
have support for __divti3 and friends.
llvm-svn: 70480
2009-04-30 06:18:40 +00:00
Chris Lattner
f122cef4df
initial support for __[u]int128_t, which should be basically
...
compatible with VC++ and GCC. The codegen/mangling angle hasn't
been fully ironed out yet. Note that we accept int128_t even in
32-bit mode, unlike gcc.
llvm-svn: 70464
2009-04-30 02:43:43 +00:00
Anders Carlsson
1235bbce7e
Use the new guard variable mangling function and get rid of the old code.
...
llvm-svn: 68971
2009-04-13 18:03:33 +00:00
Anders Carlsson
d8e39bbb84
Add support for generating reference initialization code.
...
llvm-svn: 68852
2009-04-11 01:08:03 +00:00
Anders Carlsson
03a409feda
We weren't generating correct code for calls to variadic member functions.
...
llvm-svn: 68635
2009-04-08 20:31:57 +00:00
Anders Carlsson
468fa6366b
Add some basic support for generating C++ member functions.
...
llvm-svn: 68425
2009-04-04 20:47:02 +00:00
Anders Carlsson
4eca109941
Implement mangling of declarations inside functions.
...
llvm-svn: 68321
2009-04-02 16:24:45 +00:00