summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r126794.Devang Patel2011-03-021-1/+1
| | | | llvm-svn: 126848
* Encode argument numbering in debug info so that code generator can emit them ↵Devang Patel2011-03-011-1/+1
| | | | | | | | in order. This fixes few blocks.exp regressions. llvm-svn: 126795
* Add some helper methods that will be used in my next patch.Chris Lattner2011-02-281-0/+10
| | | | llvm-svn: 126596
* Change the interface to ConstantFoldsToSimpleInteger to not encode Chris Lattner2011-02-271-4/+3
| | | | | | a bool + success into one tri-state integer, simplifying things. llvm-svn: 126592
* Establish the iteration variable of an ObjC for-in loop beforeJohn McCall2011-02-221-4/+9
| | | | | | | emitting the collection expression. Fixes some really, really broken code. llvm-svn: 126193
* Reorganize the emission of local variables.John McCall2011-02-221-1/+44
| | | | llvm-svn: 126189
* Add a LangOptions::areExceptionsEnabled and start using it.Anders Carlsson2011-02-201-1/+0
| | | | llvm-svn: 126062
* Objective-c armv7 API for atomic properties of Fariborz Jahanian2011-02-181-0/+4
| | | | | | scalar types. // rdar://7761305 llvm-svn: 125946
* Remove the "conditional save" hashtables from IR generation.John McCall2011-02-171-7/+0
| | | | llvm-svn: 125761
* Change the representation of GNU ?: expressions to use a different expressionJohn McCall2011-02-171-15/+118
| | | | | | | | | | | | | | | | | | | | | | class and to bind the shared value using OpaqueValueExpr. This fixes an unnoticed problem with deserialization of these expressions where the deserialized form would lose the vital pointer-equality trait; or rather, it fixes it because this patch also does the right thing for deserializing OVEs. Change OVEs to not be a "temporary object" in the sense that copy elision is permitted. This new representation is not totally unawkward to work with, but I think that's really part and parcel with the semantics we're modelling here. In particular, it's much easier to fix things like the copy elision bug and to make the CFG look right. I've tried to update the analyzer to deal with this in at least some obvious cases, and I think we get a much better CFG out, but the printing of OpaqueValueExprs probably needs some work. llvm-svn: 125744
* Step #1/N of implementing support for __label__: split labels intoChris Lattner2011-02-171-5/+6
| | | | | | | | | | | | | | | | | | | LabelDecl and LabelStmt. There is a 1-1 correspondence between the two, but this simplifies a bunch of code by itself. This is because labels are the only place where we previously had references to random other statements, causing grief for AST serialization and other stuff. This does cause one regression (attr(unused) doesn't silence unused label warnings) which I'll address next. This does fix some minor bugs: 1. "The only valid attribute " diagnostic was capitalized. 2. Various diagnostics printed as ''labelname'' instead of 'labelname' 3. This reduces duplication of label checking between functions and blocks. Review appreciated, particularly for the cindex and template bits. llvm-svn: 125733
* Save a copy expression for non-trivial copy constructions of catch variables.John McCall2011-02-161-0/+40
| | | | llvm-svn: 125661
* Simplify test to check an aggregate argument that has non trivial ↵Devang Patel2011-02-161-2/+1
| | | | | | | | constructor or destructor. This patch rewrites r125142. llvm-svn: 125632
* Assorted cleanup:John McCall2011-02-151-7/+1
| | | | | | | | | - Have CGM precompute a number of commonly-used types - Have CGF copy that during initialization instead of recomputing them - Use TBAA info when initializing a parameter variable - Refactor the scalar ++/-- code llvm-svn: 125562
* Implement mcount profiling, enabled via -pg.Roman Divacky2011-02-101-0/+3
| | | | llvm-svn: 125282
* If an aggregate argument is passed indirectly because it has non trivialDevang Patel2011-02-091-1/+2
| | | | | | | | destructor or copy constructor than let debug info know about it. Radar 8945514. llvm-svn: 125142
* Reorganize CodeGen{Function,Module} to eliminate the unfortunateJohn McCall2011-02-081-80/+32
| | | | | | | | Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. llvm-svn: 125085
* A few more tweaks to the blocks AST representation: John McCall2011-02-071-26/+64
| | | | | | | | | | | | | | | | | - BlockDeclRefExprs always store VarDecls - BDREs no longer store copy expressions - BlockDecls now store a list of captured variables, information about how they're captured, and a copy expression if necessary With that in hand, change IR generation to use the captures data in blocks instead of walking the block independently. Additionally, optimize block layout by emitting fields in descending alignment order, with a heuristic for filling in words when alignment of the end of the block header is insufficient for the most aligned field. llvm-svn: 125005
* Clean up of -fapple-kext abi code. No change otherwise.Fariborz Jahanian2011-02-031-2/+1
| | | | llvm-svn: 124807
* -fapple-kext support for indirect call to virtuals dtors - wip.Fariborz Jahanian2011-02-011-0/+4
| | | | llvm-svn: 124701
* Reorganize the value-dominance metaprogram and introduce a specializationJohn McCall2011-01-281-31/+62
| | | | | | for CodeGen's RValue type. llvm-svn: 124483
* Convert the exception-freeing cleanup over to the conditional cleanups code,John McCall2011-01-281-29/+59
| | | | | | | | | fixing a crash which probably nobody was ever going to see. In doing so, fix a horrendous number of problems with the conditional-cleanups code. Also, make conditional cleanups re-use the cleanup's activation variable, which avoids some unfortunate repetitiveness. llvm-svn: 124481
* Fixes an IRgen bug where __block variable isFariborz Jahanian2011-01-261-1/+5
| | | | | | | referenced in the block-literal initializer of that variable. // rdar://8893785 llvm-svn: 124332
* Fix some obvious bugs in the conditional-cleanup code and then make theJohn McCall2011-01-261-4/+6
| | | | | | dtor cleanup use it. llvm-svn: 124309
* Better framework for conditional cleanups; untested as yet.John McCall2011-01-261-23/+187
| | | | | | | | I'm separately committing this because it incidentally changes some block orderings and minor IR issues, like using a phi instead of an unnecessary alloca. llvm-svn: 124277
* apple kext abi requires all vf calls, including qualifiedFariborz Jahanian2011-01-201-0/+4
| | | | | | vf calls, be made indirect. This patch is towards that goal. llvm-svn: 123922
* Move name mangling support from CodeGen to AST. In thePeter Collingbourne2011-01-131-1/+1
| | | | | | | | | | | | | | process, perform a number of refactorings: - Move MiscNameMangler member functions to MangleContext - Remove GlobalDecl dependency from MangleContext - Make MangleContext abstract and move Itanium/Microsoft functionality to their own classes/files - Implement ASTContext::createMangleContext and have CodeGen use it No (intended) functionality change. llvm-svn: 123386
* 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
OpenPOWER on IntegriCloud