summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX
Commit message (Collapse)AuthorAgeFilesLines
* MS ABI: Update alias template mangling for VC "14" CTP 3David Majnemer2014-08-191-1/+1
| | | | | | | | MSVC "14" CTP 3 has fixed it's mangling for alias templates when used as template-template arguments; update clang to be compatible with this mangling. llvm-svn: 215972
* Make sure that vtables referenced from delay-parsed templates get referenced.Nico Weber2014-08-151-0/+12
| | | | | | | | | | | | | | This fixes PR20671, see the bug for details. In short, ActOnTranslationUnit() calls DefineUsedVTables() and only then PerformPendingInstantiations(). But PerformPendingInstantiations() is what does delayed template parsing, so vtables only references from late-parsed templates weren't marked used. As a fix, move the SavePendingInstantiationsAndVTableUsesRAII in PerformPendingInstantiations() up above the delayed template parsing code. That way, vtables referenced from templates end up in the RAII object, and the call to DefineUsedVTables() in PerformPendingInstantiations() marks them used. llvm-svn: 215786
* DebugInfo: While loop backedge should be attribute to the start of the while ↵David Blaikie2014-08-151-14/+25
| | | | | | | | | | | | | statement. A little test case simplification - this could be simplified further, though there are certainly interesting connections to the if/else construct so I'm hesitant to remove that entirely though it does appear somewhat unrelated. (similar fix to r215766, related to PR19864) llvm-svn: 215768
* DebugInfo: Fix PR19864 better - attribute the jump at the end of a range-for ↵David Blaikie2014-08-151-3/+3
| | | | | | | | | | | | | | | loop, to the start of the loop. This avoids debuggers stepping to strange places (like the last statement in the loop body, or the first statement in the if). This is not the whole answer, though - similar bugs no doubt exist in other loops (patches to follow) and attributing exception handling code to the correct line is also tricky (based on the previous fix to PR19864, exception handling is still erroneously attributed to the 'if' line). llvm-svn: 215766
* MS ABI: Virtual member pointer thunks are not unnamed_addrReid Kleckner2014-08-151-12/+14
| | | | | | They can be compared for identity. llvm-svn: 215745
* MS ABI: Mangle this qualifiers on function typesDavid Majnemer2014-08-121-0/+53
| | | | | | | | | | | C++11 allows this qualifiers to exist on function types when used in template arguments. Previously, I believed it wasn't possible because MSVC rejected declarations like: S<int () const &> s; However, it turns out MSVC properly allows them in using declarations; updated clang to be compatible with this mangling. llvm-svn: 215464
* Fix PR20444 -- wrong number of vftable slots created when return adjustment ↵Timur Iskhodzhanov2014-08-101-0/+43
| | | | | | | | thunks are needed Reviewed at http://reviews.llvm.org/D4822 llvm-svn: 215312
* Fix PR20479 -- missing vftable slots in case of virtual inheritance vs ↵Timur Iskhodzhanov2014-08-092-6/+30
| | | | | | | | return adjusting thunks Reviewed at http://reviews.llvm.org/D4829 llvm-svn: 215285
* MS ABI: Don't force bases to have an inheritance modelDavid Majnemer2014-08-081-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, assigning an inheritance model to a derived class would trigger further assiginments to the various bases of the class. This was done to fix a bug where we couldn't handle an implicit base-to-derived conversion for pointers-to-members when the conversion was ambiguous at an earlier point. However, this is not how the MS scheme works. Instead, assign inheritance models to *just* the class which owns to declaration we ended up referencing. N.B. This result is surprising in many ways. It means that it is possible for a base to have a "larger" inheritance model than it's derived classes. It also means that bases in the conversion path do not get assigned a model. struct A { void f(); void f(int); }; struct B : A {}; struct C : B {}; void f() { void (C::*x)() = &A::f; } We can only begin to assign an inheritance model *after* we've seen the address-of but *before* we've done the implicit conversion the more derived pointer-to-member type. After that point, both 'A' and 'C' will have an inheritance model but 'B' will not. Surprising, right? llvm-svn: 215174
* Debug info: Use the vbtable offset for virtual bases in the MS ABIReid Kleckner2014-08-071-2/+15
| | | | | | | | There are no vtable offset offsets in the MS ABI, but vbtable offsets are analogous. There are no consumers of this information yet, but at least we don't crash now. llvm-svn: 215149
* Revert "Debug info: Use record layout to find vbase offsets instead of vtables"Reid Kleckner2014-08-071-8/+2
| | | | | | | | | This reverts commit r215137. This doesn't work at all, an offset-offset is probably different than an offset. I'm scared that this passed our normal test suite. llvm-svn: 215141
* Debug info: Use record layout to find vbase offsets instead of vtablesReid Kleckner2014-08-071-2/+8
| | | | | | | | | This fixes an assertion when generating full debug info in the MS ABI for classes with virtual bases. Fixes PR20579. llvm-svn: 215137
* MS ABI: Mangle lambdas which are given the same mangling numberDavid Majnemer2014-08-061-4/+19
| | | | | | | | It is possible for lambdas to get the same mangling number because they may exist in different mangling contexts. To handle this correctly, mangle the context into the name as well. llvm-svn: 214947
* MS ABI: Mangle empty type parameter packs compatiblyDavid Majnemer2014-08-051-0/+12
| | | | | | | | | | | The MS mangling scheme apparently has separate manglings for type and non-type parameter packs when they are empty. Match template arguments with parameters during mangling; check the parameter to see if it was destined to hold type-ish things or nontype-ish things. Differential Revision: http://reviews.llvm.org/D4792 llvm-svn: 214932
* Introduce f[no-]max-unknown-pointer-align=[number] optionFariborz Jahanian2014-08-051-0/+57
| | | | | | | | | to instruct the code generator to not enforce a higher alignment than the given number (of bytes) when accessing memory via an opaque pointer or reference. Patch reviewed by John McCall (with post-commit review pending). rdar://16254558 llvm-svn: 214911
* MS ABI: Make the alias template mangling more correctDavid Majnemer2014-08-051-1/+1
| | | | llvm-svn: 214847
* Don't drop dllimport from qualified friend redeclarations (PR20512)Hans Wennborg2014-08-041-0/+14
| | | | | | | | | | This matches MSVC's logic, which seems to be that when the friend declaration is qualified, it cannot be a declaration of a new symbol and so the dll linkage doesn't change. Differential Revision: http://reviews.llvm.org/D4764 llvm-svn: 214774
* In the case of mangling collisions, make an attempt to note both definitionsRichard Smith2014-08-021-1/+1
| | | | | | involved. llvm-svn: 214606
* Re-commit r214547 with tests fixed. Hopefully all the bots will be happy now.Richard Smith2014-08-011-5/+5
| | | | | | | | | Original message: Fix iterator invalidation issues that are breaking my modules buildbot's bootstrap. llvm-svn: 214555
* Add comments to debug info testing case.Manman Ren2014-08-011-0/+1
| | | | llvm-svn: 214472
* PR18097: Support initializing an _Atomic(T) from an object of C++ class type TRichard Smith2014-07-311-1/+55
| | | | | | | or a class derived from T. We already supported this when initializing _Atomic(T) from T for most (and maybe all) other reasonable values of T. llvm-svn: 214390
* Update for llvm change.Rafael Espindola2014-07-303-5/+5
| | | | llvm-svn: 214356
* MS ABI: Mangle alias templates used as template-template argumentsDavid Majnemer2014-07-301-0/+14
| | | | | | | | | | | | | A templated using declaration may be used as a template-template argument. Unfortunately, the VS "14" chooses '?' as the sole marker for the argument. This is problematic because it presupposes the possibility of using more than one template-aliases as arguments to the same template. This fixes PR20047. llvm-svn: 214290
* Revert "Fix test case in r214190. (It failed on my end.)"Larisse Voufo2014-07-291-2/+2
| | | | | | This was an accident. llvm-svn: 214202
* Fix test case in r214190. (It failed on my end.)Larisse Voufo2014-07-291-2/+2
| | | | llvm-svn: 214198
* [Debug Info] update testing case due to change in DIBuilder.Manman Ren2014-07-291-3/+2
| | | | | | This is the paired commit with llvm r214189. llvm-svn: 214190
* Revert "Emit column debug information for loads"Tobias Grosser2014-07-291-1/+1
| | | | | | | | | | | | | | | | This broke the following gdb tests: gdb.base__annota1.exp gdb.base__consecutive.exp gdb.python__py-symtab.exp gdb.reverse__consecutive-precsave.exp gdb.reverse__consecutive-reverse.exp I will look into this. This reverts commit 214162. llvm-svn: 214163
* Emit column debug information for loadsTobias Grosser2014-07-291-1/+1
| | | | | | | | | This allows us to give more precise diagnostics. Diego kindly tested the impact on debug info size: "The increase on average debug sizes is 0.1%. The total file size increase is ~0%." llvm-svn: 214162
* [Debug Info] add DISubroutineType and its creation takes DITypeArray.Manman Ren2014-07-281-2/+2
| | | | | | | This is the last patch to unique the type array of a subroutine type. This is the paired commit with llvm r214132. llvm-svn: 214133
* clang/test/CodeGenCXX/microsoft-abi-byval-thunks.cpp: Fix for -Asserts, like ↵NAKAMURA Takumi2014-07-261-1/+1
| | | | | | CHECK64 does. llvm-svn: 214014
* MS ABI: Use musttail for vtable thunks that pass arguments by valueReid Kleckner2014-07-263-18/+127
| | | | | | | | | | | | | This moves some memptr specific code into the generic thunk emission codepath. Fixes PR20053. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D4613 llvm-svn: 214004
* clang/test/CodeGenCXX/cxx1y-variable-template-linkage.cpp: Appease -Asserts ↵NAKAMURA Takumi2014-07-261-3/+3
| | | | | | build. llvm-svn: 213992
* MS ABI: Ensure 'this' is first for byval+sret methodsReid Kleckner2014-07-261-10/+51
| | | | | | | | | Previously we were building up the inalloca struct in the usual pattern of return type followed by arguments. However, on Windows, 'this' always precedes the 'sret' parameter, so we need to insert it into the struct first as a special case. llvm-svn: 213990
* Add test case for fix of linkage bug that miscompiled variable templates ↵Larisse Voufo2014-07-251-0/+40
| | | | | | instantiated from similarly named local types (cf. r212233) llvm-svn: 213987
* Fix my broken test case in NDEBUG :(Reid Kleckner2014-07-251-1/+1
| | | | llvm-svn: 213979
* Fix my busted FileCheck invocationReid Kleckner2014-07-251-2/+2
| | | | llvm-svn: 213978
* MS ABI: Don't push destructor cleanups for aggregate parameters in thunksReid Kleckner2014-07-251-0/+25
| | | | | | | | The target method of the thunk will perform the cleanup. This can't be tested in 32-bit x86 yet because passing something by value would create an inalloca, and we refuse to generate broken code for that. llvm-svn: 213976
* PR20445: Properly transform the initializer in a CXXNewExpr rather than runningRichard Smith2014-07-251-0/+10
| | | | | | | it through the normal TreeTransform logic for Exprs (which will strip off implicit parts of the initialization and never re-create them). llvm-svn: 213913
* MS ABI: -fno-rtti-data wasn't data-free enoughDavid Majnemer2014-07-241-0/+1
| | | | | | | While -fno-rtti-data would correctly avoid referencing the RTTI complete object locator in the VFTable itself, it would emit them anyway. llvm-svn: 213841
* -fms-extensions: Implement half of #pragma init_segReid Kleckner2014-07-221-16/+72
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This pragma is very rare. We could *hypothetically* lower some uses of it down to @llvm.global_ctors, but given that GlobalOpt isn't able to optimize prioritized global ctors today, there's really no point. If we wanted to do this in the future, I would check if the section used in the pragma started with ".CRT$XC" and had up to two characters after it. Those two characters could form the 16-bit initialization priority that we support in @llvm.global_ctors. We would have to teach LLVM to lower prioritized global ctors on COFF as well. This should let us compile some silly uses of this pragma in WebKit / Blink. Reviewers: rsmith, majnemer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4549 llvm-svn: 213593
* Revert "Emit lifetime.start / lifetime.end markers for unnamed temporary ↵Arnaud A. de Grandmaison2014-07-211-132/+0
| | | | | | | | | objects." This commit did break the sanitizer-x86 bot. Revert it while investigating. llvm-svn: 213579
* Emit lifetime.start / lifetime.end markers for unnamed temporary objects.Arnaud A. de Grandmaison2014-07-211-0/+132
| | | | | | This will give more information to the optimizers so that they can reuse stack slots. llvm-svn: 213576
* CodeGen: Properly null-check typeid expressionsDavid Majnemer2014-07-191-0/+82
| | | | | | | | | | | | Thoroughly check for a pointer dereference which yields a glvalue. Look through casts, comma operators, conditional operators, paren expressions, etc. This was originally D4416. Differential Revision: http://reviews.llvm.org/D4592 llvm-svn: 213434
* Revert "CodeGen: Properly null-check typeid expressions"David Majnemer2014-07-181-68/+0
| | | | | | | | | This reverts commit r213401, r213402, r213403, and r213404. I accidently committed these changes instead of updating the differential. llvm-svn: 213405
* Address Richard's latest feedback.David Majnemer2014-07-181-3/+13
| | | | llvm-svn: 213404
* Address Richard's commentsDavid Majnemer2014-07-181-0/+4
| | | | llvm-svn: 213403
* Address Richard's comments.David Majnemer2014-07-181-0/+10
| | | | llvm-svn: 213402
* CodeGen: Properly null-check typeid expressionsDavid Majnemer2014-07-181-0/+44
| | | | | | | | | | | | | | | Summary: Thoroughly check for a pointer dereference which yields a glvalue. Look through casts, comma operators, conditional operators, paren expressions, etc. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4416 llvm-svn: 213401
* [UBsan] Skip -fsanitize=vptr instrumentations when the pointer value is null.Alexey Samsonov2014-07-181-0/+6
| | | | | | | | | | Otherwise -fsanitize=vptr causes the program to crash when it downcasts a null pointer. Reviewed in http://reviews.llvm.org/D4412. Patch by Byoungyoung Lee! llvm-svn: 213393
* Make sure globals created by UBSan are not instrumented by ASan.Alexey Samsonov2014-07-181-0/+8
| | | | | | | | | | | | | | | | | | | | | | Summary: This change adds description of globals created by UBSan instrumentation (UBSan handlers, type descriptors, filenames) to llvm.asan.globals metadata, effectively "blacklisting" them. This can dramatically decrease the data section in binaries built with UBSan+ASan, as UBSan tends to create a lot of handlers, and ASan instrumentation increases the global size to at least 64 bytes. Test Plan: clang regression test suite Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits, byoungyoung, kcc Differential Revision: http://reviews.llvm.org/D4575 llvm-svn: 213392
OpenPOWER on IntegriCloud