#
88d292cc |
| 13-May-2010 |
Douglas Gregor <dgregor@apple.com> |
Rework when and how vtables are emitted, by tracking where vtables are "used" (e.g., we will refer to the vtable in the generated code) and when they are defined (i.e., because we've seen the key fun
Rework when and how vtables are emitted, by tracking where vtables are "used" (e.g., we will refer to the vtable in the generated code) and when they are defined (i.e., because we've seen the key function definition). Previously, we were effectively tracking "potential definitions" rather than uses, so we were a bit too eager about emitting vtables for classes without key functions.
The new scheme: - For every use of a vtable, Sema calls MarkVTableUsed() to indicate the use. For example, this occurs when calling a virtual member function of the class, defining a constructor of that class type, dynamic_cast'ing from that type to a derived class, casting to/through a virtual base class, etc. - For every definition of a vtable, Sema calls MarkVTableUsed() to indicate the definition. This happens at the end of the translation unit for classes whose key function has been defined (so we can delay computation of the key function; see PR6564), and will also occur with explicit template instantiation definitions. - For every vtable defined/used, we mark all of the virtual member functions of that vtable as defined/used, unless we know that the key function is in another translation unit. This instantiates virtual member functions when needed. - At the end of the translation unit, Sema tells CodeGen (via the ASTConsumer) which vtables must be defined (CodeGen will define them) and which may be used (for which CodeGen will define the vtables lazily).
From a language perspective, both the old and the new schemes are permissible: we're allowed to instantiate virtual member functions whenever we want per the standard. However, all other C++ compilers were more lazy than we were, and our eagerness was both a performance issue (we instantiated too much) and a portability problem (we broke Boost test cases, which now pass).
Notes: (1) There's a ton of churn in the tests, because the order in which vtables get emitted to IR has changed. I've tried to isolate some of the larger tests from these issues. (2) Some diagnostics related to implicitly-instantiated/implicitly-defined virtual member functions have moved to the point of first use/definition. It's better this way. (3) I could use a review of the places where we MarkVTableUsed, to see if I missed any place where the language effectively requires a vtable.
Fixes PR7114 and PR6564.
llvm-svn: 103718
show more ...
|
Revision tags: llvmorg-2.7.0 |
|
#
731be662 |
| 04-Mar-2010 |
John McCall <rjmccall@apple.com> |
Revert changes r97693, r97700, and r97718.
Our testing framework can't deal with disabled targets yet.
llvm-svn: 97719
|
#
6abe39c6 |
| 04-Mar-2010 |
John McCall <rjmccall@apple.com> |
Create a TargetMachine whenever we create a CodeGenAction. The codegen of some builtins will rely on target knowledge.
llvm-svn: 97693
|
#
e017ecc9 |
| 19-Dec-2009 |
Daniel Dunbar <daniel@zuster.org> |
Remove ';' after method definition. Noticed by clang++, which one would think would have a higher respect for its own code. This is getting old, is this warning really adding value?
llvm-svn: 91779
|
#
337e3a5f |
| 28-Nov-2009 |
Benjamin Kramer <benny.kra@googlemail.com> |
Remove remaining VISIBILITY_HIDDEN from anonymous namespaces.
llvm-svn: 90044
|
#
bc55fe26 |
| 12-Nov-2009 |
Chandler Carruth <chandlerc@gmail.com> |
Move CompileOptions -> CodeGenOptions, and sink it into the CodeGen library. This resolves the layering violation where CodeGen depended on Frontend.
llvm-svn: 86998
|
Revision tags: llvmorg-2.6.0 |
|
#
11289f42 |
| 09-Sep-2009 |
Mike Stump <mrs@apple.com> |
Remove tabs, and whitespace cleanups.
llvm-svn: 81346
|
#
40165180 |
| 24-Aug-2009 |
Daniel Dunbar <daniel@zuster.org> |
Switch TargetInfo to store an llvm::Triple. - Primarily to discourage clients form making decisions based on the string.
llvm-svn: 79901
|
#
ecaeaa81 |
| 01-Jul-2009 |
Owen Anderson <resistor@mac.com> |
Update for changes in LLVM. Hopefully this is the last one for a while.
llvm-svn: 74657
|
#
03200753 |
| 01-Jul-2009 |
Owen Anderson <resistor@mac.com> |
Hold the LLVMContext by reference instead of by pointer.
llvm-svn: 74642
|
#
d9dd77ff |
| 01-Jul-2009 |
Owen Anderson <resistor@mac.com> |
Update for LLVMContext+Module change.
llvm-svn: 74615
|
#
beecd58e |
| 21-Apr-2009 |
Douglas Gregor <dgregor@apple.com> |
Explictly track tentative definitions within Sema, then hand those tentative definitions off to the ASTConsumer at the end of the translation unit.
Eliminate CodeGen's internal tracking of tentativ
Explictly track tentative definitions within Sema, then hand those tentative definitions off to the ASTConsumer at the end of the translation unit.
Eliminate CodeGen's internal tracking of tentative definitions, and instead hook into ASTConsumer::CompleteTentativeDefinition. Also, tweak the definition-deferal logic for C++, where there are no tentative definitions.
Fixes <rdar://problem/6808352>, and will make it much easier for precompiled headers to cope with tentative definitions in the future.
llvm-svn: 69681
show more ...
|
#
5bbb3c8a |
| 29-Mar-2009 |
Chris Lattner <sabre@nondot.org> |
Push DeclGroup much farther throughout the compiler. Now the various productions (except the already broken ObjC cases like @class X,Y;) in the parser that can produce more than one Decl return a D
Push DeclGroup much farther throughout the compiler. Now the various productions (except the already broken ObjC cases like @class X,Y;) in the parser that can produce more than one Decl return a DeclGroup instead of a Decl, etc.
This allows elimination of the Decl::NextDeclarator field, and exposes various clients that should look at all decls in a group, but which were only looking at one (such as the dumper, printer, etc). These have been fixed.
Still TODO:
1) there are some FIXME's in the code about potentially using DeclGroup for better location info. 2) ParseObjCAtDirectives should return a DeclGroup due to @class etc. 3) I'm not sure what is going on with StmtIterator.cpp, or if it can be radically simplified now. 4) I put a truly horrible hack in ParseTemplate.cpp.
I plan to bring up #3/4 on the mailing list, but don't plan to tackle #1/2 in the short term.
llvm-svn: 68002
show more ...
|
#
cf169831 |
| 28-Mar-2009 |
Chris Lattner <sabre@nondot.org> |
change HandleTranslationUnit to take an ASTContext instead of TranslationUnit
llvm-svn: 67910
|
#
984fac5f |
| 26-Mar-2009 |
Chris Lattner <sabre@nondot.org> |
most of this is plumbing to get CompileOptions down into CodeGenModule. Once there, add a new NoCommon option to it and implement -fno-common.
llvm-svn: 67735
|
Revision tags: llvmorg-2.5.0 |
|
#
4b4f67ac |
| 17-Feb-2009 |
Argyrios Kyrtzidis <akyrtzi@gmail.com> |
Remove some redundant Decl -> Decl castings.
llvm-svn: 64804
|
#
6e6ad602 |
| 20-Jan-2009 |
Douglas Gregor <dgregor@apple.com> |
Remove ScopedDecl, collapsing all of its functionality into Decl, so that every declaration lives inside a DeclContext.
Moved several things that don't have names but were ScopedDecls (and, therefor
Remove ScopedDecl, collapsing all of its functionality into Decl, so that every declaration lives inside a DeclContext.
Moved several things that don't have names but were ScopedDecls (and, therefore, NamedDecls) to inherit from Decl rather than NamedDecl, including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't store empty DeclarationNames for these things, nor do we try to insert them into DeclContext's lookup structure.
The serialization tests are temporarily disabled. We'll re-enable them once we've sorted out the remaining ownership/serialiazation issues between DeclContexts and TranslationUnion, DeclGroups, etc.
llvm-svn: 62562
show more ...
|
Revision tags: llvmorg-2.4.0 |
|
#
30c514e7 |
| 21-Oct-2008 |
Daniel Dunbar <daniel@zuster.org> |
Add GetModule accessor to ModuleBuilder
llvm-svn: 57924
|
#
fce4be84 |
| 15-Aug-2008 |
Daniel Dunbar <daniel@zuster.org> |
Clean up CodeGenModule interface. - Add CodeGenModule::EmitTopLevelDecl which uses switch on kind instead of ugly & slow dyn_cast chains.
- Drop some simple forwarding methods into the ObjC run
Clean up CodeGenModule interface. - Add CodeGenModule::EmitTopLevelDecl which uses switch on kind instead of ugly & slow dyn_cast chains.
- Drop some simple forwarding methods into the ObjC runtime.
- Privatize appropriate methods.
llvm-svn: 54827
show more ...
|
#
89da6ad1 |
| 13-Aug-2008 |
Daniel Dunbar <daniel@zuster.org> |
Change ObjCRuntime GenerateProtocol[Ref] methods to take ObjCProtocolDecl directly.
Implement CodeGen support for forward protocol decls (no-ops are so nice to implement).
Also moved CGObjC
Change ObjCRuntime GenerateProtocol[Ref] methods to take ObjCProtocolDecl directly.
Implement CodeGen support for forward protocol decls (no-ops are so nice to implement).
Also moved CGObjCRuntime.h out of CodeGenModule.h
llvm-svn: 54709
show more ...
|
#
3ad53483 |
| 11-Aug-2008 |
Daniel Dunbar <daniel@zuster.org> |
Add LangOptions::NeXTRuntime. - Wired to -fnext-runtime and -fgnu-runtime options. - Defaults to GNU, no autoselection for NeXT.
Emit NeXT OBJC_IMAGE_INFO marker.
llvm-svn: 54651
|
#
56fdb6ae |
| 11-Aug-2008 |
Daniel Dunbar <daniel@zuster.org> |
More #include cleaning - Kill unnecessary #includes in .cpp files. This is an automatic sweep so some things removed are actually used, but happen to be included by a previous header. I tried
More #include cleaning - Kill unnecessary #includes in .cpp files. This is an automatic sweep so some things removed are actually used, but happen to be included by a previous header. I tried to get rid of the obvious examples and this was the easiest way to trim the #includes in one fell swoop. - We now return to regularly scheduled development.
llvm-svn: 54632
show more ...
|
#
221fa94e |
| 11-Aug-2008 |
Daniel Dunbar <daniel@zuster.org> |
More #include cleaning - Drop Expr.h,RecordLayout.h from ASTContext.h (for DeclBase.h and SourceLocation.h) - Move ASTContext constructor into implementation
llvm-svn: 54627
|
#
303e2c2f |
| 11-Aug-2008 |
Daniel Dunbar <daniel@zuster.org> |
Add dummy Mac Objective-C runtime interface. - Not currently accessible and completely non-functional.
llvm-svn: 54624
|
#
53c362e3 |
| 09-Aug-2008 |
Nico Weber <nicolasweber@gmx.de> |
80 cols
llvm-svn: 54599
|