summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX
Commit message (Collapse)AuthorAgeFilesLines
* Add the missing 'static' keyword to the testTimur Iskhodzhanov2013-02-191-2/+2
| | | | llvm-svn: 175502
* Add support for -fvisibility-ms-compat.John McCall2013-02-191-0/+112
| | | | | | | | | | | | | | | We treat this as an alternative to -fvisibility=<?> which changes the default value visibility to "hidden" and the default type visibility to "default". Expose a -cc1 option for changing the default type visibility, repurposing -fvisibility as the default value visibility option (also setting type visibility from it in the absence of a specific option). rdar://13079314 llvm-svn: 175480
* Remove block names from test case to unbreak release builds.Lang Hames2013-02-171-2/+0
| | | | | | Thanks Chandler. :) llvm-svn: 175392
* Re-apply r174919 - smarter copy/move assignment/construction, with fixes forLang Hames2013-02-174-10/+227
| | | | | | | | | | | bitfield related issues. The original commit broke Takumi's builder. The bug was caused by bitfield sizes being determined by their underlying type, rather than the field info. A similar issue with bitfield alignments showed up on closer testing. Both have been fixed in this patch. llvm-svn: 175389
* Emit vtables for an extern template class as available_externally, not asRichard Smith2013-02-161-0/+26
| | | | | | | linkonce_odr. Emit construction vtables as internal in this case, since the ABI does not guarantee that they will be availble externally. llvm-svn: 175330
* Rework the visibility computation algorithm in preparationJohn McCall2013-02-161-15/+29
| | | | | | | | | | | | | | | | for distinguishing type vs. value visibility. The changes to the visibility of explicit specializations are intentional. The change to the "ugly" test case is a consequence of a sensible implementation, and I am happy to argue that this is better behavior. Other changes may or may not be intended; it is quite difficult to divine intent from some of the code I altered. I've left behind a comment which I hope explains the philosophy behind visibility computation. llvm-svn: 175326
* Add the 'target-cpu' and 'target-features' attributes to functions.Bill Wendling2013-02-155-18/+18
| | | | | | | The back-end will use these values to reconfigure code generation for different features. llvm-svn: 175308
* Abstract out emitting the vdtor calls and do it properly when using -cxx-abi ↵Timur Iskhodzhanov2013-02-152-11/+25
| | | | | | microsoft; also fix vdtor calls for the ARM ABI llvm-svn: 175271
* Update testcases due to Attribute sorting improvements.Bill Wendling2013-02-153-8/+8
| | | | llvm-svn: 175253
* Mangle extern "C" functions whose names are not simple identifiers.Rafael Espindola2013-02-141-0/+7
| | | | llvm-svn: 175166
* Partially revert r175117 so that we don't break assumptions about howRafael Espindola2013-02-141-5/+3
| | | | | | | static functions in extern "C" contexts are mangled. Should fix the bootstrap. llvm-svn: 175132
* Add a getLanguageLinkage method to VarDecls and FunctionDecls. Use it to fixRafael Espindola2013-02-141-0/+13
| | | | | | | | | | | | | | | some cases where functions with no language linkage were being treated as having C language linkage. In particular, don't warn in extern "C" { static NonPod foo(); } Since getLanguageLinkage checks the language linkage, the linkage computation cannot use the language linkage. Break the loop by checking just the context in the linkage computation. llvm-svn: 175117
* ubsan: Add checking for invalid downcasts. Per [expr.static.cast]p2 and p11,Richard Smith2013-02-131-0/+46
| | | | | | | base-to-derived casts have undefined behavior if the object is not actually an instance of the derived type. llvm-svn: 175078
* ... and now fix the +Asserts buildTimur Iskhodzhanov2013-02-131-2/+2
| | | | llvm-svn: 175054
* Fix the microsoft-abi-structors test expectations to match both Release and ↵Timur Iskhodzhanov2013-02-131-8/+14
| | | | | | Release+Asserts builds llvm-svn: 175053
* Emit virtual/deleting destructors properly with -cxx-abi microsoft, PR15058Timur Iskhodzhanov2013-02-132-11/+62
| | | | llvm-svn: 175045
* Rename -constructors test to just -structors as in fact it tests dtors too. ↵Timur Iskhodzhanov2013-02-121-1/+1
| | | | | | Also, fix a minor typo in the test. llvm-svn: 174966
* Call __cxa_begin_catch with the current exception beforeJohn McCall2013-02-123-6/+14
| | | | | | calling std::terminate(). rdar://11904428 llvm-svn: 174940
* Backing out r174919 while I investigate a self-host bug on Takumi's builder.Lang Hames2013-02-123-3/+10
| | | | llvm-svn: 174925
* When generating IR for default copy-constructors, copy-assignment operators,Lang Hames2013-02-113-10/+3
| | | | | | | | | | | | | | | | | | | | move-constructors and move-assignment operators, use memcpy to copy adjacent POD members. Previously, classes with one or more Non-POD members would fall back on element-wise copies for all members, including POD members. This often generated a lot of IR. Without padding metadata, it wasn't often possible for the LLVM optimizers to turn the element-wise copies into a memcpy. This code hasn't yet received any serious tuning. I didn't see any serious regressions on a self-hosted clang build, or any of the nightly tests, but I think it's important to get this out in the wild to get more testing. Insights, feedback and comments welcome. Many thanks to David Blaikie, Richard Smith, and especially John McCall for their help and feedback on this work. llvm-svn: 174919
* Use the target address space value when mangling names.Tanya Lattner2013-02-081-0/+3
| | | | llvm-svn: 174688
* Permit ABIs where the caller extends the result (test change).Tim Northover2013-02-071-1/+1
| | | | | | | | | This test was written to make sure *something* sane is generated, not to test any ABI's signedness semantics. This should allow the test to pass if AArch64 is the default target. llvm-svn: 174618
* Drop value names from test to get -Asserts builds back to green.Benjamin Kramer2013-02-031-2/+2
| | | | llvm-svn: 174294
* CodeGen: Implement hint values for dynamic_cast as described in the Itanium ↵Benjamin Kramer2013-02-031-0/+53
| | | | | | | | | | | | | | | C++ ABI. This can yield dramatic speedups of dynamic_cast for simple inheritance trees, at least with libsupc++. Neither libcxxabi nor libcxxrt make use of this hint currently, it was never implemented because clang didn't support it. There was some concern about the number of class hierarchy walks this change introduces. If it turns out to be an issue we can add caching either at the cast pair level or even deeper, but we also do a lot of walks in Sema so this codepath is probably fairly optimized already. llvm-svn: 174293
* CodeGen: Mark the runtime function __dynamic_cast as readonly & nounwind.Benjamin Kramer2013-02-031-0/+2
| | | | | | This allows the optimizer to CSE dynamic_casts. llvm-svn: 174289
* clang/test/CodeGenCXX/debug-info-class.cpp: Tweak to unbreak test for a few ↵NAKAMURA Takumi2013-02-031-2/+6
| | | | | | | | | | targets. - Relax a expression for arm-gnueabi. - Exclude msvc to limit target triplets to add limited a few targets. Feel free to remove actions if guys thought they redundant. llvm-svn: 174278
* PR15132: Replace "address expression must be an lvalue or a functionRichard Smith2013-02-021-2/+19
| | | | | | | | | | | | | | designator" diagnostic with more correct and more human-friendly "cannot take address of rvalue of type 'T'". For the case of & &T::f, provide a custom diagnostic, rather than unhelpfully saying "cannot take address of rvalue of type '<overloaded function type>'". For the case of &array_temporary, treat it just like a class temporary (including allowing it as an extension); the existing diagnostic wording for the class temporary case works fine. llvm-svn: 174262
* Don't forget to run destructors when we create an array temporary of class type.Richard Smith2013-02-022-1/+54
| | | | llvm-svn: 174257
* Generalize DebugInfo tests by avoiding explicit metadata numbersDavid Blaikie2013-02-0210-22/+22
| | | | | | | | | | | | | | | This addresses several (not all) debug info tests that use explicit metadata numbers. Wherever the same number appeared more than once in a test I used a named match to ensure the same number appeared in all those cases (this may still be overly constraining test cases as they may not have actually cared about that relationship). For one-off numbers I just replaced them with an unnamed regex. This may underconstrain poorly written test cases that were interested in checking that certain metadata nodes were related but didn't actually match on all the related nodes numbers. llvm-svn: 174247
* clang/test/CodeGenCXX/debug-info-class.cpp: Fixup for -Asserts.NAKAMURA Takumi2013-02-011-2/+3
| | | | llvm-svn: 174229
* Fix exception handling line table problems introduced by r173593David Blaikie2013-02-011-9/+23
| | | | | | | | | | | | | r173593 made us a little too eager to associate all code at the end of a function with the user-written 'return' line. This caused problems with breakpoints as they'd be set in exception handling code preceeding the actual non-exception return handling code, leading to the breakpoint never being hit in non-exceptional execution. This change restores the pre-r173593 exception handling line information where the cleanup code is associated with the '}' not the return line. llvm-svn: 174206
* Destroy arrays and ARC fields when throwing out of ctors.John McCall2013-02-011-0/+67
| | | | | | | | Previously we were only handling non-array fields of class type. Testcases derived from a patch by WenHan Gu. llvm-svn: 174146
* Update the tests.Bill Wendling2013-01-316-18/+18
| | | | | | | This update coincides with r174110. That change ordered the attributes alphabetically. llvm-svn: 174111
* Add support for AArch64 target.Tim Northover2013-01-312-0/+101
| | | | | | | | | | | | | In cooperation with the LLVM patch, this should implement all scalar front-end parts of the C and C++ ABIs for AArch64. This patch excludes the NEON support also reviewed due to an outbreak of batshit insanity in our legal department. That will be committed soon bringing the changes to precisely what has been approved. Further reviews would be gratefully received. llvm-svn: 174055
* When we're emitting a constructor or destructor call from a delegatingDouglas Gregor2013-01-311-0/+34
| | | | | | | constructor, retrieve our VTT parameter directly. Fixes PR14588 / <rdar://problem/12867962>. llvm-svn: 174042
* Modify the tests for the (sorted) order that the attributes come out as now.Bill Wendling2013-01-294-10/+10
| | | | llvm-svn: 173762
* FileCheck'ize testsDmitri Gribenko2013-01-281-22/+41
| | | | llvm-svn: 173720
* Specify non-GNU-ARM triples for key-function test.Tim Northover2013-01-261-1/+2
| | | | | | | Since ARM has diverging ABIs on this detail, it's probably worth testing both it and a "normal" Itanium system. llvm-svn: 173576
* Fix up the test.Fariborz Jahanian2013-01-261-9/+15
| | | | | | for // rdar://11861085 llvm-svn: 173543
* patch for PR9027 and // rdar://11861085Fariborz Jahanian2013-01-251-0/+44
| | | | | | | | | | | Title: [PR9027] volatile struct bug: member is not loaded at -O; This is caused by last flag passed to @llvm.memcpy being false, not honoring that aggregate has at least one 'volatile' data member (even though aggregate itself has not been qualified as 'volatile'. As a result, optimization optimizes away the memcpy altogether. Patch review by John MaCall (I still need to fix up a test though). llvm-svn: 173535
* ARM says that the array cookie should always be eight bytes.John McCall2013-01-251-0/+52
| | | | | | | ARM is not thinking about over-aligned structures. Overrule ARM in both our generic-ARM and iOS ABI implementations. llvm-svn: 173531
* The standard ARM C++ ABI dictates that inline functions areJohn McCall2013-01-253-4/+501
| | | | | | | | never key functions. We did not implement that rule for the iOS ABI, which was driven by what was implemented in gcc-4.2. However, implement it now for other ARM-based platforms. llvm-svn: 173515
* clang/test/CodeGenCXX/debug-info-static-member.cpp: Appease targetting msvc ↵NAKAMURA Takumi2013-01-251-1/+1
| | | | | | | | | | | | | to add explicit -target x86_64-unknown-unknown. with -target i686-win32, you will see; debug-info-static-member.cpp:11:22: error: in-class initializer for static data member of type 'const float' requires 'constexpr' specifier [-Wstatic-float-init] const static float const_b = 3.14; ^ ~~~~ constexpr llvm-svn: 173418
* First step towards vftable generation with -cxx-abi microsoft PR13231Timur Iskhodzhanov2013-01-212-0/+124
| | | | llvm-svn: 173035
* PR14472: Preserve qualifiers while unwrapping types for debug infoDavid Blaikie2013-01-211-4/+7
| | | | | | | | | | Looks like r161368 fixed this for one case but not all. This change generalizes the solution over all the unwrapping cases. Now that preserving the qualifiers is done independent of the particular type being unwrapped I won't bother adding test cases for each one but at least demonstrate that this change was necessary & sufficient to fix the bug. llvm-svn: 173002
* The last of PR14471: Debug info support for inline in-class initializer for ↵David Blaikie2013-01-201-4/+4
| | | | | | float static members llvm-svn: 172942
* Emit the function type of member function pointer types the same as member ↵David Blaikie2013-01-191-1/+4
| | | | | | | | | | | | functions. Adding the pseudo first parameter to a member function pointer's function type and mark it as artificial. Combined with a fix to GDB ( http://sourceware.org/bugzilla/show_bug.cgi?id=14998 ) this fixes gdb.cp/member-ptr.exp with Clang. llvm-svn: 172911
* Implement C++11 semantics for [[noreturn]] attribute. This required splittingRichard Smith2013-01-171-0/+8
| | | | | | | | it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as affecting the function type, whereas [[noreturn]] does not). llvm-svn: 172691
* Add testcase missed yesterday. Patch from Paul Robinson.Eric Christopher2013-01-161-0/+41
| | | | llvm-svn: 172648
* Collect both normal and static data members of a class in sourceEric Christopher2013-01-161-2/+2
| | | | | | | | | | order. Describe static data members to metadata using new interfaces. Part of PR14471. Patch by Paul Robinson! llvm-svn: 172591
OpenPOWER on IntegriCloud