summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
Commit message (Collapse)AuthorAgeFilesLines
* Stop using builtins for the "_lane" variants of saturating multiply intrinsics.Bob Wilson2010-12-081-1/+1
| | | | | | | Remove the "splat" parameter from the EmitNeonCall function, since it is no longer needed. llvm-svn: 121300
* Stop using a clang builtin for Neon vdup_lane intrinsics.Bob Wilson2010-12-071-2/+1
| | | | llvm-svn: 121191
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-061-3/+3
| | | | | | reason this is limited to C++, and it's certainly not limited to temporaries. llvm-svn: 120996
* Fix a bug in the emission of __real/__imag l-values on scalar operands.John McCall2010-12-051-1/+5
| | | | | | | | | Fix a bug in the emission of complex compound assignment l-values. Introduce a method to emit an expression whose value isn't relevant. Make that method evaluate its operand as an l-value if it is one. Fixes our volatile compliance in C++. llvm-svn: 120931
* More anonymous struct/union redesign. This one deals with anonymous field ↵Francois Pichet2010-12-041-1/+1
| | | | | | | | | | | | | | | | used in a constructor initializer list: struct X { X() : au_i1(123) {} union { int au_i1; float au_f1; }; }; clang will now deal with au_i1 explicitly as an IndirectFieldDecl. llvm-svn: 120900
* Test case for the l-value base only being evaluated once.John McCall2010-12-041-4/+0
| | | | | | | | | | Also, move the l-value emission code into CGObjC.cpp and teach it, for completeness, to store away self for a super send. Also, inline the super cases for property gets and sets and make them use the correct result type for implicit getter/setter calls. llvm-svn: 120887
* Kill the KVC l-value kind and calculate the base expression when emittingJohn McCall2010-12-041-8/+3
| | | | | | the l-value. llvm-svn: 120884
* IR Gen. part of API support for __block cxxFariborz Jahanian2010-12-021-1/+1
| | | | | | | | objects imported into blocks. //rdar://8594790. Will have a test case coming (as well as one sent to llvm test suite). llvm-svn: 120713
* Improve codegen for initializer lists to use memset more aggressivelyChris Lattner2010-12-021-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when an initializer is variable (I handled the constant case in a previous patch). This has three pieces: 1. Enhance AggValueSlot to have a 'isZeroed' bit to tell CGExprAgg that the memory being stored into has previously been memset to zero. 2. Teach CGExprAgg to not emit stores of zero to isZeroed memory. 3. Teach CodeGenFunction::EmitAggExpr to scan initializers to determine whether they are profitable to emit a memset + inividual stores vs stores for everything. The heuristic used is that a global has to be more than 16 bytes and has to be 3/4 zero to be candidate for this xform. The two testcases are illustrative of the scenarios this catches. We now codegen test9 into: call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 400, i32 4, i1 false) %.array = getelementptr inbounds [100 x i32]* %Arr, i32 0, i32 0 %tmp = load i32* %X.addr, align 4 store i32 %tmp, i32* %.array and test10 into: call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 392, i32 8, i1 false) %tmp = getelementptr inbounds %struct.b* %S, i32 0, i32 0 %tmp1 = getelementptr inbounds %struct.a* %tmp, i32 0, i32 0 %tmp2 = load i32* %X.addr, align 4 store i32 %tmp2, i32* %tmp1, align 4 %tmp5 = getelementptr inbounds %struct.b* %S, i32 0, i32 3 %tmp10 = getelementptr inbounds %struct.a* %tmp5, i32 0, i32 4 %tmp11 = load i32* %X.addr, align 4 store i32 %tmp11, i32* %tmp10, align 4 Previously we produced 99 stores of zero for test9 and also tons for test10. This xforms should substantially speed up -O0 builds when it kicks in as well as reducing code size and optimizer heartburn on insane cases. This resolves PR279. llvm-svn: 120692
* Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ↵John McCall2010-12-021-3/+2
| | | | | | | | ObjCPropertyRefExpr into the latter. llvm-svn: 120643
* BuildVirtualCall doesn't need to take a reference to a pointer.Anders Carlsson2010-11-281-1/+1
| | | | llvm-svn: 120252
* Support compound complex operations as l-values in C++. Add a testJohn McCall2010-11-161-0/+3
| | | | | | | case based on CodeGen/volatile-1.c which tests the current C++ semantics, and note the many, many places we fall short of them. llvm-svn: 119402
* Implements __block API for c++ objects. There is stillFariborz Jahanian2010-11-161-5/+5
| | | | | | | issue with runtime which I am discussing it with Blaine. This is wip (so no test yet). llvm-svn: 119368
* Simplify some complex emission and implement correct semantics forJohn McCall2010-11-161-4/+3
| | | | | | | | | assignment to volatiles in C. This in effect reverts some of mjs's work in and around r72572. Basically, the C++ standard is quite clear, except that it lies about volatile behavior approximating C's, whereas the C standard is almost actively misleading. llvm-svn: 119344
* Block API patch to do copy ctor of copied-in cxx objects inFariborz Jahanian2010-11-131-3/+15
| | | | | | | | copy helper function and dtor of copied cxx objects in dispose helper functions. __block variables TBD next. llvm-svn: 119011
* Simplify the logic for emitting guard variables for template staticJohn McCall2010-11-061-2/+8
| | | | | | | | | data members by delaying the emission of the initializer until after linkage and visibility have been set on the global. Also, don't emit a guard unless the variable actually ends up with vague linkage, and don't use thread-safe statics in any case. llvm-svn: 118336
* Restore r117403 (fixing IR gen for bool atomics), this time being less John McCall2010-10-271-0/+8
| | | | | | | aggressive about the form we expect bools to be in. I don't really have time to fix all the sources right now. llvm-svn: 117486
* Revert r117403 as it caused PR8480.Rafael Espindola2010-10-271-8/+0
| | | | llvm-svn: 117456
* Extract procedures to do scalar-to-memory and memory-to-scalar conversionsJohn McCall2010-10-261-0/+8
| | | | | | | in IR gen, and use those to fix a correctness issue with bool atomic intrinsics. rdar://problem/8461234 llvm-svn: 117403
* Factor out the code for emitting code to load vtable pointer membersDan Gohman2010-10-261-0/+3
| | | | | | so that it's done in one place. llvm-svn: 117386
* Fix Whitespace.Michael J. Spencer2010-10-191-40/+40
| | | | llvm-svn: 116798
* Death to blocks, or at least the word "block" in one particular obnoxiouslyJohn McCall2010-10-151-13/+13
| | | | | | ambiguous context. llvm-svn: 116567
* Experimental TBAA support.Dan Gohman2010-10-141-3/+6
| | | | | | | This enables metadata generation by default, however the TBAA pass in the optimizer is still disabled for now. llvm-svn: 116536
* Eliminate usage of ObjCSuperExpr used forFariborz Jahanian2010-10-141-1/+0
| | | | | | | 'super' as receiver of property or a setter/getter methods. //rdar: //8525788 llvm-svn: 116483
* Add target implementations for the X86 builtins:Bill Wendling2010-10-091-0/+1
| | | | | | | | | | | __builtin_ia32_vec_init_v8qi __builtin_ia32_vec_init_v4hi __builtin_ia32_vec_init_v2si They are lowered to bitcasts. (These are all ready tested by the gcc testsuite.) <rdar://problem/8529957> llvm-svn: 116147
* Permit constant evaluation of const floating-point variables withJohn McCall2010-10-091-1/+1
| | | | | | constant initializers. llvm-svn: 116138
* Accidentally committed some temporary changes on my branch when reverting ↵Bill Wendling2010-09-281-3/+0
| | | | | | patches. llvm-svn: 114936
* Temporarily revert 114929 114925 114924 114921. It looked like they (or at leastBill Wendling2010-09-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | one of them) was causing a series of failures: http://google1.osuosl.org:8011/builders/clang-x86_64-darwin10-selfhost/builds/4518 svn merge -c -114929 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114929 into '.': U include/clang/Sema/Sema.h U include/clang/AST/DeclCXX.h U lib/Sema/SemaDeclCXX.cpp U lib/Sema/SemaTemplateInstantiateDecl.cpp U lib/Sema/SemaDecl.cpp U lib/Sema/SemaTemplateInstantiate.cpp U lib/AST/DeclCXX.cpp svn merge -c -114925 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114925 into '.': G include/clang/AST/DeclCXX.h G lib/Sema/SemaDeclCXX.cpp G lib/AST/DeclCXX.cpp svn merge -c -114924 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114924 into '.': G include/clang/AST/DeclCXX.h G lib/Sema/SemaDeclCXX.cpp G lib/Sema/SemaDecl.cpp G lib/AST/DeclCXX.cpp U lib/AST/ASTContext.cpp svn merge -c -114921 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114921 into '.': G include/clang/AST/DeclCXX.h G lib/Sema/SemaDeclCXX.cpp G lib/Sema/SemaDecl.cpp G lib/AST/DeclCXX.cpp llvm-svn: 114933
* Patch implements passing arrays to functions expectingFariborz Jahanian2010-09-241-3/+17
| | | | | | vla. Implements pr7827. llvm-svn: 114737
* IRgen for gnu extension's conditional lvalue expressionFariborz Jahanian2010-09-211-0/+1
| | | | | | | with missing LHS. radar 8453812. Executable test is checked into llvm test suite. llvm-svn: 114457
* Implements in IRgen gnu extensions missing LHS forFariborz Jahanian2010-09-201-0/+1
| | | | | | complex conditionals. Radar 8453812. llvm-svn: 114376
* Adjust a fixup's starting branch if it's being resolved becauseJohn McCall2010-09-181-2/+1
| | | | | | | it reached the outermost scope and it hasn't yet been forwarded to a cleanup. Fixed PR8175. llvm-svn: 114259
* Patch to add IRgen support for Gnu's conditional operatorFariborz Jahanian2010-09-171-0/+5
| | | | | | | | extension when missing LHS. This patch covers scalar conditionals only. Others are wip. (pr7726, radar 8353567). llvm-svn: 114182
* When emitting a new-expression inside a conditional expression,John McCall2010-09-171-0/+4
| | | | | | | | | | | | | | | | the cleanup might not be dominated by the allocation code. In this case, we have to store aside all the delete arguments in case we need them later. There's room for optimization here in cases where we end up not actually needing the cleanup in different branches (or being able to pop it after the initialization code). Also make sure we only call this operator delete along the path where we actually allocated something. Fixes rdar://problem/8439196. llvm-svn: 114145
* Patch to move RequiresGCollection bit toFariborz Jahanian2010-09-161-2/+1
| | | | | | AggValueSlot slot. llvm-svn: 114045
* one piece of code is responsible for the lifetime of every aggregateJohn McCall2010-09-151-17/+20
| | | | | | | | | | | | | slot. The easiest way to do that was to bundle up the information we care about for aggregate slots into a new structure which demands that its creators at least consider the question. I could probably be convinced that the ObjC 'needs GC' bit should be rolled into this structure. Implement generalized copy elision. The main obstacle here is that IR-generation must be much more careful about making sure that exactly llvm-svn: 113962
* Implement the EH cleanup to call 'operator delete' if a new-expression throwsJohn McCall2010-09-141-1/+27
| | | | | | (but not if destructors associated with the full-expression throw). llvm-svn: 113836
* Fix VLA miscompilation.Argyrios Kyrtzidis2010-09-141-0/+1
| | | | | | | llvm.stacksave/llvm.stackrestore wasn't emitted for VLAs in inner scopes. Fixes r8403108. llvm-svn: 113822
* Implement ARM static local initialization guards, which are more compact thanJohn McCall2010-09-081-5/+2
| | | | | | Itanium guards and use a slightly different compiled-in API. llvm-svn: 113330
* Abstract IR generation of array cookies into the C++ ABI class andJohn McCall2010-09-021-0/+1
| | | | | | | | | | | | | | implement ARM array cookies. Also fix a few unfortunate bugs: - throwing dtors in deletes prevented the allocation from being deleted - adding the cookie to the new[] size was not being considered for overflow (and, more seriously, was screwing up the earlier checks) - deleting an array via a pointer to array of class type was not causing any destructors to be run and was passing the unadjusted pointer to the deallocator - lots of address-space problems, in case anyone wants to support free store in a variant address space :) llvm-svn: 112814
* Teach IR generation to return 'this' from constructors and destructorsJohn McCall2010-08-311-2/+11
| | | | | | under the ARM ABI. llvm-svn: 112588
* IRgen: Set the alignment correctly when creating LValue for a decls.Daniel Dunbar2010-08-211-2/+2
| | | | | | | - Fixes PR5598. - Review appreciated. llvm-svn: 111726
* CodeGenFunction: Eliminate unused MakeQualifiers() function.Daniel Dunbar2010-08-211-6/+0
| | | | llvm-svn: 111725
* IRgen/CGValue: Give MakeAddrLValue() an alignment argument, and eliminate ↵Daniel Dunbar2010-08-211-1/+1
| | | | | | old form of MakeAddr(). llvm-svn: 111723
* IRgen: Eliminate EmitPredefinedFunctionName(), it doesn't need to be ↵Daniel Dunbar2010-08-211-1/+0
| | | | | | factored out. llvm-svn: 111715
* IRgen: Add an LValue::MakeAddr variant which takes a type and uses that to buildDaniel Dunbar2010-08-211-0/+4
| | | | | | | | | the qualifiers. Also, add CodeGenFunction::MakeAddrLValue() helper function which passes in the ASTContext. llvm-svn: 111714
* IRgen: Change Emit{Load,Store}OfScalar to take a required Alignment argument andDaniel Dunbar2010-08-211-2/+2
| | | | | | | | update callers as best I can. - This is a work in progress, our alignment handling is very horrible / sketchy -- I am just aiming for monotonic improvement. - Serious review appreciated. llvm-svn: 111707
* More cleanup enabling.John McCall2010-08-141-0/+10
| | | | llvm-svn: 111070
* Sketch out a framework for delaying the activation of a cleanup.John McCall2010-08-131-1/+12
| | | | | | Not yet complete or used. llvm-svn: 111044
* Simplify code and add comments, in code that generate debug info for ↵Devang Patel2010-08-101-1/+1
| | | | | | constant integer globals, based on Chris's feedback. llvm-svn: 110694
OpenPOWER on IntegriCloud