aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX
AgeCommit message (Collapse)Author
2014-02-24Introduce the asmjs-unknown-emscripten target triple.Dan Gohman
Notable changes from le32-unknown-nacl so far include: - Set i32 as the legal integer set, to help the optimizer avoid creating needlessly inefficient code for asm.js. - We can use llvm.pow. - Don't predefine __ELF__ or __pnacl__ so that we don't need to undefine them later. - Do predefine asm.js and Emscripten macros, so that we don't need to define them later. - Don't provide __has_feature(pnacl).
2013-07-25Add a -finstrument-functions-size=n option to control basic blockRobert Grosse
filtering. If omitted entirely, the original behavior is restored. This also undos the string and __pnacl_profile stuff from the previous CL. Finally, it fixes and updates the -finstrument-function tests. BUG=none R=bradnelson@google.com, dschuff@chromium.org Review URL: https://codereview.chromium.org/19793007
2013-07-15Merge commit '20c7d45a4da9f58ad805ad1d37f92fe7dc232ec8'Eli Bendersky
Conflicts: lib/CodeGen/ItaniumCXXABI.cpp
2013-07-12Merge branch 'master' of http://git.chromium.org/native_client/pnacl-clangEli Bendersky
2013-06-24Switch back to non-ARM ABI for C++ guard variables under PNaClMark Seaborn
My previous change set IsARM=true for PNaCl in ItaniumCXXABI.cpp. This gives us ARM-style representation of method pointers, which we want, and ARM-style usage of guard variables, which we don't necessarily want. Switch the latter back so that the guard variable is tested via "load i8 and compare with zero" rather than a "load i32 and test the bottom bit". This should make the Clang-generated code match with how libstdc++ is using the guard variable. This makes the code match the patch I sent upstream (which hasn't been committed yet). BUG=https://code.google.com/p/nativeclient/issues/detail?id=3450 TEST=test/CodeGenCXX/static-init-pnacl.cpp Review URL: https://codereview.chromium.org/17616003
2013-06-19Use ARM-style representation for C++ method pointers under PNaClMark Seaborn
This avoids baking into pexes an assumption that function pointers are 0 mod 2, which might not be the case in future sandboxing models. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3450 TEST=run_method_pointer_repr_test in NaCl + llvm-lit test Review URL: https://codereview.chromium.org/17419005
2013-05-16Merging r181465:Bill Wendling
------------------------------------------------------------------------ r181465 | rsmith | 2013-05-08 13:32:14 -0700 (Wed, 08 May 2013) | 2 lines Add missing triple to unit test. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_33@182037 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08Merging r181368:Bill Wendling
------------------------------------------------------------------------ r181368 | rsmith | 2013-05-07 14:53:22 -0700 (Tue, 07 May 2013) | 3 lines Don't crash in IRGen if a conditional with 'throw' in one of its branches is used as a branch condition. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_33@181401 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-06DebugInfo: Support imported modules (using directives) within lexical blocks.David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181272 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Reapply r180982 with repaired logic and an additional testcase.Adrian Prantl
Un-break the gdb buildbot. - Use the debug location of the return expression for the cleanup code if the return expression is trivially evaluatable, regardless of the number of stop points in the function. - Ensure that any EH code in the cleanup still gets the line number of the closing } of the lexical scope. - Added a testcase with EH in the cleanup. rdar://problem/13442648 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181056 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Revert "Attempt to un-break the gdb buildbot."Adrian Prantl
This reverts commit 180982. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180990 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03[ms-cxxabi] Emit non-virtual member function pointersReid Kleckner
Without any conversion, this is pretty straightforward. Most of the fields can be zeros. The order is: - field offset or pointer - nonvirtual adjustment (for MI functions) - vbptr offset (for unspecified) - virtual adjustment offset (for virtual inheritance) Differential Revision: http://llvm-reviews.chandlerc.com/D699 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180985 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Attempt to un-break the gdb buildbot.Adrian Prantl
- Use the debug location of the return expression for the cleanup code if the return expression is trivially evaluatable, regardless of the number of stop points in the function. - Ensure that any EH code in the cleanup still gets the line number of the closing } of the lexical scope. - Added a testcase with EH in the cleanup. rdar://problem/13442648 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180982 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02Use the Itanium ABI for thread_local on Darwin.Bill Wendling
After some discussion, it was decided to use the Itanium ABI for thread_local on Darwin OS X platforms. This involved a couple of changes. First, we use "_tlv_atexit" instead of "__cxa_thread_atexit". Secondly, the global variables are marked with 'internal' linkage, because we want all access to be calls to the Itanium-specific entry point, which has normal linkage. <rdar://problem/13733006> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180941 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-30Revert r180739 and r180748: they broke C++11 thread_local on non-Darwin ↵Richard Smith
systems and did not do the right thing on Darwin. Original commit message: Emit the TLS intialization functions into a list. Add the TLS initialization functions to a list of initialization functions. The back-end takes this list and places the function pointers into the correct section. This way they're called before `main().' <rdar://problem/13733006> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180809 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-30[ms-cxxabi] Implement member pointer comparisonsReid Kleckner
Summary: Like Itanium, comparisons are basically bitwise comparisons of the two values, with an exception for null member function pointers. If two function pointers are null, only the function pointer field matters for comparison purposes. The rest of the bits can be arbitrary. We take advantage of this in isZeroInitializable(), and it may matter once we start emitting conversions. Reviewers: rjmccall CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D695 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180800 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29Modify triple to try to make it pass on ARM.Bill Wendling
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180748 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29Emit the TLS intialization functions into a list.Bill Wendling
Add the TLS initialization functions to a list of initialization functions. The back-end takes this list and places the function pointers into the correct section. This way they're called before `main().' <rdar://problem/13733006> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180739 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26Support debug info for using directives at global/namespace scope.David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180594 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-25[ms-cxxabi] Fix a number of bugs in the mangler.Peter Collingbourne
This includes the following fixes: - Implement 4 subtly different variants of qualifier mangling and use them in what I believe are the right places. - Fix handling of array types. Previously we were always decaying them, which is wrong if the type appears as a template argument, pointee, referent etc. Fixes PR13182. Differential Revision: http://llvm-reviews.chandlerc.com/D709 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180250 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-22Move debug info tests for scoped enums into a separate file.Adrian Prantl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180026 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-22Cleanup: test source file does not need to be executableArnaud A. de Grandmaison
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180002 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-22Revert "Revert "PR14606: Debug info for using ↵David Blaikie
directives/DW_TAG_imported_module"" This reverts commit 179839 now that the corresponding LLVM patch has been fixed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179997 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-20C++1y: Allow aggregates to have default initializers.Richard Smith
Add a CXXDefaultInitExpr, analogous to CXXDefaultArgExpr, and use it both in CXXCtorInitializers and in InitListExprs to represent a default initializer. There's an additional complication here: because the default initializer can refer to the initialized object via its 'this' pointer, we need to make sure that 'this' points to the right thing within the evaluation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179958 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19cleanup and relax test casesAdrian Prantl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179896 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19Emit the underlying type in the debug info for all kinds of fixed enumsAdrian Prantl
instead of only C++11-scoped-with-class-tag enums. rdar://problem/13463793 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179879 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19Implement CodeGen for C++11 thread_local, following the Itanium ABI ↵Richard Smith
specification as discussed on cxx-abi-dev. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179858 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19Revert "PR14606: Debug info for using directives/DW_TAG_imported_module"Eric Christopher
This reverts commit r179837 as it seems to be causing test failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179839 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-19PR14606: Debug info for using directives/DW_TAG_imported_moduleDavid Blaikie
More changes later for using declarations/DW_TAG_imported_declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179837 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-17Set SRet flags properly in '-cxx-abi microsoft'.Timur Iskhodzhanov
Also, - abstract out the indirect/in memory/in registers decisions into the CGCXXABI - fix handling of empty struct arguments for '-cxx-abi microsoft' - add/fix tests git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179681 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-16Use -emit-llvm for the following tests to stop them from failing for Hexagon:Jyotsna Verma
CodeGenCXX/vtable-debug-info.cpp Driver/objc++-cpp-output.mm Driver/objc-cpp-output.m git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179602 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-16Correctly propagate the storage class to function template instantiations.Rafael Espindola
This fixes pr15753. This is another case of the fuzzy definition of the "as written" storage class of an instantiation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179581 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-14CodeGen support for function-local static thread_local variables withRichard Smith
non-constant constructors or non-trivial destructors. Plus bugfixes for thread_local references bound to temporaries (the temporaries themselves are lifetime-extended to become thread_local), and the corresponding case for std::initializer_list. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179496 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11Widen the checks in the ms abi memptr test to work under NDEBUGReid Kleckner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179311 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11[ms-cxxabi] Implement member pointer emission and dereferencingReid Kleckner
Summary: Handles all inheritance models for both data and function member pointers. Also implements isZeroInitializable() and refactors some of the null member pointer code. MSVC supports converting member pointers through virtual bases, which clang does not (yet?) support. Implementing that extension is covered by http://llvm.org/15713 Reviewers: rjmccall CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D613 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179305 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10C++11 inheriting constructors: support for inheriting constructor templates.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179151 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-09[ms-cxxabi] Add "$$C" when mangling template arg QualTypesReid Kleckner
Credit goes to Timur Iskhodzhanov for finding the problem and solution. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179093 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-06When an internal-linkage function or variable is declared within an extern "C"Richard Smith
linkage specification, and is marked as __attribute__((used)), try to also give it the unmangled name (by emitting an internal linkage alias) if nothing else within the translation unit would use that name. This allows inline asm in that translation unit to use the entity via its unmangled name, which people apparently rely on. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178950 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-06<rdar://problem/13325066> Destroy std::initializer_list temporaries whose ↵Douglas Gregor
lifetime has been extended by reference binding. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178939 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-02Revert "Revert r178079, it caused PR15637."Eric Christopher
This reverts commit r178497 since the backend has been fixed. Also add a test to ensure that we're emitting template information for unions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178587 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-01Revert r178079, it caused PR15637.Nico Weber
Also add a test for PR15637. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178497 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-01* Attempt to un-break gdb buildbot by emitting a lexical block end onlyAdrian Prantl
when we actually end a lexical block. * Added new test for line table / block cleanup. * Follow-up to r177819 / rdar://problem/13115369 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178490 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-01Modifed debug-info-byval.cpp test to grep for .string or .asciz.Jyotsna Verma
The assembly output for Hexagon contains ".string missing_arg". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178471 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-29Bugfix/Followup for r177086.Adrian Prantl
* Store the .block_descriptor (instead of self) in the alloca so we can guarantee that all captured variables are available at -O0. * Add the missing OpDeref for the alloca. rdar://problem/12767564 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178361 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28Revert "Update debug info test for schema change made to LLVM."David Blaikie
This reverts commit 5035c483b7fcbf0fa2a7afba24fa35a10995d195. This schema change wasn't necessary after all. I'm going ith a different solution that will hopefully use space more conservatively. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178213 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27Update debug info test for schema change made to LLVM.David Blaikie
This accounts for the addition of another field to DIScopes that will be used to store a list of DIImportedModules in the future. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178100 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26clang/test/CodeGenCXX/debug-info-namespace.cpp: Disable it on non-bash lit ↵NAKAMURA Takumi
for now. With dosish filename, it misgenerates an improper extra entry. !1 = metadata !{metadata !"E:\5Cllvm\5Cllvm-project\5Cclang\5Ctest\5CCodeGenCXX/debug-info-namespace.cpp", metadata !"E:\5Cllvm\5Cbuild\5Cninja-win32-vs11\5Ctools\5Cclang\5Ctest\5CCodeGenCXX"} !8 = metadata !{metadata !"E:\5Cllvm\5Cllvm-project\5Cclang\5Ctest\5CCodeGenCXX\5Cdebug-info-namespace.cpp", metadata !"E:\5Cllvm\5Cbuild\5Cninja-win32-vs11\5Ctools\5Cclang\5Ctest\5CCodeGenCXX"} !8 is unexpected. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178061 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26[ms-cxxabi] Mangle vector typesReid Kleckner
Summary: The only vector types a user can pass from MSVC code to clang code are the ones from *mmintrin.h, so we only have to match the MSVC mangling for these types. MSVC mangles the __m128 family of types as tag types, which we match. For other vector types, we emit a unique tag type mangling that won't match anything produced by MSVC. Reviewers: rjmccall CC: chandlerc, timurrrr, cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D576 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178036 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22[ms-cxxabi] Implement member data pointers for non-dynamic classesReid Kleckner
Summary: For non-dynamic classes (no virtual bases), member data pointers are simple offsets from the base of the record. Dynamic classes use an aggregate for member data pointers and are therefore currently unsupported. Unlike Itanium, the ms ABI uses 0 to represent null for polymorphic classes. Non-polymorphic classes use -1 like Itanium, since 0 is a valid field offset. Reviewers: rjmccall CC: timurrrr, cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D558 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177753 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22Fix a crash-on-valid where a block capture copy expression wasJohn McCall
picking up cleanups from earlier in the statement. Also fix a crash-on-invalid where a reference to an invalid decl from an enclosing scope was causing an expression to fail to build, but only *after* a cleanup was registered from that statement, causing an assertion downstream. The crash-on-valid is rdar://13459289. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177692 91177308-0d34-0410-b5e6-96231b3b80d8