summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Support member reference on ?: of struct type.Daniel Dunbar2009-03-241-0/+20
| | | | llvm-svn: 67603
* fix CreateTempAlloca to not set a name on the alloca for temporariesChris Lattner2009-03-221-1/+2
| | | | | | | | | in release-assert builds. For automatic variables, explicitly set a name with setName that does not make a temporary std::string. This speeds up -emit-llvm-only -disable-free on PR3810 by 4.6% llvm-svn: 67459
* simplify and comment some code better. Make BindRuntimeGlobalsChris Lattner2009-03-211-0/+1
| | | | | | more optimistic that it will work (optimizing for the common case). llvm-svn: 67438
* fix the more complex cases by actually codegen'ing the right expr :)Chris Lattner2009-03-181-1/+1
| | | | llvm-svn: 67219
* add codegen support for casting an element to a union.Chris Lattner2009-03-181-8/+25
| | | | | | | There are some more complex cases (_Complex and structs) that I'm still working on. llvm-svn: 67218
* teach codegen to handle noop casts as lvalues.Chris Lattner2009-03-181-0/+13
| | | | llvm-svn: 67164
* Minor cleanup for choose expressions: add a helper that returns the Eli Friedman2009-03-041-5/+1
| | | | | | chosen sub-expression, rather than just evaluating the condition. llvm-svn: 66018
* Improved ABI compliance for __block variables. No testcases yet as weMike Stump2009-03-041-39/+11
| | | | | | | still give an unsupported error for them due to the fact this is a work in progress. llvm-svn: 66007
* Push checking down, also, give the user a hit as to which part of theMike Stump2009-03-021-0/+11
| | | | | | | block literal is causing the problem, instead of the vague reference to the entire block literal. llvm-svn: 65798
* First cut CodeGen support for __block variables.Mike Stump2009-02-281-1/+36
| | | | llvm-svn: 65688
* first wave of fixes for @encode sema support. This is part of PR3648.Chris Lattner2009-02-241-13/+21
| | | | | | | The big difference here is that (like string literal) @encode has array type, not pointer type. llvm-svn: 65391
* We should not generate __weak write barrier on indirect referenceFariborz Jahanian2009-02-231-3/+12
| | | | | | | of a pointer to object; This patch does this odd behavior according to gcc. llvm-svn: 65334
* More objc gc work. Match gcc's treatment of ivar accessFariborz Jahanian2009-02-221-1/+1
| | | | | | | true a local pointer to objective-c object in generating write barriers. llvm-svn: 65290
* local array of objects are non-gc'able.Fariborz Jahanian2009-02-211-2/+6
| | | | llvm-svn: 65251
* Handle case of none gc'able objects regardless of theirFariborz Jahanian2009-02-211-3/+8
| | | | | | type. llvm-svn: 65205
* Shorten; no functionality change.Daniel Dunbar2009-02-201-8/+6
| | | | llvm-svn: 65145
* Set call attribute for direct calls (i.e. noreturn).Daniel Dunbar2009-02-201-18/+15
| | | | | | - Remove an unused variant of EmitCallExpr overload. llvm-svn: 65130
* More objc gc's ir-gen fixes.Fariborz Jahanian2009-02-201-3/+8
| | | | llvm-svn: 65097
* More objc's gc ir-gen stuff.Fariborz Jahanian2009-02-191-35/+33
| | | | llvm-svn: 65077
* Generate the conservative objc gc's API for now.Fariborz Jahanian2009-02-191-0/+7
| | | | llvm-svn: 65051
* Some code simplification. ir gen for gc'able arrayFariborz Jahanian2009-02-191-9/+11
| | | | | | of objects in objc. llvm-svn: 64992
* Address Chris's comments regarding C++ name mangling.Douglas Gregor2009-02-181-1/+1
| | | | llvm-svn: 64984
* Some refactoring and simplificaiotn of objc's gcFariborz Jahanian2009-02-181-17/+10
| | | | | | ir gen. llvm-svn: 64954
* Start generating gc'able code using the newFariborz Jahanian2009-02-181-25/+16
| | | | | | objc gc type attributes. llvm-svn: 64935
* Cleanup objc's gc attributes code no longer needed.Fariborz Jahanian2009-02-181-2/+10
| | | | | | | | This make warn-weak-field.m to fail (subject of a followup patch). attr-objc-gc.m no passes. llvm-svn: 64925
* 80-cols.Daniel Dunbar2009-02-171-9/+11
| | | | llvm-svn: 64779
* Support IRgen of sqrt -> llvm.sqrt, pow -> llvm.pow.Daniel Dunbar2009-02-161-1/+1
| | | | | | | | | | | | | | | | - Define pow[lf]?, sqrt[lf]? as builtins. - Add -fmath-errno option which binds to LangOptions.MathErrno - Add new builtin flag Builtin::Context::isConstWithoutErrno for functions which can be marked as const if errno isn't respected for math functions. Sema automatically marks these functions as const when they are defined, if MathErrno=0. - IRgen uses const attribute on sqrt and pow library functions to decide if it can use the llvm intrinsic. llvm-svn: 64689
* fix volatile handling with ExtVectorElementExpr, so that weChris Lattner2009-02-161-8/+7
| | | | | | | | | | | emit two volatile loads for: typedef __attribute__(( ext_vector_type(4) )) float float4; float test(volatile float4 *P) { return P->x+P->y; } llvm-svn: 64683
* introduce and use a new ExtVectorElementExpr::isArrow method, at Eli's ↵Chris Lattner2009-02-161-4/+5
| | | | | | suggestion llvm-svn: 64681
* enhance ExtVectorElementExpr to allow V->xxyy to work like (*V).xxyyChris Lattner2009-02-161-8/+12
| | | | llvm-svn: 64667
* Add hook to add attributes to function declarations that we knowDouglas Gregor2009-02-141-1/+1
| | | | | | | | | | | | | | | | about, whether they are builtins or not. Use this to add the appropriate "format" attribute to NSLog, NSLogv, asprintf, and vasprintf, and to translate builtin attributes (from Builtins.def) into actual attributes on the function declaration. Use the "printf" format attribute on function declarations to determine whether we should do format string checking, rather than looking at an ad hoc list of builtins and "known" function names. Be a bit more careful about when we consider a function a "builtin" in C++. llvm-svn: 64561
* Implicitly declare certain C library functions (malloc, strcpy, memmove,Douglas Gregor2009-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | etc.) when we perform name lookup on them. This ensures that we produce the correct signature for these functions, which has two practical impacts: 1) When we're supporting the "implicit function declaration" feature of C99, these functions will be implicitly declared with the right signature rather than as a function returning "int" with no prototype. See PR3541 for the reason why this is important (hint: GCC always predeclares these functions). 2) If users attempt to redeclare one of these library functions with an incompatible signature, we produce a hard error. This patch does a little bit of work to give reasonable error messages. For example, when we hit case #1 we complain that we're implicitly declaring this function with a specific signature, and then we give a note that asks the user to include the appropriate header (e.g., "please include <stdlib.h> or explicitly declare 'malloc'"). In case #2, we show the type of the implicit builtin that was incorrectly declared, so the user can see the problem. We could do better here: for example, when displaying this latter error message we say something like: 'strcpy' was implicitly declared here with type 'char *(char *, char const *)' but we should really print out a fake code line showing the declaration, like this: 'strcpy' was implicitly declared here as: char *strcpy(char *, char const *) This would also be good for printing built-in candidates with C++ operator overloading. The set of C library functions supported by this patch includes all functions from the C99 specification's <stdlib.h> and <string.h> that (a) are predefined by GCC and (b) have signatures that could cause codegen issues if they are treated as functions with no prototype returning and int. Future work could extend this set of functions to other C library functions that we know about. llvm-svn: 64504
* Add basic support for C++ name mangling according to the Itanium C++Douglas Gregor2009-02-131-1/+1
| | | | | | | | | | | | | | | | ABI to the CodeGen library. Since C++ code-generation is so incomplete, we can't exercise much of this mangling code. However, a few smoke tests show that it's doing the same thing as GCC. When C++ codegen matures, we'll extend the ABI tester to verify name-mangling as well, and complete the implementation here. At this point, the major client of name mangling is in the uses of the new "overloadable" attribute in C, which allows overloading. Any "overloadable" function in C (or in an extern "C" block in C++) will be mangled the same way that the corresponding C++ function would be mangled. llvm-svn: 64413
* Add support for generating block call expressions.Anders Carlsson2009-02-121-1/+1
| | | | llvm-svn: 64346
* Support IRgen of va_arg of structure as l-value.Daniel Dunbar2009-02-111-1/+9
| | | | llvm-svn: 64325
* Some refactoring of Ivar offset code gen.Fariborz Jahanian2009-02-101-11/+1
| | | | | | in preparation for nonfragile ivar offset work. llvm-svn: 64225
* Add util Emit{LoadOf,StoreTo}Scalar methods to encapsulate conversionDaniel Dunbar2009-02-101-23/+38
| | | | | | | from LLVM memory type to/from LLVM temporary type. - No intended functionality change. llvm-svn: 64191
* Pull CodeGenFunction::GetUndefRValue() out of EmitUnsupportedRValue.Daniel Dunbar2009-02-051-10/+14
| | | | llvm-svn: 63845
* ir-gen for nonfragile ivar bitfield access (objc2 nonfragile abi).Fariborz Jahanian2009-02-031-16/+8
| | | | llvm-svn: 63644
* objc2's ir-gen for nonfragile ivar access.Fariborz Jahanian2009-02-031-4/+9
| | | | llvm-svn: 63578
* Thread CGFunctionInfo construction through CodeGenTypes.Daniel Dunbar2009-02-021-1/+2
| | | | | | - Inefficient & leaks memory currently, will be cleaned up subsequently. llvm-svn: 63567
* More ABI API cleanup.Daniel Dunbar2009-02-021-1/+1
| | | | | | | - Lift CGFunctionInfo creation above ReturnTypeUsesSret and EmitFunction{Epi,Pro}log. llvm-svn: 63553
* ABI handling API changes.Daniel Dunbar2009-02-021-1/+1
| | | | | | | | | | | - Lift CGFunctionInfo creation up to callers of EmitCall. - Move isVariadic bit out of CGFunctionInfo, take as argument to GetFunctionType instead. No functionality change. llvm-svn: 63550
* Refactored code gen for ivar access in preparation forFariborz Jahanian2009-02-021-1/+2
| | | | | | objc2 nonfragile ivar access code gen. llvm-svn: 63541
* Vector codegen improvementsNate Begeman2009-01-181-40/+59
| | | | llvm-svn: 62458
* Patch to implement code gen for aggrgate-valued property usedFariborz Jahanian2009-01-121-0/+8
| | | | | | to access a field of its type. llvm-svn: 62123
* Implement EmitUnsupportedRValue to generate an appropriately typed RValue.Daniel Dunbar2009-01-091-3/+13
| | | | llvm-svn: 62004
* Give "unsupported" error on calls through block pointers instead ofDaniel Dunbar2009-01-091-6/+22
| | | | | | crashes. llvm-svn: 61992
* Add QualifiedDeclRefExpr, which retains additional source-locationDouglas Gregor2009-01-061-1/+3
| | | | | | | | | | | | | | | | | | | information for declarations that were referenced via a qualified-id, e.g., N::C::value. We keep track of the location of the start of the nested-name-specifier. Note that the difference between QualifiedDeclRefExpr and DeclRefExpr does have an effect on the semantics of function calls in two ways: 1) The use of a qualified-id instead of an unqualified-id suppresses argument-dependent lookup 2) If the name refers to a virtual function, the qualified-id version will call the function determined statically while the unqualified-id version will call the function determined dynamically (by looking up the appropriate function in the vtable). Neither of these features is implemented yet, but we do print out qualified names for QualifiedDeclRefExprs as part of the AST printing. llvm-svn: 61789
* Add ASTContext::getBaseElementType and use it in ↵Anders Carlsson2008-12-211-6/+1
| | | | | | CodeGenFunction::EmitArraySubscriptExpr. llvm-svn: 61303
OpenPOWER on IntegriCloud