summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprScalar.cpp
Commit message (Collapse)AuthorAgeFilesLines
* daniel prefers completed thoughts.Chris Lattner2008-11-161-1/+1
| | | | llvm-svn: 59404
* Normalize many BasicBlock names.Daniel Dunbar2008-11-131-5/+5
| | | | | | | | | | - Use dotted notation for blocks related to a particular statement type. - Use .end for landing pads. No functionality change in NDEBUG mode. :) llvm-svn: 59210
* Rename ?: operator blocks to cond.true and cond.false (I don't knowDaniel Dunbar2008-11-121-2/+2
| | | | | | what "cond.?" means, and this avoids quoting). llvm-svn: 59128
* Lower ?: into select when the selected values are cheap and side-effect-free.Chris Lattner2008-11-121-0/+37
| | | | | | This cuts another 200 lines off expr.ll, forming 23 selects. llvm-svn: 59124
* emit better codegen for ||/&&, shrinking expr.ll by another 240 lines.Chris Lattner2008-11-121-19/+31
| | | | | | | | This happens for stuff like this: x = cond1 || cond2 || cond3 || cond4; llvm-svn: 59123
* use ConstantFoldsToSimpleInteger instead of code emission to doChris Lattner2008-11-121-24/+22
| | | | | | constant folding. llvm-svn: 59121
* Use EmitBranchOnBoolExpr in VisitConditionalOperator. ThisChris Lattner2008-11-121-8/+17
| | | | | | shrinks code yet again by a bit. llvm-svn: 59114
* Move EmitBranchOnBoolExpr and ConstantFoldsToSimpleInteger toChris Lattner2008-11-121-18/+16
| | | | | | | | | | CodeGenFunction.cpp. Change VisitConditionalOperator to use constant fold instead of codegen'ing a constant conditional. Change ForStmt to use EmitBranchOnBoolExpr, this shrinks expr.c very slightly to 40239 lines. llvm-svn: 59113
* Clean up some code to use isZero instead of calling getZExtValue.Chris Lattner2008-11-121-3/+3
| | | | llvm-svn: 59103
* Use createBasicBlock here too.Daniel Dunbar2008-11-121-2/+2
| | | | llvm-svn: 59095
* Rework IRgen invariant w.r.t. current insert point.Daniel Dunbar2008-11-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - EmitStmt is no longer required to finish with a current insertion point defined (i.e. it does not need to make dummy blocks). Instead, it can clear the insertion point in the builder which indicates that the current insertion point is unreachable. - CodeGenFunction provides HaveInsertPoint and EnsureInsertPoint which respectively test if there is an insert point and ensure an insertion point exists (by making a dummy block). - Clearly mark functions in CodeGenFunction which can be called with no insertion point defined. Currently this is a limited set, and EmitStmt simply EnsureInsertPoint()s before emitting subsequent IR. Remove EmitDummyBlock, which is no longer needed. Clients who haven't already cleared the insertion point (typically via EmitBranch) can do so by hand. Remove isDummyBlock, which has effectively been renamed to HaveInsertPoint. The main thrust of this change is that we no longer have create dummy blocks just to destroy them a short time later in EmitBlock in the common case that there is no unreachable code following something like a goto. Additionally, this means that we are not using the hokey condition in isDummyBlock that a block without a name is a dummy block. Guess how well that works when we never emit block names! llvm-svn: 59089
* Try to not emit the dead side of ?: if the condition is a constant.Chris Lattner2008-11-111-4/+21
| | | | llvm-svn: 59061
* Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof ↵Sebastian Redl2008-11-111-16/+8
| | | | | | expressions, both of values and types. llvm-svn: 59057
* Add CodeGenFunction::EmitBranch.Daniel Dunbar2008-11-111-2/+2
| | | | | | | - Emits an unconditional branch, with extra logic to avoid generating spurious branches out of dummy blocks. llvm-svn: 59037
* short circuit && and || when possible. This substantially reducesChris Lattner2008-11-111-0/+28
| | | | | | | | the size of the -O0 output on some cases. For example, on expr.c from 176.gcc, it shrinks the .ll file from 43164 to 42835 lines, and removed references to two external symbols. llvm-svn: 59034
* Centralize basic block creation in CodeGenFunction::createBasicBlock.Daniel Dunbar2008-11-111-5/+5
| | | | | | - No functionality change. llvm-svn: 59017
* Implement lowering of va_arg in clang directly. (This is 32-bit X86 only for ↵Anders Carlsson2008-11-041-2/+8
| | | | | | now). llvm-svn: 58681
* Move IRBuilder type definition to common file.Daniel Dunbar2008-11-011-1/+1
| | | | | | - No functionality change. llvm-svn: 58546
* make codegen reject initializes with designators, like this:Chris Lattner2008-10-261-1/+8
| | | | | | | | t.c:1:13: error: cannot codegen this designators yet int a[10] = {2, 4, [8]=9, 10}; ^~~~~~~~~~~~~~~~~ llvm-svn: 58220
* Remove unneeded EncodingRecordTypes argument to getObjCEncodingForType.Daniel Dunbar2008-10-171-3/+1
| | | | llvm-svn: 57716
* Adjust calls to APFloat conversion for new interface.Dale Johannesen2008-10-091-1/+3
| | | | llvm-svn: 57332
* Avoid superfluous errors regarding variable-length arrays (casts).Daniel Dunbar2008-09-041-1/+1
| | | | llvm-svn: 55759
* Downgrade a number of FIXME asserts to ErrorUnsupported.Daniel Dunbar2008-08-291-4/+8
| | | | | | - Notably VLAs llvm-svn: 55544
* Add special "property reference" CodeGen::LValue type for emittingDaniel Dunbar2008-08-291-4/+8
| | | | | | | | Objective-C property references. - This handles property references "more correctly" but setters still don't work. llvm-svn: 55534
* Initial support for Obj-C dot-syntax for getters.Daniel Dunbar2008-08-271-19/+13
| | | | llvm-svn: 55410
* Change another is-a-pointer check to check in terms of LLVM type.Daniel Dunbar2008-08-251-1/+1
| | | | llvm-svn: 55312
* Do is-a-pointer checks in terms of LLVM types inDaniel Dunbar2008-08-251-4/+6
| | | | | | | | | EmitScalarConversion(). - Important for allowing Obj-C void * to id<X> casts and so on. - Not sure about this fix however, perhaps Type should understand that id is effectively a pointer type. llvm-svn: 55311
* Add CodeGen support for CXXZeroInitValueExpr.Argyrios Kyrtzidis2008-08-231-0/+3
| | | | llvm-svn: 55249
* Implement Obj-C ivar references to aggregates.Daniel Dunbar2008-08-231-0/+7
| | | | | | | | | | | Implement Obj-C lvalue message sends (aggregate returns). Update several places to emit more precise ErrorUnsupported warnings for currently unimplemented Obj-C features (main missing chunks are property references, Obj-C exception handling, and the for ... in syntax). llvm-svn: 55234
* Trim CGObjCRuntime::GenerateMessageSend[Super]Daniel Dunbar2008-08-231-6/+5
| | | | | | | | | | | | | | | | | | - Returns an RValue. - Reduced to only taking the CodeGenFunction, Expr, and Receiver. - Becomes responsible for emitting the arguments. Add CodeGenFunction::EmitCallExprExt - Takes optional extra arguments to insert at the head of the call. - This allows the Obj-C runtimes to call into this and isolates the argument and call instruction generation code to one place. Upshot is that we now pass structures (more) correctly. Also, fix one aspect of generating methods which take structure arguments (for NeXT). This probably needs to be merged with the SetFunctionAttributes code in CodeGenModule.cpp llvm-svn: 55223
* Move all Obj-C runtime interaction into CodeGenFunction.Daniel Dunbar2008-08-201-40/+4
| | | | | | | - Drop duplicate (and broken) code for sending messages. - Add EmitObjCProtocolExpr to CodeGenFunction. llvm-svn: 55024
* Add CodeGen support for AddrLabelExpr in initializers.Daniel Dunbar2008-08-161-4/+5
| | | | llvm-svn: 54837
* Change WarnUnsupported to ErrorUnsupported (in name and in practice).Daniel Dunbar2008-08-161-1/+1
| | | | | | | - We are beyond the point where this shows up often and when it does generating miscompiled files is bad. llvm-svn: 54836
* Change ObjCRuntime GenerateProtocol[Ref] methods to takeDaniel Dunbar2008-08-131-1/+2
| | | | | | | | | | | ObjCProtocolDecl directly. Implement CodeGen support for forward protocol decls (no-ops are so nice to implement). Also moved CGObjCRuntime.h out of CodeGenModule.h llvm-svn: 54709
* Drop Sender from GenerateMessageSend*Daniel Dunbar2008-08-121-1/+0
| | | | | | | - Was unused and generated a unnecessary load of self (missed file) llvm-svn: 54668
* Protocol related tweaksDaniel Dunbar2008-08-121-0/+7
| | | | | | | - Implement type conversion of ObjCQualifiedIdType - Wire @protocol(...) to GenerateProtocolRef in ScalarExprEmitter llvm-svn: 54666
* Add @selector(...) codegen support.Daniel Dunbar2008-08-121-0/+5
| | | | llvm-svn: 54665
* Change CodeGenModule to only create ObjC runtime for ObjC filesDaniel Dunbar2008-08-111-1/+3
| | | | | | | - Changed CodeGenModule::getObjCRuntime to return reference. - Added CodeGenModule::hasObjCRuntime predicate. llvm-svn: 54645
* More #include cleaningDaniel Dunbar2008-08-111-1/+2
| | | | | | - Remove internal uses of AST.h llvm-svn: 54628
* rename PreDefinedExpr -> PredefinedExprChris Lattner2008-08-101-1/+1
| | | | llvm-svn: 54605
* update to make IRBuilder API change.Chris Lattner2008-08-081-1/+1
| | | | llvm-svn: 54548
* Fix CodeGen of pointer arithmetic in compound assignment statements.Daniel Dunbar2008-08-061-76/+94
| | | | | | | | | | | | | | | | | | | - Changed EmitSub to work on all cases (arithmetic, ptr - int, ptr - ptr) so that implementation matches that of other operators. - Modify EmitCompoundAssign to compute and perform the appropriate casts of left, right, and result types for the assorted pointer arithmetic cases. - Fix EmitSub (ptr - int) case to negate the rhs *after* extension. This is critical when the rhs is unsigned (and needs extension). - This fixes cfrac. - <rdr://6115726> llvm-svn: 54392
* Bug fix, CodeGen of (void*) - (void*) was broken.Daniel Dunbar2008-08-051-3/+12
| | | | | | - <rdar://problem/6122967> llvm-svn: 54338
* Add CodeGen support for indirect goto.Daniel Dunbar2008-08-041-0/+6
| | | | | | | | | | - Follows emission scheme used by llvm-gcc, i.e. invent an id for each label whose address is taken and replace each indirect goto by a switch to each possible target. - Currently we emit a switch for each indirect goto instead of merging them as llvm-gcc does. llvm-svn: 54318
* remove uses of QualType::getCanonicalType() from codegen for PR2189Chris Lattner2008-07-261-13/+8
| | | | llvm-svn: 54107
* implement codegen support for labels at the end of stmtexprs.Chris Lattner2008-07-261-1/+2
| | | | llvm-svn: 54100
* minor tidying, no functionality change.Chris Lattner2008-07-261-8/+3
| | | | llvm-svn: 54099
* Generate vector compares in codegenNate Begeman2008-07-251-2/+18
| | | | llvm-svn: 54048
* Fix a codegen crash on:Chris Lattner2008-07-231-6/+10
| | | | | | | | | | | int foo(void) { float x[2]; return x; } rdar://6093986 llvm-svn: 53946
* Add note to check what __alignof__ a function type should be.Daniel Dunbar2008-07-221-0/+1
| | | | llvm-svn: 53928
OpenPOWER on IntegriCloud