summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX
Commit message (Collapse)AuthorAgeFilesLines
* Abstract out virtual calls and virtual function prologue code generation; ↵Timur Iskhodzhanov2013-08-213-9/+224
| | | | | | implement them for -cxx-abi microsoft llvm-svn: 188870
* Test case for PR16933/r188707.David Blaikie2013-08-201-0/+11
| | | | llvm-svn: 188836
* Revert "Revert "Revert "Revert "DebugInfo: Omit debug info for dynamic ↵David Blaikie2013-08-202-9/+75
| | | | | | | | | | | | | | classes in TUs that do not have the vtable for that class"""" This reverts commit r188687 (reverts r188642 (reverts 188600 (reverts 188576))). With added test coverage & fix for -gline-tables-only. Thanks Michael Gottesman for reverting this patch when it demonstrated problems & providing a reproduction/details to help me track this down. llvm-svn: 188739
* Revert "Revert "Revert "DebugInfo: Omit debug info for dynamic classes in ↵Michael Gottesman2013-08-191-67/+9
| | | | | | | | | | | | | TUs that do not have the vtable for that class""" This reverts commit r188642. This change is causing LTO builds to cause our 16 GB machines to swap and OOM all weekend. I am going to work with Dave Blaikie to resolve the issue. Sorry Dave =(. llvm-svn: 188687
* Revert "Revert "DebugInfo: Omit debug info for dynamic classes in TUs that ↵David Blaikie2013-08-181-9/+67
| | | | | | | | | | | | do not have the vtable for that class"" This reverts commit r188600. r188640/r188639 fixed the root cause of the crash-on-valid that r188600 originally introduced. This now appears to bootstrap debug clang successfully to the best of my testing. llvm-svn: 188642
* DebugInfo: Avoid duplicating types that may be created during the process of ↵David Blaikie2013-08-181-0/+28
| | | | | | | | | | | | creating their context A partner to r188639, this is a somewhat heavy-handed fix to the general issue, since even after that prior change the issue does still unavoidably arise with template parameters (see test case). There are other ways we could consider addressing this (see FIXME). llvm-svn: 188640
* DebugInfo: Don't emit vbase 'containing types' for context chain limited typesDavid Blaikie2013-08-181-2/+17
| | | | | | | | | Possible minor reduction in debug info & avoid some cases where creating a context chain could lead to the type the context chain is being created for, being created. (this is still possible with template parameters - tests/fixes/improvements to follow) llvm-svn: 188639
* DebugInfo: don't require full definitions for friend classesDavid Blaikie2013-08-181-5/+11
| | | | | | | | | | Fixes a crash-on-valid introduced by r188486 (which should've occurred earlier but for a blatant bug where calling createFwdDecl from the requireCompleteType callback was useless under -flimit-debug-info and we were just getting lucky with other later callbacks requiring the type anyway). llvm-svn: 188622
* PR16927: Don't assert (or, previously, skip) static data members of ↵David Blaikie2013-08-171-1/+5
| | | | | | enumeration type llvm-svn: 188612
* Revert "DebugInfo: Omit debug info for dynamic classes in TUs that do not ↵David Blaikie2013-08-171-46/+4
| | | | | | | | | | have the vtable for that class" This reverts commit r188576. Reverting while I investigate a selfhosting buildbot failure on Darwin. llvm-svn: 188600
* DebugInfo: Canonicalize namespaces to avoid emitting multiple namespaces ↵David Blaikie2013-08-161-15/+17
| | | | | | | | | | | | with the same name but different lines Updated test case to not rely on line numbers in more cases (it's hard to use the @ check syntax for debug info test cases (due to the interesting ordering of metadata) and this case in particular (given the hash-line directive)) - left a few in there to cover the line number information for these. llvm-svn: 188585
* DebugInfo: Omit debug info for dynamic classes in TUs that do not have the ↵David Blaikie2013-08-161-4/+46
| | | | | | | | | vtable for that class This reduces Clang's .dwo (fission debug info) size by 23% over Clang+LLVM. llvm-svn: 188576
* Parse: Do not 'HandleTopLevelDecl' on templated functions.David Majnemer2013-08-161-2/+11
| | | | | | | | | | | | | | | | Summary: HandleTopLevelDecl on a templated function leads us to try and mangle it. Reviewers: rsmith Reviewed By: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1412 llvm-svn: 188536
* CodeGen: __uuidof should work even with an incomplete _GUID typeDavid Majnemer2013-08-152-42/+61
| | | | | | | | | | | | | | | | | | | | | | | | Summary: We would crash in CodeGen::CodeGenModule::EmitUuidofInitializer because our attempt to enter CodeGen::CodeGenModule::EmitConstantValue will be foiled: the type of the constant value is incomplete. Instead, create an unnamed type with the proper layout on all platforms. Punt the problem of wrongly defined struct _GUID types to the user. (It's impossible because the TU may never get to see the type and thus we can't verify that it is suitable.) This fixes PR16856. Reviewers: rsmith, rnk, thakis Reviewed By: rnk CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1375 llvm-svn: 188481
* Add back a test that was removed in r188450David Majnemer2013-08-151-0/+1
| | | | llvm-svn: 188453
* [-cxx-abi microsoft] Mangle member pointers betterDavid Majnemer2013-08-151-1/+34
| | | | | | | | | | | | | | | | | | | | Summary: There were several things going wrong: - We mangled in useless qualifiers like "volatile void" return types. - We didn't propagate 64-bit pointer markers sufficiently. - We mangled qualifiers belonging to the pointee incorrectly. This fixes PR16844 and PR16848. Reviewers: rnk, whunt Reviewed By: rnk CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1353 llvm-svn: 188450
* CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin2013-08-15157-1047/+1047
| | | | | | tests fail. llvm-svn: 188447
* [-cxx-abi microsoft] Mangle __uuidof correctly into template parametersDavid Majnemer2013-08-131-2/+16
| | | | | | | | | | | | | | | | | | | | | | | Summary: It seems that __uuidof introduces a global extern "C" declaration of type __s_GUID. However, our implementation of __uuidof does not provide such a declaration and thus must open-code the mangling for __uuidof in template parameters. This allows us to codegen scoped COM pointers and other such things. This fixes PR16836. Depends on D1356. Reviewers: rnk, cdavis5x, rsmith Reviewed By: rnk CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1357 llvm-svn: 188252
* [-cxx-abi microsoft] Mangle TemplateArgument::Declaration for referencesDavid Majnemer2013-08-131-0/+11
| | | | | | | | | | | | | | | | Summary: Properly mangle declarations showing up in template arguments that are reference parameters. Fun-fact: undname cannot handle these! Reviewers: rnk, cdavis5x Reviewed By: rnk CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1356 llvm-svn: 188245
* Fix FileCheck --check-prefix lines.Tim Northover2013-08-1221-42/+42
| | | | | | | | | | 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
* Only emit debug info for implicit members that actually get codegen, not ↵David Blaikie2013-08-093-28/+22
| | | | | | | | | | | | just ODR use. This includes special members (copy/default ctor, copy assign, default ctor) and template specializations for member function templates. Good for a 5% decrease (1.80 to 1.71 GB) in size on Clang+LLVM's .dwo files (when using fission). llvm-svn: 188085
* Sema: Assertion failure during CodeGen in CodeGenModule::EmitUuidofInitializerDavid Majnemer2013-08-091-0/+8
| | | | | | | | | Make sure we can properly generate code when the UUID has curly braces on it, strip the curly braces at the sema layer. This fixes PR16813. llvm-svn: 188061
* [-cxx-abi microsoft] Mangle UUIDs correctly, stick them in the proper sectionDavid Majnemer2013-08-091-13/+13
| | | | | | Revert r188055 which reverted r188053. An unrelated change previously snuck in. llvm-svn: 188060
* Revert "[-cxx-abi microsoft] Mangle UUIDs correctly, stick them in the ↵David Majnemer2013-08-091-13/+13
| | | | | | | | | | proper section" This commit reverts r188053. It is breaking the build bots. llvm-svn: 188055
* [-cxx-abi microsoft] Mangle UUIDs correctly, stick them in the proper sectionDavid Majnemer2013-08-091-13/+13
| | | | | | | | | | | | We mangled them like: L___uuid_12345678-1234-1234-1234-123456789abc We should've mangled them like: __GUID_12345678_1234_1234_1234_123456789abc Furthermore, they are external symbols. llvm-svn: 188053
* catch-undefined-behavior.cpp: Remove names that don't appear in every build.Filipe Cabecinhas2013-08-081-3/+3
| | | | llvm-svn: 187952
* UBSan: Fix naming for IR variables in catch-undef-behavior.cppFilipe Cabecinhas2013-08-081-2/+2
| | | | llvm-svn: 187951
* UBSan: Fix alignment checks emitted in downcasts.Filipe Cabecinhas2013-08-081-1/+52
| | | | | | | | | | | Summary: UBSan was checking for alignment of the derived class on the pointer to the base class, before converting. With some class hierarchies, this could generate false positives. Added test-case. llvm-svn: 187948
* [ms-cxxabi] Properly mangle member pointersDavid Majnemer2013-08-052-20/+20
| | | | | | | | | | There were three things missing from the original implementation: - We would omit the 'E' qualifier for members int 64-bit mode. - We would not exmaine the qualifiers in 'IsMember' mode. - We didn't generate the correct backref to the base class. llvm-svn: 187753
* [ms-cxxabi] Handle template-template argumentsDavid Majnemer2013-08-051-0/+29
| | | | | | | Template-template arguments appear to be a rather simple encoding of the template's templated tag type. llvm-svn: 187751
* [ms-cxxabi] Mangle nullptr template argumentsDavid Majnemer2013-08-051-2/+7
| | | | | | MSVC mangles nullptr template arguments identically to zero literals. llvm-svn: 187741
* Emit the constructor for abstract classes when using -cxx-abi microsoft, ↵Timur Iskhodzhanov2013-08-041-0/+9
| | | | | | fixes PR16735 llvm-svn: 187709
* DebugInfo: Don't prefer declarations over definitions in -flimit-debug-info in CDavid Blaikie2013-08-011-5/+3
| | | | | | | | | Without an ODR, the -flimit-debug-info debug info size optimization of emitting declarations for fully defined types when only a declaration is needed by the TU, is incorrect. Emit the full definition whenever it's available in non-C++. llvm-svn: 187611
* DebugInfo: Emit template arguments for limited types used for context.David Blaikie2013-08-011-6/+9
| | | | | | | | We emit definitions with no members when a nested type is referenced/required (GCC does the same, to be fair) but failed to attach the template arguments in such a case. llvm-svn: 187608
* AArch64: initial NEON supportTim Northover2013-08-012-5/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Ana Pazos - Completed implementation of instruction formats: AdvSIMD three same AdvSIMD modified immediate AdvSIMD scalar pairwise - Completed implementation of instruction classes (some of the instructions in these classes belong to yet unfinished instruction formats): Vector Arithmetic Vector Immediate Vector Pairwise Arithmetic - Initial implementation of instruction formats: AdvSIMD scalar two-reg misc AdvSIMD scalar three same - Intial implementation of instruction class: Scalar Arithmetic - Initial clang changes to support arm v8 intrinsics. Note: no clang changes for scalar intrinsics function name mangling yet. - Comprehensive test cases for added instructions To verify auto codegen, encoding, decoding, diagnosis, intrinsics. llvm-svn: 187568
* Check dynamic_cast is not used with -fno-rtti, unless it is a noop or can be ↵Arnaud A. de Grandmaison2013-08-011-0/+26
| | | | | | resolved statically. llvm-svn: 187564
* Add MicrosoftVFTableContext to ASTTimur Iskhodzhanov2013-07-303-2/+902
| | | | llvm-svn: 187409
* PR16715: Fix assert in verifier: only mark call to 'operator new' as ↵Richard Smith2013-07-291-0/+10
| | | | | | | | 'builtin' if corresponding 'operator new' was actually emitted as a function marked 'nobuiltin'. llvm-svn: 187374
* Debug Info / EmitCallArgs: arguments may modify the debug location.Adrian Prantl2013-07-261-0/+25
| | | | | | | | | | Restore it after each argument is emitted. This fixes the scope info for inlined subroutines inside of function argument expressions. (E.g., anything STL). rdar://problem/12592135 llvm-svn: 187240
* Debug Info: Fine-tune the simple return expression location handling toAdrian Prantl2013-07-251-0/+34
| | | | | | | only affect functions without a separate return block. This fixes the linetable for void functions with cleanups and multiple returns. llvm-svn: 187090
* typo.Adrian Prantl2013-07-241-1/+1
| | | | llvm-svn: 187075
* Make test pass in Release builds, IR names don't get emitted there.Benjamin Kramer2013-07-241-3/+3
| | | | llvm-svn: 187054
* Use ARM-style representation for C++ method pointers under PNaCl/EmscriptenMark Seaborn2013-07-242-0/+17
| | | | | | | | | | | | | | | | | | | Before this change, Clang uses the x86 representation for C++ method pointers when generating code for PNaCl. However, the resulting code will assume that function pointers are 0 mod 2. This assumption is not safe for PNaCl, where function pointers could have any value (especially in future sandboxing models). So, switch to using the ARM representation for PNaCl code, which makes no assumptions about the alignment of function pointers. Since we're changing the "le32" target, this change also applies to Emscripten. The change is beneficial for Emscripten too. Emscripten has a workaround to make function pointers 0 mod 2. This change would allow the workaround to be removed. See: https://code.google.com/p/nativeclient/issues/detail?id=3450 llvm-svn: 187051
* [ms-cxxabi] Emit linkonce complete dtors in TUs that need themReid Kleckner2013-07-221-14/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Test updates missed from r186799.Richard Smith2013-07-213-3/+3
| | | | llvm-svn: 186800
* Tighten up the set of operator new/operator delete calls we're permitted toRichard Smith2013-07-211-5/+83
| | | | | | | | | 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
* Replace TEST* with CHECK-DAG in vbtable testsTimur Iskhodzhanov2013-07-171-185/+161
| | | | llvm-svn: 186502
* Make these tests more robust against IRgen choosing to emit more named metadata.Richard Smith2013-07-141-21/+21
| | | | llvm-svn: 186279
* Delete a test that is checking badly for a point bug that Clang never had ↵Richard Smith2013-07-141-12/+0
| | | | | | (and that spuriously fails with modules enabled). llvm-svn: 186278
* PR16214, PR14467: DebugInfo: use "RequireCompleteType" to decide when to ↵David Blaikie2013-07-131-6/+22
| | | | | | | | | | | | | | | emit the full definition of a type in -flimit-debug-info This simplifies the core benefit of -flimit-debug-info by taking a more systematic approach to avoid emitting debug info definitions for types that only require declarations. The previous ad-hoc approach (3 cases removed in this patch) had many holes. The general approach (adding a bit to TagDecl and callback through ASTConsumer) has been discussed with Richard Smith - though always open to revision. llvm-svn: 186262
OpenPOWER on IntegriCloud