summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Handle VLA indexingAnders Carlsson2008-12-211-2/+19
| | | | llvm-svn: 61295
* Add support for member references (E1.E2, E1->E2) with C++ semantics,Douglas Gregor2008-12-201-1/+3
| | | | | | | | | | which can refer to static data members, enumerators, and member functions as well as to non-static data members. Implement correct lvalue computation for member references in C++. Compute the result type of non-static data members of reference type properly. llvm-svn: 61294
* Removed a slot in ObjCMemRegExpr used inFariborz Jahanian2008-12-181-2/+2
| | | | | | code gen which did not belong there. llvm-svn: 61203
* Code gen. for ivar references; including bitfieldFariborz Jahanian2008-12-151-29/+37
| | | | | | ivars. llvm-svn: 61043
* Fix rdar://6095061 - gcc allows __builtin_choose_expr as an lvalueChris Lattner2008-12-121-0/+6
| | | | llvm-svn: 60924
* Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of Chris Lattner2008-11-241-1/+1
| | | | | | | | | | | uses of getName() with uses of getDeclName(). This upgrades a bunch of diags to take DeclNames instead of std::strings. This also tweaks a couple of diagnostics to be cleaner and changes CheckInitializerTypes/PerformInitializationByConstructor to pass around DeclarationNames instead of std::strings. llvm-svn: 59947
* Implemented ir-gen for 'implicit' properties using the new AST nodes.Fariborz Jahanian2008-11-221-0/+26
| | | | llvm-svn: 59886
* Fields of ivars of struct types are considered ivarsFariborz Jahanian2008-11-211-2/+7
| | | | | | themselves for gc API generation purposes. llvm-svn: 59828
* Support generation of objc_assign_ivar for ivarFariborz Jahanian2008-11-201-3/+9
| | | | | | write-barriers. llvm-svn: 59748
* Added a test case for __weak field decls. Change SetVarDeclObjCAttributeFariborz Jahanian2008-11-201-8/+9
| | | | | | to static function. Added comments. llvm-svn: 59738
* More objc gc stuff. Read/Write barriers for local static/extern,Fariborz Jahanian2008-11-201-17/+45
| | | | | | | diagnostics on use of __weak attribute on fields, Early support for read/write barriers for objc fields. llvm-svn: 59682
* More of objective-c's gc code-gen. Treat objective-cFariborz Jahanian2008-11-191-0/+6
| | | | | | objects as __strong when attribute unspecified. llvm-svn: 59654
* Few more changes due to Daniel's feedback.Fariborz Jahanian2008-11-191-17/+17
| | | | llvm-svn: 59645
* Fix redundant load of bit-fields on assignment (to get the updatedDaniel Dunbar2008-11-191-3/+23
| | | | | | | | | value). - Use extra argument to EmitStoreThroughLValue to provide place to write update bit-field value if caller requires it. - This fixes several FIXMEs. llvm-svn: 59615
* Generate strong write barriers for __strong objects.Fariborz Jahanian2008-11-191-6/+13
| | | | | | Also, took care of Daniel's commments. llvm-svn: 59575
* Patch for generation of weak write barriers for objcFariborz Jahanian2008-11-181-1/+9
| | | | | | __weak objects. llvm-svn: 59560
* Generate objc_read_weak for __weak objc loads.Fariborz Jahanian2008-11-181-0/+8
| | | | llvm-svn: 59553
* Some basic support toward objective-c's GC code gen.Fariborz Jahanian2008-11-181-2/+8
| | | | llvm-svn: 59543
* Add a new expression node, CXXOperatorCallExpr, which expresses aDouglas Gregor2008-11-141-1/+3
| | | | | | | | | | | | | | | | | | | function call created in response to the use of operator syntax that resolves to an overloaded operator in C++, e.g., "str1 + str2" that resolves to std::operator+(str1, str2)". We now build a CXXOperatorCallExpr in C++ when we pick an overloaded operator. (But only for binary operators, where we actually implement overloading) I decided *not* to refactor the current CallExpr to make it abstract (with FunctionCallExpr and CXXOperatorCallExpr as derived classes). Doing so would allow us to make CXXOperatorCallExpr a little bit smaller, at the cost of making the argument and callee accessors virtual. We won't know if this is going to be a win until we can parse lots of C++ code to determine how much memory we'll save by making this change vs. the performance penalty due to the extra virtual calls. llvm-svn: 59306
* Easy IRgen improvement for bitfields, don't emit x >> 0.Daniel Dunbar2008-11-131-2/+3
| | | | | | | - Logic such as this quite possibly should be optional builder behavior. llvm-svn: 59213
* Add a new expression class, ObjCSuperExpr, to handle the Objective-C ↵Douglas Gregor2008-11-041-3/+8
| | | | | | 'super'. Remove ObjCThis from PredefinedExpr llvm-svn: 58698
* Emit more descriptive unsupported error message on dot-syntax use of super.Daniel Dunbar2008-10-171-0/+2
| | | | llvm-svn: 57745
* Lift CodeGenFunction::EmitPredefinedFunctioName out of EmitPredefinedLValue.Daniel Dunbar2008-10-171-23/+27
| | | | | | | - Shouldn't assume predefined expr is a function printing one. - Uses CGM functionality to cache function names per module. llvm-svn: 57737
* Refactor some CodeGen functionality: Daniel Dunbar2008-09-241-15/+35
| | | | | | | | | | - Add CodeGenFunction::{EmitReturnOfRValue, EmitIvarOffset} - Factor EmitLValueForIvar out of EmitObjCIvarRefLValue. No non-error functionality change (some unsupported errors are degraded to asserts for the time being). llvm-svn: 56543
* Implement CodeGen support for the 'CXXConditionDeclExpr' expression node, ↵Argyrios Kyrtzidis2008-09-101-0/+9
| | | | | | which represents a 'condition' declaration, e.g: "if (int x=0) {...}". llvm-svn: 56045
* Move ABI specific code for functions / calls to CGCall.cpp:Daniel Dunbar2008-09-091-55/+0
| | | | | | - Factor out EmitFunction{Pro,Epi}log llvm-svn: 56031
* Change CodeGen to emit calls using (RValue,Type) list:Daniel Dunbar2008-09-091-40/+25
| | | | | | | | | | | | | | - Add CodeGenFunction::EmitAnyExprToTemp o Like EmitAnyExpr, but emits aggregates to a temporary location if none is available. Seems like this should be simpler (even aside from using first class aggregates). - Killed CodeGenFunction::EmitCallArg (just append the pair) - Conversion of RValues to actual call arguments is now isolated in CodeGenFunction::EmitCall. llvm-svn: 55970
* Refactor parameter attribute handling:Daniel Dunbar2008-09-081-30/+9
| | | | | | | | | - Add CGCall.h for dealing with ABI issues related to calls. - Add CGFunctionInfo and CGCallInfo for capturing ABI relevant information about functions and calls. - Isolate LLVM parameter attribute handling inside CGCall.cpp llvm-svn: 55963
* Implement codegen of aggregates as lvalues in binary expressions,Daniel Dunbar2008-09-041-1/+15
| | | | | | e.g. "(a = b).somefield". llvm-svn: 55758
* Add Objective-C property setter support.Daniel Dunbar2008-08-301-0/+18
| | | | | | | | | | | | | | | | | | | | | | - Change Obj-C runtime message API, drop the ObjCMessageExpr arg in favor of just result type and selector. Necessary so it can be reused in situations where we don't want to cons up an ObjCMessageExpr. - Update aggregate binary assignment to know about special property ref lvalues. - Add CodeGenFunction::EmitCallArg overload which takes an already emitted rvalue. Add CodeGenFunction::StoreComplexIntoAddr. Disabled logic in Sema for parsing Objective-C dot-syntax that accesses methods. This code does not search in the correct order and the AST node has no way of properly representing its results. Updated StmtDumper to print a bit more information about ObjCPropertyRefExprs. llvm-svn: 55561
* Refactor handling of calls:Daniel Dunbar2008-08-301-44/+55
| | | | | | | | | | | | | | | | - Added CodeGenFunction::EmitCall which just takes the callee, return type, and a list of (Value*,QualType) pairs. - Added CodeGenFunction::EmitCallArg which handles emitting code for a call argument and turning it into an appropriate (Value*,QualType) pair. - Changed Objective-C runtime interface so that the actual emission of arguments for message sends is (once again) done in the code to emit a message send. No intended functionality change, this is prep work for better ABI support and for Objective-C property setter support. llvm-svn: 55560
* Add special "property reference" CodeGen::LValue type for emittingDaniel Dunbar2008-08-291-3/+25
| | | | | | | | Objective-C property references. - This handles property references "more correctly" but setters still don't work. llvm-svn: 55534
* Support __PRETTY_FUNCTION__ and friends in Obj-C methods.Daniel Dunbar2008-08-251-22/+23
| | | | | | | | | | | | Add CodeGenFunction::EmitUnsupportedLValue - Gives error and returns undef value. Swap some asserts() over to using EmitUnsupportedLValue - Rumor has it users (and even some developers) prefer carat diagnostics to backtraces. - Works better in Release-Asserts to boot. llvm-svn: 55328
* Make code generation of ivar ref exprs more like member exprs.Anders Carlsson2008-08-251-19/+25
| | | | llvm-svn: 55298
* Implement Obj-C ivar references to aggregates.Daniel Dunbar2008-08-231-0/+17
| | | | | | | | | | | 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
* NeXT: Fix message sends which return structures.Daniel Dunbar2008-08-231-5/+5
| | | | | | - Simplify the sending code a bit. llvm-svn: 55232
* Trim CGObjCRuntime::GenerateMessageSend[Super]Daniel Dunbar2008-08-231-1/+11
| | | | | | | | | | | | | | | | | | - 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
* Change WarnUnsupported to ErrorUnsupported (in name and in practice).Daniel Dunbar2008-08-161-2/+1
| | | | | | | - We are beyond the point where this shows up often and when it does generating miscompiled files is bad. llvm-svn: 54836
* Add GetAddrOfConstantCString methodDaniel Dunbar2008-08-131-4/+1
| | | | | | | | | | | | | | | | | | - Returns addr of constant for argument + '\0'. - I couldn't think of a better name. - Move appropriate users of GetAddrOfConstantString to this. Rename getStringForStringLiteral to GetStringForStringLiteral. Add GetAddrOfConstantStringFromLiteral - This combines GetAddrOfConstantString and GetStringForStringLiteral. This method can be, but is not yet, more efficient. Change GetAddrOfConstantString to not add terminating '\0' - <rdar://problem/6140956> llvm-svn: 54768
* Change ObjCRuntime GenerateProtocol[Ref] methods to takeDaniel Dunbar2008-08-131-0/+1
| | | | | | | | | | | 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
* Change CodeGenModule to only create ObjC runtime for ObjC filesDaniel Dunbar2008-08-111-1/+1
| | | | | | | - Changed CodeGenModule::getObjCRuntime to return reference. - Added CodeGenModule::hasObjCRuntime predicate. llvm-svn: 54645
* More #include cleaningDaniel Dunbar2008-08-111-7/+0
| | | | | | | | | | | - Kill unnecessary #includes in .cpp files. This is an automatic sweep so some things removed are actually used, but happen to be included by a previous header. I tried to get rid of the obvious examples and this was the easiest way to trim the #includes in one fell swoop. - We now return to regularly scheduled development. llvm-svn: 54632
* More #include cleaningDaniel Dunbar2008-08-111-0/+2
| | | | | | | | - Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h - Moved Sema::getCurMethodDecl() out of line (dependent on ObjCMethodDecl via dyn_cast). llvm-svn: 54629
* More #include cleaningDaniel Dunbar2008-08-111-1/+1
| | | | | | - Remove internal uses of AST.h llvm-svn: 54628
* Back out r54608 (inline string literals were getting an extra '\0')Daniel Dunbar2008-08-101-13/+4
| | | | | | | | | | | | | | | temporarily, I assumed GetAddrForConstantString literal was being used consistently but it doesn't look like it is. Factored out a CodeGenModule::getStringForStringLiteral which handles extracting a std::string for the bytes of a StringLiteral, padded to match the type. Update EmitLValue to use getStringForStringLiteral, this was previously not padding strings correctly. Good thing we only emit strings in 4 different places! llvm-svn: 54621
* rename PreDefinedExpr -> PredefinedExprChris Lattner2008-08-101-6/+6
| | | | llvm-svn: 54605
* Fix bitfield accesses which straddle the boundary of the underlyingDaniel Dunbar2008-08-061-46/+116
| | | | | | | | | | | | | | | | | | | | | type. - This generates somewhat less optimal code than before but this is not hard to rectify once stable (at the cost of slightly more complex code). - This currently always uses little-endian ordering of the bitfield. - This breaks the CodeGen/bitfield.c test because it was grepping for hard-coded assembly instructions. Will fix once a better test case is constructed (hard to do without execution). - This fixes SingleSource/UnitTests/2006-01-23-InitializedBitField.c and Regression/C/PR1386.c from the test suite. - <rdar://problem/6085090>, <rdar://problem/6094169> llvm-svn: 54395
* Finally fix PR2189. This makes a fairly invasive but important change toChris Lattner2008-08-041-1/+2
| | | | | | | | | | move getAsArrayType into ASTContext instead of being a method on type. This is required because getAsArrayType(const AT), where AT is a typedef for "int[10]" needs to return ArrayType(const int, 10). Fixing this greatly simplifies getArrayDecayedType, which is a good sign. llvm-svn: 54317
* Fix a regression I introduced in r54107:Chris Lattner2008-07-311-1/+1
| | | | | | http://llvm.org/viewvc/llvm-project?view=rev&revision=54107 llvm-svn: 54242
* Rework codegen emission of globalsDaniel Dunbar2008-07-291-3/+3
| | | | | | | | | | | | | | | | | | | | - No (intended) functionality change. - Primary purpose is to clearly separate (lazy) construction of globals that are a forward declaration or tentative definition from those that are the final definition. - Lazy construction is now encapsulated in GetAddrOf{Function,GlobalVar} while final definitions are constructed in EmitGlobal{Function,Var}Definition. - External interface for dealing with globals is now limited to EmitGlobal and GetAddrOf{Function,GlobalVar}. - Also updated helper functions dealing with statics, annotations, and ctors to be private. llvm-svn: 54179
OpenPOWER on IntegriCloud