summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX
Commit message (Collapse)AuthorAgeFilesLines
* Fix temporary lifetime extension from an initializer using braced "functional"Richard Smith2015-01-101-0/+7
| | | | | | cast notation T{...} when T is a reference type. llvm-svn: 225571
* Don't emit implicit template instantiations eagerly (PR21718)Hans Wennborg2015-01-102-0/+28
| | | | | | | | | | | | | | Their linkage can change if they are later explicitly instantiated. We would previously emit such functions eagerly (as opposed to lazily on first use) if they have a 'dllexport' or 'used' attribute, and fail an assert when hitting the explicit instantiation. This is achieved by replacing the old CodeGenModule::MayDeferGeneration() method with two new ones: MustBeEmitted() and MayBeEmittedEagerly(). Differential Revision: http://reviews.llvm.org/D6674 llvm-svn: 225570
* Remove unnecessary/incorrect XFAIL after the revert of 225000David Blaikie2015-01-091-2/+0
| | | | llvm-svn: 225561
* Revert "DebugInfo: Generalize debug info location handling" and related commitsDavid Blaikie2015-01-093-39/+11
| | | | | | | | | | | | This reverts commit r225000, r225021, r225083, r225086, r225090. The root change (r225000) still has several issues where it's caused calls to be emitted without debug locations. This causes assertion failures if/when those calls are inlined. I'll work up some test cases and fixes before recommitting this. llvm-svn: 225555
* IR: Add 'distinct' MDNodes to bitcode and assembly (clang)Duncan P. N. Exon Smith2015-01-082-2/+2
| | | | | | | | | Update testcases for LLVM change in r225474 to make `MDNode`s explicitly distinct (when they aren't uniqued). Part of PR22111. llvm-svn: 225475
* Slightly simplify the test from r225361.Nico Weber2015-01-071-22/+7
| | | | | | | | Shorter and doesn't need -O2 -- but still suboptimal as it's still doing -emit-obj. dblaikie says he'll improve this when he'll reland his change with a fix. llvm-svn: 225364
* Revert r225085, it caused PR22096.Nico Weber2015-01-071-0/+26
| | | | | | | | PR22096 has several test cases that assert that look fairly different. I'm adding one of those as an automated test, but when relanding the other cases should probably be checked as well. llvm-svn: 225361
* Debug info: pass in the correct size for a pointer to a member function.Adrian Prantl2015-01-071-0/+10
| | | | | | This corrects a bug I introduced in r224781. llvm-svn: 225359
* Suppress clang warnings in a codegen test.Rafael Espindola2015-01-061-8/+8
| | | | | | | This makes the output of FileCheck way easier to read since this test hits many warnings. llvm-svn: 225322
* Update for .ll syntax change.Rafael Espindola2015-01-066-19/+19
| | | | llvm-svn: 225303
* Make this test a bit stricter.Rafael Espindola2015-01-051-7/+7
| | | | | | | The first function is named __cxx_global_var_init, which is a substring of the following functions @__cxx_global_var_init(1,2,3,etc). llvm-svn: 225191
* Disable warnings in this test.Rafael Espindola2015-01-051-4/+4
| | | | | | This makes it a lot easier to read the output from FileCheck when it fails. llvm-svn: 225190
* DebugInfo: Fix cases where location failed to be updated after r225000David Blaikie2015-01-021-0/+10
| | | | | | | | | | | | | The optimization (that appears to have been here since the earliest implementation (r50848) & has become more complicated over the years) to avoid recreating the debugloc if it would be the same was out of date because ApplyDebugLocation was not re-updating the CurLoc/PrevLoc. This optimization doesn't look terribly beneficial/necessary, so I'm removing it - if it turns up in benchmarks, I'm happy to reconsider/reimplement this with justification, but for now it just seems to add complexity/problems. llvm-svn: 225083
* CodeGen: Don't crash when a lambda uses a local constexpr variableDavid Majnemer2015-01-011-2/+10
| | | | | | | | | | | The DeclRefExpr might be for a variable initialized by a constant expression which hasn't been ODR used. Emit the initializer for the variable instead of trying to capture the variable itself. This fixes PR22071. llvm-svn: 225060
* XFAIL test on win32 due to missing __complex supportDavid Blaikie2014-12-311-0/+2
| | | | llvm-svn: 225051
* Handle PPC64 return type (signext i32 rather than plain i32) in test caseDavid Blaikie2014-12-311-1/+1
| | | | llvm-svn: 225021
* Reapply "DebugInfo: Generalize debug info location handling"David Blaikie2014-12-303-11/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally committed in r224385 and reverted in r224441 due to concerns this change might've introduced a crash. Turns out this change fixes the crash introduced by one of my earlier more specific location handling changes (those specific fixes are reverted by this patch, in favor of the more general solution). Recommitted in r224941 and reverted in r224970 after it caused a crash when building compiler-rt. Looks to be due to this change zeroing out the debug location when emitting default arguments (which were meant to inherit their outer expression's location) thus creating call instructions without locations - these create problems for inlining and must not be created. That is fixed and tested in this version of the change. Original commit message: This is a more scalable (fixed in mostly one place, rather than many places that will need constant improvement/maintenance) solution to several commits I've made recently to increase source fidelity for subexpressions. This resetting had to be done at the DebugLoc level (not the SourceLocation level) to preserve scoping information (if the resetting was done with CGDebugInfo::EmitLocation, it would've caused the tail end of an expression's codegen to end up in a potentially different scope than the start, even though it was at the same source location). The drawback to this is that it might leave CGDebugInfo out of sync. Ideally CGDebugInfo shouldn't have a duplicate sense of the current SourceLocation, but for now it seems it does... - I don't think I'm going to tackle removing that just now. I expect this'll probably cause some more buildbot fallout & I'll investigate that as it comes up. Also these sort of improvements might be starting to show a weakness/bug in LLVM's line table handling: we don't correctly emit is_stmt for statements, we just put it on every line table entry. This means one statement split over multiple lines appears as multiple 'statements' and two statements on one line (without column info) are treated as one statement. I don't think we have any IR representation of statements that would help us distinguish these cases and identify the beginning of each statement - so that might be something we need to add (possibly to the lexical scope chain - a scope for each statement). This does cause some problems for GDB and possibly other DWARF consumers. llvm-svn: 225000
* Revert "DebugInfo: Generalize debug info location handling"David Blaikie2014-12-293-18/+11
| | | | | | | | | Asserting when building compiler-rt when using a GCC host compiler. Reverting while I investigate. This reverts commit r224941. llvm-svn: 224970
* PR22051: Missing debug location on calls in dtor thunks in Windows.David Blaikie2014-12-291-0/+22
| | | | llvm-svn: 224963
* Reapply "DebugInfo: Generalize debug info location handling"David Blaikie2014-12-293-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally committed in r224385 and reverted in r224441 due to concerns this change might've introduced a crash. Turns out this change fixes the crash introduced by one of my earlier more specific location handling changes (those specific fixes are reverted by this patch, in favor of the more general solution). Original commit message: This is a more scalable (fixed in mostly one place, rather than many places that will need constant improvement/maintenance) solution to several commits I've made recently to increase source fidelity for subexpressions. This resetting had to be done at the DebugLoc level (not the SourceLocation level) to preserve scoping information (if the resetting was done with CGDebugInfo::EmitLocation, it would've caused the tail end of an expression's codegen to end up in a potentially different scope than the start, even though it was at the same source location). The drawback to this is that it might leave CGDebugInfo out of sync. Ideally CGDebugInfo shouldn't have a duplicate sense of the current SourceLocation, but for now it seems it does... - I don't think I'm going to tackle removing that just now. I expect this'll probably cause some more buildbot fallout & I'll investigate that as it comes up. Also these sort of improvements might be starting to show a weakness/bug in LLVM's line table handling: we don't correctly emit is_stmt for statements, we just put it on every line table entry. This means one statement split over multiple lines appears as multiple 'statements' and two statements on one line (without column info) are treated as one statement. I don't think we have any IR representation of statements that would help us distinguish these cases and identify the beginning of each statement - so that might be something we need to add (possibly to the lexical scope chain - a scope for each statement). This does cause some problems for GDB and possibly other DWARF consumers. llvm-svn: 224941
* Sema: Permit an atomic type to be initialized by the same atomic typeDavid Majnemer2014-12-281-0/+4
| | | | | | | | | We forgot a conversion step when initializing an atomic type with an rvalue of the same type. This fixes PR22043. llvm-svn: 224902
* Debug Info: Pass the pointer size into createMemberPointerType().Adrian Prantl2014-12-231-1/+1
| | | | | | Paired commit with LLVM. llvm-svn: 224781
* Rename test.cc files to test.cpp.Nico Weber2014-12-222-0/+0
| | | | | | | The lit.cfg files only add .cpp to suffixes, so these tests used to never run, oops. (Also tweak to of these tests in minor ways to make the actually pass.) llvm-svn: 224718
* Tweak the assert in ModuleBuilder from r224533 (PR21989)Hans Wennborg2014-12-191-0/+9
| | | | | | | Turns out there will be left-over deferred inline methods if there have been errors, because in that case HandleTopLevelDecl bails out early. llvm-svn: 224649
* Fix for PR21915: assert on multidimensional VLA in function arguments.Alexey Bataev2014-12-181-0/+22
| | | | | | | Fixed assertion on type checking for arguments and parameters on function call if arguments are pointers to VLA Differential Revision: http://reviews.llvm.org/D6655 llvm-svn: 224504
* Make sure that arm-linux-gnu is still the apcs-gnu ABI when weEric Christopher2014-12-181-1/+1
| | | | | | | | | | | | use clang -cc1 matching the front end and backend. Fix up a couple of tests that were testing aapcs for arm-linux-gnu. The test that removes the aapcs abi calling convention removes them because the default triple matches what the backend uses for the calling convention there and so it doesn't need to be explicitly stated - see the code in TargetInfo.cpp. llvm-svn: 224491
* CGDebugInfo: Use DIBuilder API for self-referencing DICompositeTypesDuncan P. N. Exon Smith2014-12-181-0/+15
| | | | | | | | | | | Use new `DIBuilder` API from LLVM r224482 to mutate `DICompositeType`s, rather than changing them directly. This allows `DIBuilder` to track otherwise orphaned cycles when `CollectContainingType()` creates a self-reference. Fixes PR21941. llvm-svn: 224483
* Revert "Put static local variables of inline functions in the function comdat."Rafael Espindola2014-12-171-3/+6
| | | | | | | | | This reverts commit r224369. Thanks to Reid Kleckner for pointing out that we need a bigger gun to fix this case. llvm-svn: 224475
* Revert "DebugInfo: Generalize debug info location handling"David Blaikie2014-12-172-9/+11
| | | | | | | | | Fails an ASan bootstrap - I'll try to reproduce locally & sort that out before recommitting. This reverts commit r224385. llvm-svn: 224441
* PR21909: Don't try (and crash) to generate debug info for explicit ↵David Blaikie2014-12-161-0/+8
| | | | | | instantiations of explicit specializations. llvm-svn: 224394
* DebugInfo: Generalize debug info location handlingDavid Blaikie2014-12-162-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a more scalable (fixed in mostly one place, rather than many places that will need constant improvement/maintenance) solution to several commits I've made recently to increase source fidelity for subexpressions. This resetting had to be done at the DebugLoc level (not the SourceLocation level) to preserve scoping information (if the resetting was done with CGDebugInfo::EmitLocation, it would've caused the tail end of an expression's codegen to end up in a potentially different scope than the start, even though it was at the same source location). The drawback to this is that it might leave CGDebugInfo out of sync. Ideally CGDebugInfo shouldn't have a duplicate sense of the current SourceLocation, but for now it seems it does... - I don't think I'm going to tackle removing that just now. I expect this'll probably cause some more buildbot fallout & I'll investigate that as it comes up. Also these sort of improvements might be starting to show a weakness/bug in LLVM's line table handling: we don't correctly emit is_stmt for statements, we just put it on every line table entry. This means one statement split over multiple lines appears as multiple 'statements' and two statements on one line (without column info) are treated as one statement. I don't think we have any IR representation of statements that would help us distinguish these cases and identify the beginning of each statement - so that might be something we need to add (possibly to the lexical scope chain - a scope for each statement). This does cause some problems for GDB and possibly other DWARF consumers. llvm-svn: 224385
* Put static local variables of inline functions in the function comdat.Rafael Espindola2014-12-161-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | The variable (and the GV) is only ever used if the function is. Putting it in the function's comdat make it easier for the linker to discard them. The motivating example is struct S { static const int x; }; // const int S::x = 42; inline const int *f() { static const int y = S::x; return &y; } const int *g() { return f(); } With S::x commented out, _ZZ1fvE1y is a variable with a guard variable that is initialized by f. With S::x present, _ZZ1fvE1y is a constant. llvm-svn: 224369
* AST: Fix the linkage of static vars in fn template specializationsDavid Majnemer2014-12-161-0/+19
| | | | | | | | | | | | We that static variables in function template specializations were externally visible. The manglers assumed that externally visible static variables were numbered in Sema. We would end up mangling static variables in the same specialization with the same mangling number which would give all of them the same name. This fixes PR21904. llvm-svn: 224316
* IR: Make metadata typeless in assembly, clang sideDuncan P. N. Exon Smith2014-12-1543-332/+332
| | | | | | Match LLVM changes from r224257. llvm-svn: 224259
* DebugInfo: More accurate line information for placement new.David Blaikie2014-12-141-3/+5
| | | | | | | | | | | This actually came up as a break in UBSan tests (look for a follow-up commit to this one to see the UBSan test fallout) when I tried a broader fix to location information. I have some other ideas about how to do that broader change & will keep looking into it. llvm-svn: 224221
* CodeGen: Compound literals with funny types shouldn't crashDavid Majnemer2014-12-142-2/+15
| | | | | | | | | | | | | | | | | CodeGen assumed that a compound literal with array type should have a corresponding LLVM IR array type. We had two bugs in this area: - Zero sized arrays in compound literals would lead to the creation of an opaque type. This is unnecessary, we should just create an array type with a bound of zero. - Funny record types (like unions) lead to exotic IR types for compound literals. In this case, CodeGen must be prepared to deal with the possibility that it might not have an array IR type. This fixes PR21912. llvm-svn: 224219
* Implement the __builtin_call_with_static_chain GNU extension.Peter Collingbourne2014-12-121-0/+39
| | | | | | | | | | | | | | | | The extension has the following syntax: __builtin_call_with_static_chain(Call, Chain) where Call must be a function call expression and Chain must be of pointer type This extension performs a function call Call with a static chain pointer Chain passed to the callee in a designated register. This is useful for calling foreign language functions whose ABI uses static chain pointers (e.g. to implement closures). Differential Revision: http://reviews.llvm.org/D6332 llvm-svn: 224167
* Fix the issue of mangling of local anonymous unions (Itanium C++ ABI):Evgeny Astigeevich2014-12-121-0/+42
| | | | | | | | | | | | | | | | | | | | | | A discriminator is used for the first occurrence of a name. inline int f1 () { static union { int a; long int b; }; static union { int c; double d; }; return a+c; } The name of the second union is mangled as _ZZ2f1vE1c_0 instead of _ZZ2f1vE1c. Differential Revision: http://reviews.llvm.org/D6295 llvm-svn: 224131
* MS ABI: Fix mangling of unsigned int template paramsWill Wilson2014-12-111-0/+10
| | | | llvm-svn: 223999
* Make test case 32/64 bit neutralDavid Blaikie2014-12-101-1/+1
| | | | llvm-svn: 223938
* DebugInfo: Location information for scalar new expressionsDavid Blaikie2014-12-101-0/+11
| | | | llvm-svn: 223937
* DebugInfo: Correct location information for array accesses to elements of ↵David Blaikie2014-12-101-0/+10
| | | | | | variable array type. llvm-svn: 223902
* DebugInfo: Fix another case of array access line informationDavid Blaikie2014-12-101-0/+10
| | | | llvm-svn: 223897
* DebugInfo: Correct the location of array accessesDavid Blaikie2014-12-101-0/+10
| | | | | | | Especially relevant to ASan when dealing with complex expressions containing multiple array accesses. See PR21737. llvm-svn: 223872
* Tweak test case from r223842 to make it pass on Windows MSVCReid Kleckner2014-12-101-6/+3
| | | | | | We can't mangle __complex yet, and there is no C1 emission. llvm-svn: 223870
* DebugInfo: Correct location of aggregate assignmentDavid Blaikie2014-12-091-0/+12
| | | | llvm-svn: 223854
* DebugInfo: Correct location of initialization of auto __complexDavid Blaikie2014-12-091-0/+8
| | | | llvm-svn: 223842
* DebugInfo: Correct the location of initializations of auto.David Blaikie2014-12-091-0/+8
| | | | llvm-svn: 223839
* DebugInfo: Correct location for compound complex assignmentDavid Blaikie2014-12-091-2/+13
| | | | llvm-svn: 223835
* DebugInfo: Accurate location information for complex assignmentDavid Blaikie2014-12-091-16/+23
| | | | llvm-svn: 223828
OpenPOWER on IntegriCloud