summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX
Commit message (Collapse)AuthorAgeFilesLines
...
* Delay emitting members of dllexport classes until the class is fully parsed ↵Hans Wennborg2015-08-151-1/+49
| | | | | | | | | | | | | | | | | (PR23542) This enables Clang to correctly handle code such as: struct __declspec(dllexport) S { int x = 42; }; where it would otherwise error due to trying to generate the default constructor before the in-class initializer for x has been parsed. Differential Revision: http://reviews.llvm.org/D11850 llvm-svn: 245139
* clarified test commentNaomi Musgrave2015-08-141-1/+2
| | | | llvm-svn: 245124
* This test was still failing for me after r244925, fix it harder.Richard Smith2015-08-141-6/+3
| | | | llvm-svn: 244991
* Avoid iteration invalidation issues around MaterializedTemporaryExprDavid Majnemer2015-08-131-0/+82
| | | | | | | | | | | | | | | | We risk iterator invalidation issues if we use a DenseMap to hold the backing storage for an APValue. Instead, BumpPtrAllocate them and use APValue * as our DenseMap value. Also, don't assume that MaterializedGlobalTemporaryMap won't regrow between when we initially perform a lookup and later on when we actually try to insert into it. This fixes PR24289. Differential Revision: http://reviews.llvm.org/D11629 llvm-svn: 244989
* Fix previous commit: poison only class members, simpler testsNaomi Musgrave2015-08-133-28/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Poisoning applied to only class members, and before dtors for base class invoked Implement poisoning of only class members in dtor, as opposed to also poisoning fields inherited from base classes. Members are poisoned only once, by the last dtor for a class. Skip poisoning if class has no fields. Verify emitted code for derived class with virtual destructor sanitizes its members only once. Removed patch file containing extraneous changes. Reviewers: eugenis, kcc Differential Revision: http://reviews.llvm.org/D11951 Simplified test cases for use-after-dtor Summary: Simplified test cases to focus on one feature at time. Tests updated to align with new emission order for sanitizing callback. Reviewers: eugenis, kcc Differential Revision: http://reviews.llvm.org/D12003 llvm-svn: 244933
* Try to fix new.cpp after r244920 to make it passReid Kleckner2015-08-131-4/+4
| | | | llvm-svn: 244925
* Revert "Implement poisoning of only class members in dtor, as opposed to ↵Naomi Musgrave2015-08-123-75/+5
| | | | | | | | | also poisoning fields inherited from base classes." This reverts commit 8dbbf3578a9a5d063232b59e558e5fe46e2cd42c. Rolled back due to buildbot failures on 'ninja check-clang'. llvm-svn: 244820
* Implement poisoning of only class members in dtor, as opposed to also ↵Naomi Musgrave2015-08-123-5/+75
| | | | | | | | | | | | | | | | | poisoning fields inherited from base classes. Verify emitted code for derived class with virtual destructor sanitizes its members only once. Changed emission order for dtor callback, so only the last dtor for a class emits the sanitizing callback, while ensuring that class members are poisoned before base class destructors are invoked. Skip poisoning of members, if class has no fields. Removed patch file containing extraneous changes. Summary: Poisoning applied to only class members, and before dtors for base class invoked Reviewers: eugenis, kcc Differential Revision: http://reviews.llvm.org/D11951 llvm-svn: 244819
* [dllimport] A non-imported class with an imported key can't have a keyReid Kleckner2015-08-101-0/+8
| | | | | | | | | | | | | | | | | Summary: The vtable takes its DLL storage class from the class, not the key function. When they disagree, the vtable won't be exported by the DLL that defines the key function. The easiest way to ensure that importers of the class emit their own vtable is to say that the class has no key function. Reviewers: hans, majnemer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11913 llvm-svn: 244488
* Add new llvm.loop.unroll.enable metadata for use with "#pragma unroll".Mark Heffernan2015-08-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | This change adds the new unroll metadata "llvm.loop.unroll.enable" which directs the optimizer to unroll a loop fully if the trip count is known at compile time, and unroll partially if the trip count is not known at compile time. This differs from "llvm.loop.unroll.full" which explicitly does not unroll a loop if the trip count is not known at compile time With this change "#pragma unroll" generates "llvm.loop.unroll.enable" rather than "llvm.loop.unroll.full" metadata. This changes the semantics of "#pragma unroll" slightly to mean "unroll aggressively (fully or partially)" rather than "unroll fully or not at all". The motivating example for this change was some internal code with a loop marked with "#pragma unroll" which only sometimes had a compile-time trip count depending on template magic. When the trip count was a compile-time constant, everything works as expected and the loop is fully unrolled. However, when the trip count was not a compile-time constant the "#pragma unroll" explicitly disabled unrolling of the loop(!). Removing "#pragma unroll" caused the loop to be unrolled partially which was desirable from a performance perspective. llvm-svn: 244467
* [MSVC] Crash fix: assigning of overloaded member function pointer caused ↵Alexey Bataev2015-08-101-0/+17
| | | | | | | | | assertion Original class was not marked with inheritance attribute and it causes a crash on codegen. Differential Revision: http://reviews.llvm.org/D11828 llvm-svn: 244428
* [ItaniumCXXABI] Don't import RTTI data for classes with key functionsDavid Majnemer2015-08-061-0/+7
| | | | | | | | | MinGW has some pretty strange behvaior around RTTI and dllimport/dllexport: - RTTI data is never imported - RTTI data is only exported if the class has no key function. llvm-svn: 244266
* Mark calls in thunk functions as tail-call optimization candidatesMichael Kuperstein2015-08-061-1/+1
| | | | | | | | | | | | | When a thunk is generated with a call to the original adjusted function, the thunk appears in the debugger call stack. We want the backend to perform tail-call optimization on the call, to make it invisible to the debugger. This fixes PR24235 Patch by: amjad.aboud@intel.com Differential Revision: http://reviews.llvm.org/D11476 llvm-svn: 244207
* [AST] Really allocate a SmallVector to the right size.Benjamin Kramer2015-08-041-2/+4
| | | | | | | | | | set_size only resets the end pointer and asserts if it is used to grow the buffer. This would crash when mangling a float with more than 80 bits, add a test with a ppc double double (128 bits). Found by inspection. llvm-svn: 243979
* Dtor callback emitted when msan attribute not repressed for this function.Naomi Musgrave2015-08-031-0/+51
| | | | | | | | | | | | | | | | | | Summary: In addition to checking compiler flags, the front-end also examines the attributes of the destructor definition to ensure that the SanitizeMemory attribute is attached. Reviewers: eugenis, kcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11727 refactored test into new file, revised how function attribute examined modified test to examine default dtor with and without attribute removed attribute check llvm-svn: 243912
* [MS ABI] Create a mangling for extended vector typesDavid Majnemer2015-08-011-0/+4
| | | | | | Extended vector types are mangled just like normal vector types. llvm-svn: 243828
* Use the reserved keyword spelling of 'typeof'David Majnemer2015-08-011-1/+1
| | | | | | No functional change intended, just a drive-by cleanup. llvm-svn: 243826
* DI: Update testcases for LLVM assembly changeDuncan P. N. Exon Smith2015-07-317-19/+22
| | | | | | | | | | Update testcases after LLVM change r243774. Most of these had no need to check `tag:` field, but did so as a way of getting to the `name:` field. In a few cases I've converted the `tag:` checks to `arg:` or `CHECK-NOT: arg:`. llvm-svn: 243775
* simplified test caseNaomi Musgrave2015-07-301-2/+2
| | | | llvm-svn: 243673
* removed hardcoding for attribute associated with dtor in testNaomi Musgrave2015-07-301-3/+2
| | | | llvm-svn: 243672
* Testing to verify function attribute disable-tail-calls applied to destructorNaomi Musgrave2015-07-301-0/+5
| | | | llvm-svn: 243671
* updated test to be more explicitNaomi Musgrave2015-07-301-1/+1
| | | | llvm-svn: 243670
* Updated test regex and flagsNaomi Musgrave2015-07-301-4/+3
| | | | llvm-svn: 243669
* repress tail call optimization when performing use-after-dtor sanitizationNaomi Musgrave2015-07-301-0/+20
| | | | | | | | | | Reviewers: eugenis, kcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11613 llvm-svn: 243668
* In case of an existing GlobalVariable, the comdat is created using the name ↵Yaron Keren2015-07-291-0/+25
| | | | | | | | | | | | | of the new GV (usually NAME.1) instead of the correct NAME of the old GV. Moving comdat creation after GV replacement solves this. Patch + testcase. Reviewed by Reid Kleckner. http://reviews.llvm.org/D11594 llvm-svn: 243525
* Make this test target x86_64-pc-windows-gnu as well.Yaron Keren2015-07-291-0/+3
| | | | llvm-svn: 243523
* Add -femulated-tls flag to select the emulated TLS model.Chih-Hung Hsieh2015-07-281-0/+2
| | | | | | | | | This will be used for old targets like Android that do not support ELF TLS models. Differential Revision: http://reviews.llvm.org/D10524 llvm-svn: 243441
* Use CGLoopInfo to emit metadata for loop hint pragmas.Tyler Nowicki2015-07-273-50/+62
| | | | | | | | When ‘#pragma clang loop vectorize(assume_safety)’ was specified on a loop other loop hints were lost. The problem is that CGLoopInfo attaches metadata differently than EmitCondBrHints in CGStmt. For do-loops CGLoopInfo attaches metadata to the br in the body block and for while and for loops, the inc block. EmitCondBrHints on the other hand always attaches data to the br in the cond block. When specifying assume_safety CGLoopInfo emits an empty llvm.loop metadata shadowing the metadata in the cond block. Loop transformations like rotate and unswitch would then eliminate the cond block and its non-empty metadata. This patch unifies both approaches for adding metadata and modifies the existing safety tests to include non-assume_safety loop hints. llvm-svn: 243315
* Generating available_externally vtables for outline virtual functionsPiotr Padlewski2015-07-242-6/+144
| | | | | | | | | | | | | | Generating available_externally vtables for optimizations purposes. Unfortunatelly ItaniumABI doesn't guarantee that we will be able to refer to virtual inline method by name. But when we don't have any inline virtual methods, and key function is not defined in this TU, we can generate that there will be vtable and mark it as available_externally. This is patch will help devirtualize better. Differential Revision: http://reviews.llvm.org/D11441 llvm-svn: 243090
* Fix a case where we forgot to make a static local variable comdatReid Kleckner2015-07-201-0/+17
| | | | | | | | | | | | | Sometimes we can provide an initializer for static locals, in which case we sometimes might need to change the type. Changing the type requires making a new LLVM GlobalVariable, and in this codepath we were forgetting to transfer the comdat. Fixes PR23838. Patch by Ivan Garramona. llvm-svn: 242704
* [MS ABI] Explicit specialization of static data members are weakDavid Majnemer2015-07-172-3/+13
| | | | | | | | | | | | | Normally, explicit specializations are treated like strong external definitions. However, MSVC treats explicit specializations of static data members as weak. MSVC 2013's <regex> implementation has such an explicit specialization which leads to clang emitting a strong definition in each translation unit which includes it. Tweak clang's linkage calculation to give such entities GVA_StrongODR linkage instead. This fixes PR24165. llvm-svn: 242592
* Changed "pragma" -> "#pragma" in a comment, NFC.Andrey Bokhanko2015-07-171-1/+1
| | | | llvm-svn: 242521
* [CodeGen, X86] Classify vectors <= 32 bits as INTEGERDavid Majnemer2015-07-171-0/+9
| | | | | | | | | | We shouldn't crash despite the AMD64 ABI not giving clear guidance as to how to pass around vector types <= 32 bits. Instead, classify such vectors as INTEGER to be compatible with GCC. This fixes PR24162. llvm-svn: 242508
* Disable #pragma redefine_extname for C++ code as it does not make sense in ↵Aaron Ballman2015-07-161-0/+6
| | | | | | | | such a context. Patch by Andrey Bokhanko! llvm-svn: 242420
* updated tests for correct commitNaomi Musgrave2015-07-162-41/+61
| | | | llvm-svn: 242364
* adding tests for various dtor decl typesNaomi Musgrave2015-07-151-4/+59
| | | | | | | | | | Reviewers: eugenis, kcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11189 llvm-svn: 242351
* Erase REQUIRES: shell-preserves-root from remaining tests, see r242312.þYaron Keren2015-07-151-1/+0
| | | | llvm-svn: 242323
* -disable-llvm-optzns in one clang test.Evgeniy Stepanov2015-07-151-2/+2
| | | | | | | The intent is to test Clang codegen at -O1, and not the LLVM optimization pipeline. llvm-svn: 242315
* Set comdat when an available_externally thunk is converted to linkonce_odr.Rafael Espindola2015-07-151-0/+17
| | | | | | Fixes pr24130. llvm-svn: 242293
* CodeGen: Improve CFI type blacklisting mechanism.Peter Collingbourne2015-07-151-0/+30
| | | | | | | | | | We now use the sanitizer special case list to decide which types to blacklist. We also support a special blacklist entry for types with a uuid attribute, which are generally COM types whose virtual tables are defined externally. Differential Revision: http://reviews.llvm.org/D11096 llvm-svn: 242286
* Fix for clang memcpyizer bugs 23911 and 23924 (patch by Denis Zobnin)Alexey Bataev2015-07-142-0/+93
| | | | | | | The fix is to remove duplicate copy-initialization of the only memcpy-able struct member and to correct the address of aggregately initialized members in destructors' calls during stack unwinding (in order to obtain address of struct member by using GEP instead of 'bitcast'). Differential Revision: http://reviews.llvm.org/D10990 llvm-svn: 242127
* Basic code generation for MSan use-after-dtor.Evgeniy Stepanov2015-07-141-0/+17
| | | | | | | | | Under the -fsanitize-memory-use-after-dtor (disabled by default) insert an MSan runtime library call at the end of every destructor. Patch by Naomi Musgrave. llvm-svn: 242097
* Set the linkage before setting the visibility.Rafael Espindola2015-07-131-0/+20
| | | | | | | | | Otherwise the visibility setting code would not know that a given function was available_externally. Fixes PR24097. llvm-svn: 242012
* Respect alignment when loading up a coerced function argumentUlrich Weigand2015-07-102-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Code in CGCall.cpp that loads up function arguments that need to be coerced to a different type may in some cases ignore the fact that the source of the argument is not naturally aligned. This may cause incorrect code to be generated. In some places in CreateCoercedLoad, we already have setAlignment calls to address this, but I ran into one where it was missing, causing wrong code generation on SystemZ. However, in that location, we do not actually know what alignment of the source location we can rely on; the callers do not pass anything to this routine. This is already an issue in other places in CreateCoercedLoad; and the same problem exists for CreateCoercedStore. To avoid pessimising code, and to fix the FIXMEs already in place, this patch also adds an alignment argument to the CreateCoerced* routines and uses it instead of forcing an alignment of 1. The callers are changed to pass in the best information they have. This actually requires changes in a number of existing test cases since we now get better alignment in many places. Differential Revision: http://reviews.llvm.org/D11033 llvm-svn: 241898
* CFI: Emit correct bit set information if RTTI is disabled under MS ABI.Peter Collingbourne2015-07-091-0/+12
| | | | | | | | | | | | | | We were previously creating bit set entries at virtual table offset sizeof(void*) unconditionally under the Microsoft C++ ABI. This is incorrect if RTTI data is disabled; in that case the "address point" is at offset 0. This change modifies bit set emission to take into account whether RTTI data is being emitted. Also make a start on a blacklisting scheme for records. Differential Revision: http://reviews.llvm.org/D11048 llvm-svn: 241845
* CodeGen: Fix off-by-one error in CFI class identification function for MS ABI.Peter Collingbourne2015-07-081-0/+23
| | | | | | We were previously ignoring classes laid out at offset zero. llvm-svn: 241729
* [EH] Fix for clang bug 24005 - no cleanup for array of memcpy-able objects ↵Alexey Bataev2015-07-081-0/+37
| | | | | | | | | in struct (patch by Denis Zobnin) The fix is to emit cleanup for arrays of memcpy-able objects in struct if an exception is thrown later during copy-construction. Differential Revision: http://reviews.llvm.org/D10989 llvm-svn: 241670
* [CodeGen] Correctly handle base classes which are passed in memoryDavid Majnemer2015-07-081-0/+16
| | | | | | | | | | | We didn't correctly process the case where a base class is classified as MEMORY. This would cause us to trip over an assertion. This fixes PR24020. Differential Revision: http://reviews.llvm.org/D10907 llvm-svn: 241667
* [CodeGen] Don't crash classifying a union of an AVX vector and an intDavid Majnemer2015-07-081-0/+9
| | | | | | | | | | | | We forgot to run postMerge after decided that the union had to be classified as MEMORY. This left us with Lo == MEMORY and Hi == SSEUp which is an invalid combination. This fixes PR24021. Differential Revision: http://reviews.llvm.org/D10908 llvm-svn: 241666
* [SEH] Switch from frameaddress(0) to localaddressReid Kleckner2015-07-071-2/+2
| | | | | | This should do the right thing for stack realignment prologues. llvm-svn: 241644
OpenPOWER on IntegriCloud