summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* implement codegen support for __builtin_isfinite, part of PR6083Chris Lattner2010-05-061-0/+13
| | | | llvm-svn: 103168
* implement part of PR6083: codegen support for isinf. Like isnan,Chris Lattner2010-05-061-1/+35
| | | | | | | this is generating correct but suboptimal (extra extend to double) code for the float case. Will investigate next. llvm-svn: 103166
* Clean up the {} and else placement. This fixes an ambiguous else as well asChandler Carruth2010-05-061-6/+6
| | | | | | picking a more consistent pattern. llvm-svn: 103142
* Pass the globaldecl into GetOrCreateLLVMFunction so that llvmChris Lattner2010-05-051-1/+1
| | | | | | | | | function attributes like byval get applied to the function definition. This fixes PR7058 and makes i386 llvm/clang bootstrap pass all the same tests as x86-64 bootstrap for me (the llvmc tests still fail in both). llvm-svn: 103131
* This patch deals with Sema Part of Setter/Getter synthesisFariborz Jahanian2010-05-051-6/+0
| | | | | | | of properties which are of C++ objects. Code Gen to follow (Radar 7468090). llvm-svn: 103123
* When we emit a non-constant initializer for a global variable ofDouglas Gregor2010-05-051-2/+4
| | | | | | | | reference type, make sure that the initializer we build is the of the appropriate type for the *reference*, not for the thing that it refers to. Fixes PR7050. llvm-svn: 103115
* For thread-safe static initialization of local statics withDouglas Gregor2010-05-051-33/+48
| | | | | | | | destructors, place the __cxa_atexit call after the __cxa_guard_release call, mimicking GCC/LLVM-GCC behavior. Noticed while debugging something related. llvm-svn: 103088
* Reapplying patch to change StmtNodes.def to StmtNodes.td, this timeAlexis Hunt2010-05-051-1/+1
| | | | | | | with no whitespace. This will allow statements to be referred to in attribute TableGen files. llvm-svn: 103087
* Revert r103072; I accidentally ended up deleting a bunch of trailingAlexis Hunt2010-05-051-24/+24
| | | | | | | whitespace which makes this patch unreadable. Will recommit without the whitespace. llvm-svn: 103086
* Reimplement code generation for copying fields in theDouglas Gregor2010-05-052-226/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implicitly-generated copy constructor. Previously, Sema would perform some checking and instantiation to determine which copy constructors, etc., would be called, then CodeGen would attempt to figure out which copy constructor to call... but would get it wrong, or poke at an uninstantiated default argument, or fail in other ways. The new scheme is similar to what we now do for the implicit copy-assignment operator, where Sema performs all of the semantic analysis and builds specific ASTs that look similar to the ASTs we'd get from explicitly writing the copy constructor, so that CodeGen need only do a direct translation. However, it's not quite that simple because one cannot explicit write elementwise copy-construction of an array. So, I've extended CXXBaseOrMemberInitializer to contain a list of indexing variables used to copy-construct the elements. For example, if we have: struct A { A(const A&); }; struct B { A array[2][3]; }; then we generate an implicit copy assignment operator for B that looks something like this: B::B(const B &other) : array[i0][i1](other.array[i0][i1]) { } CodeGen will loop over the invented variables i0 and i1 to visit all elements in the array, so that each element in the destination array will be copy-constructed from the corresponding element in the source array. Of course, if we're dealing with arrays of scalars or class types with trivial copy-assignment operators, we just generate a memcpy rather than a loop. Fixes PR6928, PR5989, and PR6887. Boost.Regex now compiles and passes all of its regression tests. Conspicuously missing from this patch is handling for the exceptional case, where we need to destruct those objects that we have constructed. I'll address that case separately. llvm-svn: 103079
* Use a more appropriate LLVM type for the vtable pointer.Anders Carlsson2010-05-051-3/+5
| | | | llvm-svn: 103078
* Unbreak CMake build.Douglas Gregor2010-05-051-0/+2
| | | | llvm-svn: 103077
* Change StmtNodes.def to StmtNodes.td in anticipation of a rewrite of attributesAlexis Hunt2010-05-051-24/+24
| | | | llvm-svn: 103072
* Emit the globals, metadata, etc. associated with static variables even whenJohn McCall2010-05-042-5/+5
| | | | | | | | they're unreachable. This matters because (if they're POD, or if this is C) the scope containing the variable might be reachable even if the variable isn't. Fixes PR7044. llvm-svn: 103052
* Fixes a code gen. crash when ivar object has trivial constructor.Fariborz Jahanian2010-05-041-12/+14
| | | | llvm-svn: 103028
* When instantiating a function that was declared via a typedef, e.g.,Douglas Gregor2010-05-041-1/+4
| | | | | | | | | | | | | typedef int functype(int, int); functype func; also instantiate the synthesized function parameters for the resulting function declaration. With this change, Boost.Wave builds and passes all of its regression tests. llvm-svn: 103025
* Fixes a code gen crash when block is a reference type, etc.Fariborz Jahanian2010-05-041-0/+2
| | | | | | (radar 7495203). llvm-svn: 103022
* When inheriting a default argument expression, inherit the full expression,John McCall2010-05-041-1/+3
| | | | | | | | | not just the inner expression. This is important if the expression has any temporaries. Fixes PR 7028. Basically a symptom of really tragic method names. llvm-svn: 102998
* Fixes a Code Gen. Crash when calling destructor on a __blockFariborz Jahanian2010-05-041-4/+9
| | | | | | | variabe. Blocks and their construction/destruction is wip though. llvm-svn: 102985
* Just bail out immediately when emitting an unreachable function-local staticJohn McCall2010-05-031-0/+3
| | | | | | variable. Surprisingly, this does seem to be the right way to solve this. llvm-svn: 102961
* If we're generating code to create a pointer-to-member functionDouglas Gregor2010-05-031-0/+6
| | | | | | | aggregate and the result of the aggregate is unused, bail out early. Fixes PR7027. llvm-svn: 102942
* When computing the address of a virtual member function pointer, use the ↵Anders Carlsson2010-05-032-2/+12
| | | | | | pointer width instead of hardcoding for 64-bit. llvm-svn: 102921
* Don't build an aggregate constructor loop when the constructor is trivial.Anders Carlsson2010-05-031-5/+7
| | | | llvm-svn: 102912
* Don't copy or initialize empty classes. Fixes PR7012.Anders Carlsson2010-05-032-0/+16
| | | | llvm-svn: 102891
* Store the entire base subobject in SubVTTIndices.Anders Carlsson2010-05-032-16/+13
| | | | llvm-svn: 102890
* Remove OldGetAddressOfBaseClass - bye bye ambiguities.Anders Carlsson2010-05-032-95/+0
| | | | llvm-svn: 102889
* Get rid of the last caller of OldGetAddressOfBaseClass.Anders Carlsson2010-05-031-8/+16
| | | | llvm-svn: 102888
* More work towards getting rid of OldGetAddressOfBaseClass.Anders Carlsson2010-05-032-1/+12
| | | | llvm-svn: 102887
* Get rid of a call to GetAddressOfDirectBaseInCompleteClass.Anders Carlsson2010-05-021-4/+7
| | | | llvm-svn: 102886
* Have getSubVTTIndex take a BaseSubobject instead of just a base.Anders Carlsson2010-05-023-4/+10
| | | | llvm-svn: 102885
* Pass ForVirtualBase all the way to GetVTTParameter.Anders Carlsson2010-05-021-4/+8
| | | | llvm-svn: 102883
* Add the same 'ForVirtualBase' parameter to EmitCXXDestructorCall.Anders Carlsson2010-05-027-15/+27
| | | | llvm-svn: 102882
* Revert my last change and add a 'ForVirtualBase' parameter to ↵Anders Carlsson2010-05-023-12/+15
| | | | | | EmitCXXConstructorCall instead. llvm-svn: 102881
* Pass the construction kind down to EmitCXXConstructorCall.Anders Carlsson2010-05-023-7/+10
| | | | llvm-svn: 102880
* Remove another unused function.Anders Carlsson2010-05-022-39/+0
| | | | llvm-svn: 102871
* Remove an unused function.Anders Carlsson2010-05-022-89/+0
| | | | llvm-svn: 102870
* CodeGen: Shrink RValue. 4 words -> 2 words.Benjamin Kramer2010-05-021-30/+25
| | | | llvm-svn: 102863
* As per Chris' request, return the Instruction from EmitCall and add the ↵David Chisnall2010-05-023-9/+12
| | | | | | metadata in the caller. llvm-svn: 102862
* Complete reimplementation of the synthesis for implicitly-defined copyDouglas Gregor2010-05-013-102/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | assignment operators. Previously, Sema provided type-checking and template instantiation for copy assignment operators, then CodeGen would synthesize the actual body of the copy constructor. Unfortunately, the two were not in sync, and CodeGen might pick a copy-assignment operator that is different from what Sema chose, leading to strange failures, e.g., link-time failures when CodeGen called a copy-assignment operator that was not instantiation, run-time failures when copy-assignment operators were overloaded for const/non-const references and the wrong one was picked, and run-time failures when by-value copy-assignment operators did not have their arguments properly copy-initialized. This implementation synthesizes the implicitly-defined copy assignment operator bodies in Sema, so that the resulting ASTs encode exactly what CodeGen needs to do; there is no longer any special code in CodeGen to synthesize copy-assignment operators. The synthesis of the body is relatively simple, and we generate one of three different kinds of copy statements for each base or member: - For a class subobject, call the appropriate copy-assignment operator, after overload resolution has determined what that is. - For an array of scalar types or an array of class types that have trivial copy assignment operators, construct a call to __builtin_memcpy. - For an array of class types with non-trivial copy assignment operators, synthesize a (possibly nested!) for loop whose inner statement calls the copy constructor. - For a scalar type, use built-in assignment. This patch fixes at least a few tests cases in Boost.Spirit that were failing because CodeGen picked the wrong copy-assignment operator (leading to link-time failures), and I suspect a number of undiagnosed problems will also go away with this change. Some of the diagnostics we had previously have gotten worse with this change, since we're going through generic code for our type-checking. I will improve this in a subsequent patch. llvm-svn: 102853
* Simplify EmitCopyCtorCall.Anders Carlsson2010-05-011-12/+5
| | | | llvm-svn: 102849
* Simplify EmitClassAggrMemberwiseCopy.Anders Carlsson2010-05-013-22/+10
| | | | llvm-svn: 102848
* Clean up EmitClassMemberwiseCopy further.Anders Carlsson2010-05-012-22/+10
| | | | llvm-svn: 102846
* Get rid of a parameter from EmitClassMemberwiseCopy.Anders Carlsson2010-05-012-5/+4
| | | | llvm-svn: 102845
* When defining implicit copy constructors, use SetBaseOrMemberInitializers to ↵Anders Carlsson2010-05-011-12/+0
| | | | | | initialize the bases. llvm-svn: 102842
* Attach message send metadata to the lookup as well as to the call (GNU runtime).David Chisnall2010-05-011-7/+10
| | | | llvm-svn: 102839
* Make super message lookups cacheable (GNUstep Runtime)David Chisnall2010-05-011-14/+34
| | | | llvm-svn: 102837
* Tweaked EmitCall() to permit the caller to provide some metadata to attach ↵David Chisnall2010-05-013-11/+28
| | | | | | | | to the call site. Used this in CGObjCGNU to attach metadata about message sends to permit speculative inlining. llvm-svn: 102833
* When synthesizing Objective C records, give the synthetic fields publicJohn McCall2010-04-301-1/+1
| | | | | | | | access. Fixes an assertion. Fixes rdar://problem/7927811. Too lazy to reduce a test case. llvm-svn: 102776
* Remove an unnecessary parameter from EmitClassCopyAssignment.Anders Carlsson2010-04-302-13/+7
| | | | llvm-svn: 102747
* Fixed incorrect type of alloca (GNU runtime).David Chisnall2010-04-301-2/+5
| | | | llvm-svn: 102711
OpenPOWER on IntegriCloud