summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/thunks.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove the -fhidden-weak-vtables -cc1 option. It was dead,John McCall2014-02-081-4/+5
| | | | | | gross, and increasingly replaced through other mechanisms. llvm-svn: 201011
* CodeGen: Don't emit linkage on thunks that aren't emitted because they're ↵Benjamin Kramer2013-12-071-0/+22
| | | | | | | | | | | | vararg. This can happen when we're trying to emit a thunk with available_externally linkage with optimization enabled but bail because it doesn't make sense for vararg functions. PR18098. llvm-svn: 196658
* CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin2013-08-151-10/+10
| | | | | | tests fail. llvm-svn: 188447
* Fix FileCheck --check-prefix lines.Tim Northover2013-08-121-1/+1
| | | | | | | | | | Various tests had sprung up over the years which had --check-prefix=ABC on the RUN line, but "CHECK-ABC:" later on. This happened to work before, but was strictly incorrect. FileCheck is getting stricter soon though. Patch by Ron Ofir. llvm-svn: 188174
* Reapply r176133 with testcase fixes.Bill Wendling2013-02-271-5/+2
| | | | llvm-svn: 176145
* Revert "Add more attributes from the command line to functions."Anna Zaks2013-02-251-2/+5
| | | | | | | | This reverts commit 176009. The commit is a likely cause of several buildbot failures. llvm-svn: 176044
* Add more attributes from the command line to functions.Bill Wendling2013-02-251-5/+2
| | | | | | | This is an ongoing process. Any command line option which a back-end cares about should be added here. llvm-svn: 176009
* Modify the tests to use attribute group references instead of listing theBill Wendling2013-02-201-1/+6
| | | | | | function attributes. llvm-svn: 175606
* Call CGM.SetLLVMFunctionAttributesForDefinition on thunks so that they getRafael Espindola2012-09-211-2/+17
| | | | | | | attributes like uwtable. Without uwtable a stack unwinder would be unable to go past the thunks. llvm-svn: 164411
* Fix thunk emission for covariant virtual functions in cases which requireEli Friedman2012-09-141-0/+26
| | | | | | both a virtual and a non-virtual offset. PR13832. llvm-svn: 163866
* Complain about attempts to use 'protected' visibility on targetsJohn McCall2012-01-291-2/+2
| | | | | | | | like Darwin that don't support it. We should also complain about invalid -fvisibility=protected, but that information doesn't seem to exist at the most appropriate time, so I've left a FIXME behind. llvm-svn: 149186
* Add an implementation of thunks for varargs methods. The implementation is ↵Eli Friedman2011-05-061-3/+27
| | | | | | a bit messy, but it is correct as long as the method in question doesn't use indirect gotos. A couple of possible alternative implementations are outlined in FIXME's in this patch. rdar://problem/8077308 . llvm-svn: 130993
* Warn about code that uses variables and functions with internal linkageJohn McCall2011-02-191-23/+21
| | | | | | | | | | | | | | without defining them. This should be an error, but I'm paranoid about "uses" that end up not actually requiring a definition. I'll revisit later. Also, teach IR generation to not set internal linkage on variable declarations, just for safety's sake. Doing so produces an invalid module if the variable is not ultimately defined. Also, fix several places in the test suite where we were using internal functions without definitions. llvm-svn: 126016
* When re-using a vtable slot for the nearest overridden method, just becauseJohn McCall2010-11-091-0/+19
| | | | | | | | | | | | there's no return adjustment from the overridden to the overrider doesn't mean there isn't a return adjustment from the overrider to the final overrider. This matters if we're emitting a virtual this-adjustment thunk because the overrider virtually inherits from the class providing the nearest overridden method. Do the appropriate return adjustment in this case. Fixes PR7611. llvm-svn: 118466
* Just disable the hidden-visibility optimization for now by hiding it behindJohn McCall2010-08-121-3/+4
| | | | | | | | a -cc1 option. The Darwin linker complains about mixed visibility when linking gcc-built objects with clang-built objects, and the optimization isn't really that valuable. Platforms with less ornery linkers can feel free to enable this. llvm-svn: 110979
* Extend the visibility-hidden optimization to linkonce_odr thunks forJohn McCall2010-08-041-1/+14
| | | | | | | | | functions with in-line definitions, since such thunks will be emitted at any use of the function. Completes the feature work for rdar://problem/7523229. llvm-svn: 110285
* Don't try to emit the vtable for a class just because we're emitting aJohn McCall2010-06-021-0/+12
| | | | | | | | virtual function from it. Fixes PR7241. llvm-svn: 105345
* Correctly pass aggregates by reference when emitting thunks.John McCall2010-05-261-0/+18
| | | | llvm-svn: 104778
* When generating the call arguments in a thunk to call the thunkee, doDouglas Gregor2010-05-211-0/+45
| | | | | | | | not make copies non-POD arguments or arguments passed by reference: just copy the pointers directly. This eliminates another source of the dreaded memcpy-of-non-PODs. Fixes PR7188. llvm-svn: 104327
* When creating a this-adjustment thunk where the return value is of C++Douglas Gregor2010-05-201-4/+45
| | | | | | | | | class type (that uses a return slot), pass the return slot to the callee directly rather than allocating new storage and trying to copy the object. This appears to have been the cause of the remaining two Boost.Interprocess failures. llvm-svn: 104215
* Rework when and how vtables are emitted, by tracking where vtables areDouglas Gregor2010-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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
* Give thunks the same linkage as their original methods.Anders Carlsson2010-03-271-4/+25
| | | | llvm-svn: 99729
* Flip the switch and use the new vtable layout code for thunks by default. ↵Anders Carlsson2010-03-241-0/+116
Add a thunks.cpp test. llvm-svn: 99367
OpenPOWER on IntegriCloud