summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprScalar.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Prevent codegen crash on sizeof(<function type>), a gcc extension.Daniel Dunbar2008-07-221-2/+3
| | | | llvm-svn: 53899
* Make a few related changes:Chris Lattner2008-06-301-1/+1
| | | | | | | | | | | | | | 1) add a new ASTContext::getFloatTypeSemantics method. 2) Use it from SemaExpr.cpp, CodeGenTypes.cpp and other places. 3) Change the TargetInfo.h get*Format methods to return their fltSemantics byref instead of by pointer. 4) Change CodeGenFunction::EmitBuiltinExpr to allow builtins which sometimes expand specially and othertimes fall back to libm. 5) Add support for __builtin_nan("") to codegen, cases that don't pass in an empty string are currently lowered to libm calls. 6) Fix codegen of __builtin_infl. llvm-svn: 52914
* avoid a lot of unneeded selector processing work by passing aroundChris Lattner2008-06-261-6/+1
| | | | | | selectors instead of Value*'s. llvm-svn: 52760
* This patch is motivated by numerous strict-aliasing warnings when compilingTed Kremenek2008-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang as a Release build. The big change is that all AST nodes (subclasses of Stmt) whose children are Expr* store their children as Stmt* or arrays of Stmt*. This is to remove strict-aliasing warnings when using StmtIterator. None of the interfaces of any of the classes have changed (except those with arg_iterators, see below), as the accessor methods introduce the needed casts (via cast<>). While this extra casting may seem cumbersome, it actually adds some important sanity checks throughout the codebase, as clients using StmtIterator can potentially overwrite children that are expected to be Expr* with Stmt* (that aren't Expr*). The casts provide extra sanity checks that are operational in debug builds to catch invariant violations such as these. For classes that have arg_iterators (e.g., CallExpr), the definition of arg_iterator has been replaced. Instead of it being Expr**, it is an actual class (called ExprIterator) that wraps a Stmt**, and provides the necessary operators for iteration. The nice thing about this class is that it also uses cast<> to type-checking, which introduces extra sanity checks throughout the codebase that are useful for debugging. A few of the CodeGen functions that use arg_iterator (especially from OverloadExpr) have been modified to take begin and end iterators instead of a base Expr** and the number of arguments. This matches more with the abstraction of iteration. This still needs to be cleaned up a little bit, as clients expect that ExprIterator is a RandomAccessIterator (which we may or may not wish to allow for efficiency of representation). This is a fairly large patch. It passes the tests (except CodeGen/bitfield.c, which was already broken) on both a Debug and Release build, but it should obviously be reviewed. llvm-svn: 52378
* fix crash when codegening 'cond ? lhs : call-to-void-func()'Nuno Lopes2008-06-041-1/+1
| | | | llvm-svn: 51958
* Support for code generation of Objective-C top-level language constructs.Anton Korobeynikov2008-06-011-1/+1
| | | | | | Implemented by David Chisnall! llvm-svn: 51835
* Fix an extremely subtle bug with pointer comparisons: they have to be Eli Friedman2008-05-291-4/+4
| | | | | | | unsigned because it's possible (at least in theory) to have have both positive and negative pointers pointing to the same object. llvm-svn: 51681
* Fix for PR2001. I'm not really fond of it, but it is correct (unless Eli Friedman2008-05-251-1/+10
| | | | | | | | someone tries to make a bitfield volatile?). Not sure how to write a test; any suggestions? llvm-svn: 51558
* Backout of codegen-based fix to PR2334; this has been fixed differently Eli Friedman2008-05-161-4/+2
| | | | | | at the Sema layer. llvm-svn: 51203
* Patch for PR2334, and a similar ObjC bug.Eli Friedman2008-05-161-2/+4
| | | | llvm-svn: 51193
* Implementation of __builtin_shufflevector, a portable builtin capable of Eli Friedman2008-05-141-0/+12
| | | | | | | | | expressing the full flexibility of the LLVM shufflevector instruction. The expected immediate usage is in *mmintrin.h, so that they don't depend on the mess of gcc-inherited (and not completely implemented) shuffle builtins. llvm-svn: 51113
* Add codegen support for block-level compound literals.Eli Friedman2008-05-131-4/+1
| | | | llvm-svn: 51081
* implement a fixme, add support for ++/-- on long double.Chris Lattner2008-04-201-5/+6
| | | | llvm-svn: 49980
* use simplified ConstantFP:get method.Chris Lattner2008-04-201-5/+3
| | | | llvm-svn: 49979
* OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.Nate Begeman2008-04-181-3/+3
| | | | llvm-svn: 49942
* update to follow mainline llvm API change.Chris Lattner2008-04-131-1/+1
| | | | llvm-svn: 49607
* Add support for C++ default arguments, and rework Parse-Sema Chris Lattner2008-04-081-1/+4
| | | | | | | | interaction for function parameters, fixing PR2046. Patch by Doug Gregor! llvm-svn: 49369
* tracking API changes arising from r49277Gabor Greif2008-04-061-7/+7
| | | | llvm-svn: 49279
OpenPOWER on IntegriCloud