summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-2/+2
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Simplify: replace getContext().getLangOpts() with just getLangOpts().Richard Smith2012-11-011-3/+3
| | | | llvm-svn: 167261
* Cleanup some clang code to use new type functions instead of using cast<>.Micah Villmow2012-10-251-2/+1
| | | | llvm-svn: 166684
* -fcatch-undefined-behavior checking for appropriate vptr value: Clang ↵Richard Smith2012-10-251-2/+3
| | | | | | CodeGen side. llvm-svn: 166661
* When we're devirtualizing a method call, make sure the method has the ↵Eli Friedman2012-10-251-7/+7
| | | | | | | | correct IR type. Reported in the thread "devirtualisation appears to crash clang on covariant functions on ARM" on cfe-dev. llvm-svn: 166651
* Switch CodeGenOptions over to a .def file, like we do with LangOptions.Douglas Gregor2012-10-231-2/+3
| | | | llvm-svn: 166497
* -fcatch-undefined-behavior: emit calls to the runtime library whenever one ↵Richard Smith2012-10-091-8/+11
| | | | | | of the checks fails. llvm-svn: 165536
* CodeGen: Copy tail padding when we're not dealing with a trivial copy assign ↵Benjamin Kramer2012-09-301-2/+2
| | | | | | | | | | or move assign operator. This fixes a regression from r162254, the optimizer has problems reasoning about the smaller memcpy as it's often not safe to widen a store but making it smaller is. llvm-svn: 164917
* When performing a ::delete of an object with a virtual destructor,John McCall2012-09-251-1/+7
| | | | | | | | | | | | | | be sure to delete the complete object pointer, not the original pointer. This is necessary if the base being deleted is at a non-zero offset in the complete object. This is only required for objects with virtual destructors because deleting an object via a base-class subobject when the base does not have a virtual destructor is undefined behavior. Noticed while reviewing the last four years of cxx-abi-dev activity. llvm-svn: 164597
* Remove redundant semicolons which are null statements.Dmitri Gribenko2012-09-101-1/+1
| | | | llvm-svn: 163546
* -fcatch-undefined-behavior: Factor emission of the creation of, and branch to,Richard Smith2012-09-081-2/+3
| | | | | | | | | the trap BB out of the individual checks and into a common function, to prepare for making this code call into a runtime library. Rename the existing EmitCheck to EmitTypeCheck to clarify it and to move it out of the way of the new EmitCheck. llvm-svn: 163451
* Fix a CodeGen bug where we would skip zero-initialization forEli Friedman2012-08-251-4/+1
| | | | | | array new with a non-trivial constructor. Pointed out in PR13380. llvm-svn: 162643
* New -fcatch-undefined-behavior features:Richard Smith2012-08-241-0/+7
| | | | | | | | * when checking that a pointer or reference refers to appropriate storage for a type, also check the alignment and perform a null check * check that references are bound to appropriate storage * check that 'this' has appropriate storage in member accesses and member function calls llvm-svn: 162523
* Devirtualize calls on glvalues produced by class member access expressions.Richard Smith2012-08-151-1/+8
| | | | | | Based on a patch by Yin Ma! llvm-svn: 161998
* Factor out computation of whether a typeid's expression is potentiallyRichard Smith2012-08-131-9/+3
| | | | | | evaluated into a CXXTypeid member function. No functionality change. llvm-svn: 161779
* The delete argument should not be converted to void*.Abramo Bagnara2012-07-091-11/+0
| | | | llvm-svn: 159961
* Distinguish more carefully between free functions and C++ instance methodsJohn McCall2012-07-071-10/+10
| | | | | | | | in the ABI arrangement, and leave a hook behind so that we can easily tweak CCs on platforms that use different CCs by default for C++ instance methods. llvm-svn: 159894
* Compare the canonical types and document why we give up on the covariant case.Rafael Espindola2012-06-281-2/+8
| | | | llvm-svn: 159360
* Disable devirtualization when we have covariant returns. I will open a bugRafael Espindola2012-06-281-0/+3
| | | | | | for tracking this. llvm-svn: 159351
* Don't devirtualize calls when we don't have the correct type of the this pointerRafael Espindola2012-06-281-19/+36
| | | | | | | | | handy. It can be done, but we would have to build a derived-to-base cast during codegen to compute the correct this pointer. I will handle covariant returns next. llvm-svn: 159350
* Fix another issue with devirtualizing calls to final methods by passing themRafael Espindola2012-06-281-9/+16
| | | | | | | | the correct this pointer. There is some potential for sharing a bit more code with canDevirtualizeMemberFunctionCalls, but that can be done in an independent patch. llvm-svn: 159326
* Implement John McCall's review of r159212 other than the this pointer notRafael Espindola2012-06-271-4/+2
| | | | | | being updated. Will fix that in a second. llvm-svn: 159280
* Fix a bug in my previous patch: If we are not doing a virtual call becauseRafael Espindola2012-06-261-0/+4
| | | | | | | the member expression is qualified, call the method specified in the code, not the most derived one we can find. llvm-svn: 159219
* During codegen of a virtual call we would extract any casts in the expressionRafael Espindola2012-06-261-33/+22
| | | | | | | | to see if we had an underlying final class or method, but we would then use the cast type to do the call, resulting in a direct call to the wrong method. llvm-svn: 159212
* Revert Decl's iterators back to pointer value_type rather than reference ↵David Blaikie2012-06-061-2/+2
| | | | | | | | | | | | | | value_type In addition, I've made the pointer and reference typedef 'void' rather than T* just so they can't get misused. I would've omitted them entirely but std::distance likes them to be there even if it doesn't use them. This rolls back r155808 and r155869. Review by Doug Gregor incorporating feedback from Chandler Carruth. llvm-svn: 158104
* Zap a bogus assert for delegating constructors. PR12890, part 2.Eli Friedman2012-05-201-1/+0
| | | | | | I'm pretty sure we are in fact doing the right thing here, but someone who knows the standard better should double-check that we are in fact supposed to zero out the member in the given testcase. llvm-svn: 157138
* Remove the ref/value inconsistency in filter_decl_iterator.David Blaikie2012-04-301-2/+2
| | | | | | | | | | | | | filter_decl_iterator had a weird mismatch where both op* and op-> returned T* making it difficult to generalize this filtering behavior into a reusable library of any kind. This change errs on the side of value, making op-> return T* and op* return T&. (reviewed by Richard Smith) llvm-svn: 155808
* Use enum to set debug info size generated by ClangAlexey Samsonov2012-04-271-1/+1
| | | | llvm-svn: 155697
* Propagate alignment on lvalues through EmitLValueForField. PR12395.Eli Friedman2012-04-161-1/+4
| | | | llvm-svn: 154789
* Revert r153613 as it's causing large compile-time regressions on the nightly ↵Chad Rosier2012-03-291-2/+1
| | | | | | testers. llvm-svn: 153660
* When we can't prove that the target of an aggregate copy isJohn McCall2012-03-281-1/+2
| | | | | | | a complete object, the memcpy needs to use the data size of the structure instead of its sizeof() value. Fixes PR12204. llvm-svn: 153613
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-5/+5
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Formatting.Eric Christopher2012-02-291-1/+1
| | | | llvm-svn: 151700
* Reapply r151172 - Unwind path cleanup for array new list initializers - with aChad Rosier2012-02-241-7/+32
| | | | | | test case that only runs on debug builds. llvm-svn: 151311
* Replace a use of hasTrivialDefaultConstructor() with the appropriateDouglas Gregor2012-02-231-1/+1
| | | | | | isTrivial() call. llvm-svn: 151259
* Revert r151172: Unwind path cleanup for array new list initializers.Chad Rosier2012-02-221-32/+7
| | | | llvm-svn: 151203
* Unwind path cleanup for array new list initializers.Sebastian Redl2012-02-221-7/+32
| | | | llvm-svn: 151172
* CodeGen for array new list initializers. Doesn't correctly clean up in the ↵Sebastian Redl2012-02-221-27/+69
| | | | | | face of exceptions yet. llvm-svn: 151171
* Make heap-allocation of std::initializer_list 'work'.Sebastian Redl2012-02-191-0/+2
| | | | llvm-svn: 150931
* Whether an argument is required (in contrast with being anJohn McCall2012-02-171-23/+23
| | | | | | | | | | | | | | | | | | | | | optional argument passed through the variadic ellipsis) potentially affects how we need to lower it. Propagate this information down to the various getFunctionInfo(...) overloads on CodeGenTypes. Furthermore, rename those overloads to clarify their distinct purposes, and make sure we're calling the right one in the right place. This has a nice side-effect of making it easier to construct a function type, since the 'variadic' bit is no longer separable. This shouldn't really change anything for our existing platforms, with one minor exception --- we should now call variadic ObjC methods with the ... in the "right place" (see the test case), which I guess matters for anyone running GNUStep on MIPS. Mostly it's just a substantial clean-up. llvm-svn: 150788
* Elide copy construction in new expressions. PR11757.Eli Friedman2012-02-161-14/+0
| | | | llvm-svn: 150738
* Revert "Revert "Make CXXNewExpr contain only a single initialier, and not ↵Sebastian Redl2012-02-161-29/+22
| | | | | | | | hold the used constructor itself."" This reintroduces commit r150682 with a fix for the Bullet benchmark crash. llvm-svn: 150685
* Revert "Make CXXNewExpr contain only a single initialier, and not hold the ↵Sebastian Redl2012-02-161-22/+29
| | | | | | | | | | used constructor itself." It leads to a compiler crash in the Bullet benchmark. This reverts commit r12014. llvm-svn: 150684
* Make CXXNewExpr contain only a single initialier, and not hold the used ↵Sebastian Redl2012-02-161-29/+22
| | | | | | | | | | constructor itself. Holding the constructor directly makes no sense when list-initialized arrays come into play. The constructor is now held in a CXXConstructExpr, if construction is what is done. The new design can also distinguish properly between list-initialization and direct-initialization, as well as implicit default-initialization constructors and explicit value-initialization constructors. Finally, doing it this way removes redundance from the AST because CXXNewExpr doesn't try to handle both the allocation and the initialization responsibilities. This breaks the static analysis of new expressions. I've filed PR12014 to track this. llvm-svn: 150682
* Implement IRGen of lambda expressions which capture arrays.Eli Friedman2012-02-141-35/+4
| | | | llvm-svn: 150452
* Use RAII object for cleanups.Eli Friedman2012-02-091-2/+2
| | | | llvm-svn: 150147
* Refactor lambda IRGen so AggExprEmitter::VisitLambdaExpr does the right thing.Eli Friedman2012-02-091-0/+47
| | | | llvm-svn: 150146
* simplify a bunch of code to use the well-known LLVM IR types computed by ↵Chris Lattner2012-02-071-10/+3
| | | | | | CodeGenModule. llvm-svn: 149943
* Make array new on a pointer to data member type work correctly. PR11523.Eli Friedman2011-12-091-2/+3
| | | | llvm-svn: 146291
* Switch LValue so that it exposes alignment in CharUnits. (No functional ↵Eli Friedman2011-12-031-1/+1
| | | | | | change.) llvm-svn: 145753
OpenPOWER on IntegriCloud