#
40f2fa9a |
| 04-Aug-2013 |
Timur Iskhodzhanov <timurrrr@google.com> |
Emit the constructor for abstract classes when using -cxx-abi microsoft, fixes PR16735
llvm-svn: 187709
|
#
e7de47ef |
| 22-Jul-2013 |
Reid Kleckner <reid@kleckner.net> |
[ms-cxxabi] Emit linkonce complete dtors in TUs that need them
Based on Peter Collingbourne's destructor patches.
Prior to this change, clang was considering ?1 to be the complete destructor and th
[ms-cxxabi] Emit linkonce complete dtors in TUs that need them
Based on Peter Collingbourne's destructor patches.
Prior to this change, clang was considering ?1 to be the complete destructor and the base destructor, which was wrong. This lead to crashes when clang tried to emit two LLVM functions with the same name.
In this ABI, TUs with non-inline dtors might not emit a complete destructor. They are emitted as inline thunks in TUs that need them, and they always delegate to the base dtors of the complete class and its virtual bases. This change uses the DeferredDecls machinery to emit complete dtors as needed.
Currently in clang try body destructors can catch exceptions thrown by virtual base destructors. In the Microsoft C++ ABI, clang may not have the destructor definition, in which case clang won't wrap the virtual virtual base destructor calls in a try-catch. Diagnosing this in user code is TODO.
Finally, for classes that don't use virtual inheritance, MSVC always calls the base destructor (?1) directly. This is a useful code size optimization that avoids emitting lots of extra thunks or aliases. Implementing it also means our existing tests continue to pass, and is consistent with MSVC's output.
We can do the same for Itanium by tweaking GetAddrOfCXXDestructor, but it will require further testing.
Reviewers: rjmccall
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1066
llvm-svn: 186828
show more ...
|
#
f6ce2b5f |
| 22-Jul-2013 |
Reid Kleckner <reid@kleckner.net> |
Rename D to GD to match the type, which is GlobalDecl
Now we can save GD.getDecl() in D and shorten some casts.
llvm-svn: 186826
|
#
8d0dc31d |
| 21-Jul-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Tighten up the set of operator new/operator delete calls we're permitted to optimize, to follow the permissions granted in N3664. Under those rules, only calls generated by new-expressions and delete
Tighten up the set of operator new/operator delete calls we're permitted to optimize, to follow the permissions granted in N3664. Under those rules, only calls generated by new-expressions and delete-expressions are permitted to be optimized, and direct calls to ::operator new and ::operator delete must be treated as normal calls.
llvm-svn: 186799
show more ...
|
#
8978a9dd |
| 10-Jul-2013 |
Eli Friedman <eli.friedman@gmail.com> |
Get rid of dead/useless code for block mangling.
llvm-svn: 185989
|
Revision tags: llvmorg-3.3.1-rc1 |
|
#
c48d31c3 |
| 01-Jul-2013 |
Eli Friedman <eli.friedman@gmail.com> |
Simplify linkage code for static local vars.
The key insight here is that weak linkage for a static local variable should always mean linkonce_odr, because every file that needs it will generate a d
Simplify linkage code for static local vars.
The key insight here is that weak linkage for a static local variable should always mean linkonce_odr, because every file that needs it will generate a definition. We don't actually care about the precise linkage of the parent context. I feel a bit silly that I didn't realize this before.
llvm-svn: 185381
show more ...
|
#
7e346a81 |
| 01-Jul-2013 |
Eli Friedman <eli.friedman@gmail.com> |
Fix mangling for block literals.
Blocks, like lambdas, can be written in contexts which are required to be treated as the same under ODR. Unlike lambdas, it isn't possible to actually take the addr
Fix mangling for block literals.
Blocks, like lambdas, can be written in contexts which are required to be treated as the same under ODR. Unlike lambdas, it isn't possible to actually take the address of a block, so the mangling of the block itself doesn't matter. However, objects like static variables inside a block do need to be mangled in a consistent way.
There are basically three components here. One, block literals need a consistent numbering. Two, objects/types inside a block literal need to be mangled using it. Three, objects/types inside a block literal need to have their linkage computed correctly.
llvm-svn: 185372
show more ...
|
#
9dc6eef7 |
| 30-Jun-2013 |
Stephen Lin <stephenwlin@gmail.com> |
Restore r184205 and associated commits (after commit of r185290)
This allows clang to use the backend parameter attribute 'returned' when generating 'this'-returning constructors and destructors in
Restore r184205 and associated commits (after commit of r185290)
This allows clang to use the backend parameter attribute 'returned' when generating 'this'-returning constructors and destructors in ARM and MSVC C++ ABIs.
llvm-svn: 185291
show more ...
|
#
19cee187 |
| 19-Jun-2013 |
Stephen Lin <stephenwlin@gmail.com> |
Revert r184205 and associated patches while investigating issue with broken buildbot (possible interaction with LTO)
<rdar://problem/14209661>
llvm-svn: 184384
|
#
9157b55c |
| 19-Jun-2013 |
NAKAMURA Takumi <geek4civic@gmail.com> |
Fix a warning. [-Wunused-variable]
llvm-svn: 184284
|
#
9691f7fa |
| 19-Jun-2013 |
Manman Ren <mren@apple.com> |
Debug Info: support for gdwarf-2 gdwarf-3 gdwarf-4
These options will add a module flag with name "Dwarf Version". The behavior flag is currently set to Warning, so when two values disagree, a warni
Debug Info: support for gdwarf-2 gdwarf-3 gdwarf-4
These options will add a module flag with name "Dwarf Version". The behavior flag is currently set to Warning, so when two values disagree, a warning will be emitted.
llvm-svn: 184276
show more ...
|
#
a637fb8c |
| 18-Jun-2013 |
Stephen Lin <stephenwlin@gmail.com> |
CodeGen: Have 'this'-returning constructors and destructors to take advantage of the new backend 'returned' attribute.
The backend will now use the generic 'returned' attribute to form tail calls wh
CodeGen: Have 'this'-returning constructors and destructors to take advantage of the new backend 'returned' attribute.
The backend will now use the generic 'returned' attribute to form tail calls where possible, as well as avoid save-restores of 'this' in some cases (specifically the cases that matter for the ARM C++ ABI).
This patch also reverts a prior front-end only partial implementation of these optimizations, since it's no longer required.
llvm-svn: 184205
show more ...
|
#
a509f2fd |
| 14-Jun-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Emit initializers for static-storage-duration temporaries as constants where possible.
llvm-svn: 183967
|
#
d4b6e7a9 |
| 13-Jun-2013 |
Eli Friedman <eli.friedman@gmail.com> |
Fix the linkage of static locals inside a CapturedStmt. (Found in the process of trying to fix the related issue for block literals.)
llvm-svn: 183951
|
#
cc1b96d3 |
| 12-Jun-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR12086, PR15117
Introduce CXXStdInitializerListExpr node, representing the implicit construction of a std::initializer_list<T> object from its underlying array. The AST representation of such an ex
PR12086, PR15117
Introduce CXXStdInitializerListExpr node, representing the implicit construction of a std::initializer_list<T> object from its underlying array. The AST representation of such an expression goes from an InitListExpr with a flag set, to a CXXStdInitializerListExpr containing a MaterializeTemporaryExpr containing an InitListExpr (possibly wrapped in a CXXBindTemporaryExpr).
This more detailed representation has several advantages, the most important of which is that the new MaterializeTemporaryExpr allows us to directly model lifetime extension of the underlying temporary array. Using that, this patch *drastically* simplifies the IR generation of this construct, provides IR generation support for nested global initializer_list objects, fixes several bugs where the destructors for the underlying array would accidentally not get invoked, and provides constant expression evaluation support for std::initializer_list objects.
llvm-svn: 183872
show more ...
|
Revision tags: llvmorg-3.3.0 |
|
#
4d90dba7 |
| 05-Jun-2013 |
Peter Collingbourne <peter@pcc.me.uk> |
[ms-cxxabi] Thread GlobalDecls through to CodeGenModule::getFunctionLinkage.
This is so that we can give destructor variants different linkage later.
Differential Revision: http://llvm-reviews.chan
[ms-cxxabi] Thread GlobalDecls through to CodeGenModule::getFunctionLinkage.
This is so that we can give destructor variants different linkage later.
Differential Revision: http://llvm-reviews.chandlerc.com/D819
llvm-svn: 183324
show more ...
|
#
e6c01442 |
| 05-Jun-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Model temporary lifetime-extension explicitly in the AST. Use this model to handle temporaries which have been lifetime-extended to static storage duration within constant expressions. This correctly
Model temporary lifetime-extension explicitly in the AST. Use this model to handle temporaries which have been lifetime-extended to static storage duration within constant expressions. This correctly handles nested lifetime extension (through reference members of aggregates in aggregate initializers) but non-constant-expression emission hasn't yet been updated to do the same.
llvm-svn: 183283
show more ...
|
Revision tags: llvmorg-3.3.0-rc3 |
|
#
5d041beb |
| 04-Jun-2013 |
Aaron Ballman <aaron@aaronballman.com> |
Adding support for MSVC #pragma detect_mismatch functionality by emitting a FAILIFMISMATCH linker command into the object file.
llvm-svn: 183178
|
#
5f2b1ce2 |
| 24-May-2013 |
Diego Novillo <dnovillo@google.com> |
[PATCH] Generate cold attribute for functions marked __atribute__((cold))
This removes a FIXME in CodeGenModule::SetLLVMFunctionAttributesForDefinition. When a function is declared cold we can now g
[PATCH] Generate cold attribute for functions marked __atribute__((cold))
This removes a FIXME in CodeGenModule::SetLLVMFunctionAttributesForDefinition. When a function is declared cold we can now generate the IR attribute in addition to marking the function to be optimized for size.
I tried adding a separate CHECK in the existing test, but it was failing. I suppose CHECK matches one line exactly once? This would be a problem if the attributes are listed in a different order, though they seem to be sorted.
llvm-svn: 182666
show more ...
|
Revision tags: llvmorg-3.3.0-rc2 |
|
#
f121b930 |
| 20-May-2013 |
David Blaikie <dblaikie@gmail.com> |
PR14606: Debug Info for namespace aliases/DW_TAG_imported_module
This resolves the last of the PR14606 failures in the GDB 7.5 test suite. (but there are still unresolved issues in the imported_decl
PR14606: Debug Info for namespace aliases/DW_TAG_imported_module
This resolves the last of the PR14606 failures in the GDB 7.5 test suite. (but there are still unresolved issues in the imported_decl case - we need to implement optional/lazy decls for functions & variables like we already do for types)
llvm-svn: 182329
show more ...
|
#
b144d366 |
| 20-May-2013 |
Reid Kleckner <reid@kleckner.net> |
Implement __declspec(selectany) under -fms-extensions
selectany only applies to externally visible global variables. It has the effect of making the data weak_odr.
The MSDN docs suggest that unuse
Implement __declspec(selectany) under -fms-extensions
selectany only applies to externally visible global variables. It has the effect of making the data weak_odr.
The MSDN docs suggest that unused definitions can only be dropped at linktime, so Clang uses weak instead of linkonce. MSVC optimizes away references to constant selectany data, so it must assume that there is only one definition, hence weak_odr.
Reviewers: espindola
Differential Revision: http://llvm-reviews.chandlerc.com/D814
llvm-svn: 182266
show more ...
|
#
3ae00052 |
| 13-May-2013 |
Rafael Espindola <rafael.espindola@gmail.com> |
Cleanup handling of UniqueExternalLinkage.
This patch renames getLinkage to getLinkageInternal. Only code that needs to handle UniqueExternalLinkage specially should call this.
Linkage, as defined
Cleanup handling of UniqueExternalLinkage.
This patch renames getLinkage to getLinkageInternal. Only code that needs to handle UniqueExternalLinkage specially should call this.
Linkage, as defined in the c++ standard, is provided by getFormalLinkage. It maps UniqueExternalLinkage to ExternalLinkage.
Most places in the compiler actually want isExternallyVisible, which handles UniqueExternalLinkage as internal.
llvm-svn: 181677
show more ...
|
#
2960dbdd |
| 11-May-2013 |
Benjamin Kramer <benny.kra@googlemail.com> |
CodeGen: Refactor SetLLVMFunctionAttributesForDefinition to use an AttrBuilder.
Adding attributes to a uniqued set has become expensive, don't do it more often than necessary. No functionality chang
CodeGen: Refactor SetLLVMFunctionAttributesForDefinition to use an AttrBuilder.
Adding attributes to a uniqued set has become expensive, don't do it more often than necessary. No functionality change.
llvm-svn: 181662
show more ...
|
#
ffcf4ba9 |
| 09-May-2013 |
Adrian Prantl <aprantl@apple.com> |
Debug Info: Fix a problem that resulted in missing DW_AT_specifications for C++ constructors.
If the DIType for a class was generated by CGDebugInfo::createContextChain(), the cache contains only a
Debug Info: Fix a problem that resulted in missing DW_AT_specifications for C++ constructors.
If the DIType for a class was generated by CGDebugInfo::createContextChain(), the cache contains only a limited DIType wihtout any declarations. Since EmitFunctionStart() needs to find the canonical declaration for each method, we construct the complete type before emitting any method.
rdar://problem/13116508
llvm-svn: 181561
show more ...
|
#
e43f0fea |
| 08-May-2013 |
Reid Kleckner <reid@kleckner.net> |
Forward #pragma comment(lib/linker) through as flags metadata
Summary: Most of this change is wiring the pragma all the way through from the lexer, parser, and sema to codegen. I considered adding
Forward #pragma comment(lib/linker) through as flags metadata
Summary: Most of this change is wiring the pragma all the way through from the lexer, parser, and sema to codegen. I considered adding a Decl AST node for this, but it seemed too heavyweight.
Mach-O already uses a metadata flag called "Linker Options" to do this kind of auto-linking. This change follows that pattern.
LLVM knows how to forward the "Linker Options" metadata into the COFF .drectve section where these flags belong. ELF support is not implemented, but possible.
This is related to auto-linking, which is http://llvm.org/PR13016.
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D723
llvm-svn: 181426
show more ...
|