summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
Commit message (Collapse)AuthorAgeFilesLines
...
* After much contemplation, I've decided that we probably shouldn't "unique"John McCall2011-03-311-7/+4
| | | | | | | | | | | | | __block object copy/dispose helpers for C++ objects with those for different variables with completely different semantics simply because they happen to both be no more aligned than a pointer. Found by inspection. Also, internalize most of the helper generation logic within CGBlocks.cpp, and refactor it to fit my peculiar aesthetic sense. llvm-svn: 128618
* Move all the significant __block code into CGBlocks.cpp. No functionalityJohn McCall2011-03-311-0/+5
| | | | | | change. llvm-svn: 128608
* Convert OffsetFromNearestVBast parameter of InitializeVTablePointer(s) toKen Dyck2011-03-231-2/+2
| | | | | | CharUnits. No change in functionality intended. llvm-svn: 128129
* Use a slightly more semantic interface for emitting call arguments.John McCall2011-03-111-9/+5
| | | | llvm-svn: 127494
* Use the "undergoes default argument promotion" bit on parameters toJohn McCall2011-03-091-4/+7
| | | | | | | | | | simplify the logic of initializing function parameters so that we don't need both a variable declaration and a type in FunctionArgList. This also means that we need to propagate the CGFunctionInfo down in a lot of places rather than recalculating it from the FAL. There's more we can do to eliminate redundancy here, and I've left FIXMEs behind to do it. llvm-svn: 127314
* Extract a function to emit an arbitrary expression as if it were the initializerJohn McCall2011-03-081-1/+7
| | | | | | for a local variable. llvm-svn: 127227
* DebugInfo can be enabled or disabled at function level (e.g. using an ↵Devang Patel2011-03-071-1/+9
| | | | | | attribute). However, at module level it is determined by command line option and the state of command line option does not change during compilation. Make this layering explicit and fix accidental cases where the code generator was checking whether module has debug info enabled instead of checking whether debug info is enabled for this function or not. llvm-svn: 127165
* Encode argument numbering in debug info so that code generator can emit them ↵Devang Patel2011-03-031-1/+1
| | | | | | | | in order. This fixes few blocks.exp regressions. llvm-svn: 126960
* Revert "Add CC_Win64ThisCall and set it in the necessary places."Tilmann Scheller2011-03-021-2/+1
| | | | | | This reverts commit 126863. llvm-svn: 126886
* revert r126858.Devang Patel2011-03-021-1/+1
| | | | llvm-svn: 126874
* Add CC_Win64ThisCall and set it in the necessary places.Tilmann Scheller2011-03-021-1/+2
| | | | llvm-svn: 126863
* Encode argument numbering in debug info so that code generator can emit them ↵Devang Patel2011-03-021-1/+1
| | | | | | | | | | in order. This fixes few blocks.exp regressions. Reapply r126795 with a fix (one character change) for gdb testsuite regressions. llvm-svn: 126858
* 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
OpenPOWER on IntegriCloud