Anders Carlsson
537fdceded
Move GetLLVMVisibility to CodeGenModule.
...
llvm-svn: 124550
2011-01-29 20:59:35 +00:00
Anders Carlsson
678632fa42
Add RTTIBuilder::GetAddrOfTypeName which uses the newly added CreateOrReplaceCXXRuntimeVariable.
...
Set the visibility for typeinfo names.
llvm-svn: 124548
2011-01-29 20:36:11 +00:00
Anders Carlsson
265aa7c070
Change CodeGenModule::setTypeVisibility to take a TypeVisibilityKind enum instead of an "IsForRTTI" flag.
...
llvm-svn: 124546
2011-01-29 20:24:48 +00:00
Anders Carlsson
072ef7420a
Replace an isa/cast with a dyn_cast.
...
llvm-svn: 124542
2011-01-29 19:41:00 +00:00
Anders Carlsson
c6a47895f7
Get rid of an unneeded parameter from setGlobalVisibility.
...
llvm-svn: 124541
2011-01-29 19:39:23 +00:00
Anders Carlsson
5963024ff6
Give VTTs the right visibility.
...
llvm-svn: 124540
2011-01-29 19:34:19 +00:00
Anders Carlsson
883fc72c3c
Make emitting a VTT a two-step process, much like emitting a VTable. You first get the address of the VTT, and then pass it to EmitVTTDefinition.
...
llvm-svn: 124539
2011-01-29 19:16:51 +00:00
Anders Carlsson
93be9a90cc
Use CGM.CreateOrReplaceCXXRuntimeVariable in CGVTables.cpp
...
llvm-svn: 124538
2011-01-29 18:25:07 +00:00
Anders Carlsson
da80af3681
Add a new function, to be used by CGRTTI, CGVTables and CGVTT (which each has their own copy of this code).
...
llvm-svn: 124537
2011-01-29 18:20:20 +00:00
Ken Dyck
a45a70cf73
Replace a literal '8' with getCharWidth().
...
llvm-svn: 124536
2011-01-29 17:53:12 +00:00
Anders Carlsson
fd4834061c
Remove IsDefinition from CodeGenModule::setTypeVisibility; it is always true.
...
llvm-svn: 124529
2011-01-29 05:26:32 +00:00
Anders Carlsson
6b3afd7df1
When trying to get the most derived class, don't assume that we can ignore all casts. We can only ignore derived-to-base and no-op casts. Fixes selfhost.
...
llvm-svn: 124528
2011-01-29 05:04:11 +00:00
Anders Carlsson
1ae64c5a9d
When calling a virtual member function on a base class and the most derived class is marked 'final', we can devirtualize the call.
...
llvm-svn: 124524
2011-01-29 03:52:01 +00:00
Anders Carlsson
a376b53695
When doing a derived-to-base class through a virtual class, we don't have to get the vbase offset from the vtable if the derived class is marked final.
...
llvm-svn: 124523
2011-01-29 03:18:56 +00:00
Fariborz Jahanian
9f9438b314
More work to support -fapple-kext regarding
...
indirect vf calls and addition of extra entry
at bottom of vtbls.
llvm-svn: 124507
2011-01-28 23:42:29 +00:00
John McCall
b91ab89729
Add my new file to the CMake lists, sorry about that.
...
llvm-svn: 124503
2011-01-28 20:10:46 +00:00
John McCall
ed1ae86ac6
Move all the cleanups framework code into a single file.
...
Pure motion.
llvm-svn: 124484
2011-01-28 11:13:47 +00:00
John McCall
cb5f77f046
Reorganize the value-dominance metaprogram and introduce a specialization
...
for CodeGen's RValue type.
llvm-svn: 124483
2011-01-28 10:53:53 +00:00
John McCall
e4df6c8d96
Convert the exception-freeing cleanup over to the conditional cleanups code,
...
fixing a crash which probably nobody was ever going to see. In doing so,
fix a horrendous number of problems with the conditional-cleanups code.
Also, make conditional cleanups re-use the cleanup's activation variable,
which avoids some unfortunate repetitiveness.
llvm-svn: 124481
2011-01-28 08:37:24 +00:00
Douglas Gregor
21d3fca917
When producing IR for a lvalue-to-rvalue cast *as an lvalue*, only
...
non-class prvalues actually require the realization of a
temporary. For everything else, we already have an lvalue (or class
prvalue) in the subexpression.
Note: we're missing some move elision in this case. I'll tackle that next.
llvm-svn: 124453
2011-01-27 23:22:05 +00:00
John McCall
284c48fff6
Do a proper recursive lookup when deciding whether a class's usual
...
deallocation function has a two-argument form. Store the result of this
check in new[] and delete[] nodes.
Fixes rdar://problem/8913519
llvm-svn: 124373
2011-01-27 09:37:56 +00:00
John McCall
2903675929
Notes on dynamic array cookies in MSVC.
...
My thanks to chapuni for his help in investigating this.
llvm-svn: 124351
2011-01-27 02:46:02 +00:00
Fariborz Jahanian
2f2fa7284b
Fixes an IRgen bug where __block variable is
...
referenced in the block-literal initializer
of that variable. // rdar://8893785
llvm-svn: 124332
2011-01-26 23:08:27 +00:00
John McCall
0a6bf2ebe2
Un-nest the meat of this function.
...
llvm-svn: 124310
2011-01-26 19:21:13 +00:00
John McCall
f256eb54a2
Fix some obvious bugs in the conditional-cleanup code and then make the
...
dtor cleanup use it.
llvm-svn: 124309
2011-01-26 19:15:39 +00:00
John McCall
ce1de6172c
Better framework for conditional cleanups; untested as yet.
...
I'm separately committing this because it incidentally changes some
block orderings and minor IR issues, like using a phi instead of
an unnecessary alloca.
llvm-svn: 124277
2011-01-26 04:00:11 +00:00
Nico Weber
2992efa403
Add -add-plugin flag, which runs plugins in addition to codegen.
...
llvm-svn: 124227
2011-01-25 20:34:14 +00:00
Eric Christopher
23ec82fa47
Revert r124146 for now. It appears to be failing on a few platforms.
...
llvm-svn: 124153
2011-01-24 23:07:03 +00:00
Anton Yartsev
3bad9afaba
pre/post increase/decrease for AltiVec vectors
...
llvm-svn: 124146
2011-01-24 20:55:22 +00:00
Anders Carlsson
1eb95961d3
Use attributes for all the override control specifiers.
...
llvm-svn: 124122
2011-01-24 16:26:15 +00:00
Anders Carlsson
75286a7470
When building a type info struct for EH, we always want it to have linkonce_odr linkage.
...
llvm-svn: 124096
2011-01-24 02:12:11 +00:00
Anders Carlsson
68d3424b8c
Change CodeGenModule::getVTableLinkage to be a non-static member function.
...
llvm-svn: 124095
2011-01-24 02:04:33 +00:00
Anders Carlsson
ba840fb73c
"Name" a bool parameter.
...
llvm-svn: 124094
2011-01-24 01:59:49 +00:00
Anders Carlsson
571e2ad042
Mark VTables and RTTI data linkonce_odr instead of weak_odr, with the exception of explicit template instantiations, which have to be weak_odr.
...
This fixes PR6996.
llvm-svn: 124089
2011-01-24 00:46:19 +00:00
Anders Carlsson
19588aa40b
Get rid of the [[final]] C++0x attribute.
...
llvm-svn: 124083
2011-01-23 21:07:30 +00:00
Ted Kremenek
582a0999fb
Null initialize a few variables flagged by
...
clang's -Wuninitialized-experimental warning.
While these don't look like real bugs, clang's
-Wuninitialized-experimental analysis is stricter
than GCC's, and these fixes have the benefit
of being general nice cleanups.
llvm-svn: 124072
2011-01-23 17:04:59 +00:00
Benjamin Kramer
1e1888979b
Use a FunctionType::get overload that doesn't require an empty vector.
...
llvm-svn: 124029
2011-01-22 12:15:57 +00:00
Douglas Gregor
9c399a29fd
Send code generation for xvalues down the same path as lvalues
...
llvm-svn: 124023
2011-01-22 02:44:21 +00:00
Douglas Gregor
b8c7fe9dc9
Debug info generation for rvalue references
...
llvm-svn: 124020
2011-01-22 01:58:15 +00:00
Fariborz Jahanian
252a47f635
Move cheking of kext into canDevirtualizeMemberFunctionCalls().
...
Improve on test case. Per Doug's comment. wip.
llvm-svn: 123954
2011-01-21 01:04:41 +00:00
Fariborz Jahanian
47609b088c
apple kext abi requires all vf calls, including qualified
...
vf calls, be made indirect. This patch is towards that goal.
llvm-svn: 123922
2011-01-20 17:19:02 +00:00
Ken Dyck
7d381c48fe
Add CharUnits::RoundUpToAlignment() to simplify rounding in character units.
...
llvm-svn: 123868
2011-01-20 01:59:55 +00:00
John McCall
424cec97bd
Change QualType::getTypePtr() to return a const pointer, then change a
...
thousand other things which were (generally inadvertantly) relying on that.
llvm-svn: 123814
2011-01-19 06:33:43 +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
Devang Patel
d2d6665c71
Emit DW_TAG_lexical_scope to surround foreach.
...
llvm-svn: 123802
2011-01-19 01:36:36 +00:00
NAKAMURA Takumi
e03c603624
lib/CodeGen/TargetInfo.cpp: Fix coding style and erase an obsolete comment.
...
llvm-svn: 123790
2011-01-19 00:11:33 +00:00
Rafael Espindola
d661a853fd
Add unnamed_addr in CreateRuntimeVariable.
...
llvm-svn: 123773
2011-01-18 21:07:57 +00:00
Francois Pichet
6422579411
Add support for explicit constructor calls in Microsoft mode.
...
For example:
class A{
public:
A& operator=(const A& that) {
if (this != &that) {
this->A::~A();
this->A::A(that); // <=== explicit constructor call.
}
return *this;
}
};
More work will be needed to support an explicit call to a template constructor.
llvm-svn: 123735
2011-01-18 05:04:39 +00:00
Ken Dyck
9a6486934c
Replace calls to CharUnits::fromQuantity() with ones to
...
ASTContext::toCharUnitsFromBits() when converting from bit sizes to char units.
llvm-svn: 123720
2011-01-18 02:01:14 +00:00
Jeffrey Yasskin
8dfa5f1776
Fix warnings found by gcc-4.6, from -Wunused-but-set-variable and
...
-Wint-to-pointer-cast.
llvm-svn: 123719
2011-01-18 02:00:16 +00:00