summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Lift EmitTargetBuiltinExpr out of EmitBuiltinExpr.Daniel Dunbar2008-10-102-8/+15
| | | | llvm-svn: 57335
* Adjust calls to APFloat conversion for new interface.Dale Johannesen2008-10-091-1/+3
| | | | llvm-svn: 57332
* Use DeclStmt::getSolitaryDecl() instead of DeclStmt::getDecl() when ↵Ted Kremenek2008-10-061-3/+3
| | | | | | processing the Decl of an Objective-C foreach statement. llvm-svn: 57209
* Use DeclStmt::getSolitaryDecl() instead of DeclStmt::getDecl() when ↵Ted Kremenek2008-10-061-1/+1
| | | | | | processing the Decl of a @catch statement. llvm-svn: 57208
* In EmitDeclStmt: use DeclStmt::const_decl_iterator instead of walking the ↵Ted Kremenek2008-10-061-3/+3
| | | | | | scoped decl chain. llvm-svn: 57192
* Make sema and codegen allow __builtin___CFStringMakeConstantString as a validChris Lattner2008-10-062-17/+20
| | | | | | | constant lvalue. Implement this in codegen by moving the code out of CGBuiltin into EmitConstantExpr. llvm-svn: 57163
* always try to fold a builtin before emitting it. In the futureChris Lattner2008-10-061-18/+5
| | | | | | | it is possible that a builtin could sometimes be folded (e.g. __builtin_clz) if it's operand is a constant. llvm-svn: 57161
* Move handling of __builtin_nan("") out of CGBuiltin.cpp into ExprConstant.cppChris Lattner2008-10-061-18/+5
| | | | llvm-svn: 57157
* remove some code where CGBuiltin folds constants, and use tryEvaluate toChris Lattner2008-10-061-22/+19
| | | | | | | do it instead. We should still handle __builtin_nan etc, but don't yet. This fixes incorrect evaluation of __builtin_constant_p, a FIXME. llvm-svn: 57156
* instead of making codegen try to know about all of the builtins to generateChris Lattner2008-10-061-23/+8
| | | | | | | constants for them, just use the constant evaluator to do the job. This also fixes crashes on 'unknown constant builtins'. llvm-svn: 57155
* Implement support for the const and pure attributes.Anders Carlsson2008-10-051-0/+4
| | | | llvm-svn: 57142
* Emit error unsupported for break/continue/goto inside Obj-C exceptionDaniel Dunbar2008-10-021-2/+30
| | | | | | | handling blocks. - This has false positives, but at least prevents miscompiles. llvm-svn: 56958
* (LLVM up) Rename IRBuilder::IsNonNull -> IsNotNull.Daniel Dunbar2008-10-021-3/+3
| | | | llvm-svn: 56954
* NeXT: Update to use CreateRuntimeFunction for the routines it imports.Daniel Dunbar2008-10-011-80/+54
| | | | llvm-svn: 56902
* Add simple interface for protecting runtime functions from nameDaniel Dunbar2008-10-012-0/+56
| | | | | | | | | | | | | | | | | collisions. - Provide CodeGenModule::CreateRuntimeFunction which guarantees that the function it creates will have the provided name in the final module. This allows the runtime to have its functions protected from declarations of the same name in the source code. - One could argue that this is a reason to abuse the llvm::Module namespace for dealing with function redeclarations. However, that approach seems conceptually flawed to me. This one also happens to be somewhat more efficient. No functionality change. llvm-svn: 56899
* Added support for sse intrinsics loadlpd, loadhpd, muldq128, and mulld128Mon P Wang2008-09-301-0/+7
| | | | llvm-svn: 56830
* Add infrastructure for proper @finally support.Daniel Dunbar2008-09-303-60/+145
| | | | | | | | | | | | - Provides a basic primitive to jump to an arbitrary basic block, through the finally code. - Only used for return statements and rethrow currently. Still need to handle break, continue and goto. - Code still needs to be shuffled around to live elsewhere. llvm-svn: 56827
* Add support for implicit rethrows in @catch blocks.Daniel Dunbar2008-09-282-10/+102
| | | | | | Comment exception-handling code generation strategy. llvm-svn: 56763
* Skip redundant if.Daniel Dunbar2008-09-281-5/+3
| | | | llvm-svn: 56762
* (Update LLVM) Clean up obj-c exception generation to be a bit moreDaniel Dunbar2008-09-271-23/+15
| | | | | | readable and to generate more readable IR. llvm-svn: 56758
* Bug fix, codegen @catch(id<X> ...) acceptably.Daniel Dunbar2008-09-271-2/+5
| | | | | | | - This should be rejected by sema (IMHO) but that needs some investigation. llvm-svn: 56756
* Simplify generate code for exceptions: Daniel Dunbar2008-09-271-27/+15
| | | | | | | | | | | | | | | | | | | - There is no need to branch on the rethrow variable to determine if we need to call objc_exception_try_exit. We know whether an exception was thrown, so just branch to a different target if we want to skip the try_exit. This is a slight semantic departure from gcc, but only for throwing nil, which is undefined (and for which gcc emits broken code). - Also fixes a bug in current code which was calling try_exit too many times when an exception was uncaught (but there were some handlers). Fix bug introduced in prev. commit, the type of the @catch parameter was uninitialized. llvm-svn: 56754
* Prefer llvm::Function::addFnAttr(...) to F->addAttribute(~0, ...).Daniel Dunbar2008-09-271-1/+1
| | | | llvm-svn: 56753
* Simplify code to emit the unified return block and move it to the endDaniel Dunbar2008-09-271-12/+4
| | | | | | of the function. llvm-svn: 56752
* Bug fix, make sure to initialize exception object (to rethrow) evenDaniel Dunbar2008-09-271-38/+38
| | | | | | | | | | | when there are no @catch blocks. Also, eliminated unneeded alloca for the rethrow object. Also, avoid generating code to rethrow exception if the exception will trivially always be caught. llvm-svn: 56751
* Easy fix for nasty bug, exception data buffer had wrong type == wrongDaniel Dunbar2008-09-271-1/+1
| | | | | | (smaller) size == garbage on stack == heisenbugs. llvm-svn: 56750
* Now Attributes are divided in three groupsDevang Patel2008-09-262-5/+9
| | | | | | | | | | | - return attributes - inreg, zext and sext - parameter attributes - function attributes - nounwind, readonly, readnone, noreturn Return attributes use 0 as the index. Function attributes use ~0U as the index. llvm-svn: 56705
* Large mechanical patch.Devang Patel2008-09-254-35/+35
| | | | | | | | | | | | | s/ParamAttr/Attribute/g s/PAList/AttrList/g s/FnAttributeWithIndex/AttributeWithIndex/g s/FnAttr/Attribute/g This sets the stage - to implement function notes as function attributes and - to distinguish between function attributes and return value attributes. llvm-svn: 56623
* Implement Obj-C synthesized setters for copy / retain.Daniel Dunbar2008-09-242-23/+65
| | | | llvm-svn: 56547
* Implement Obj-C getter synthesis for copy and retain.Daniel Dunbar2008-09-241-12/+56
| | | | | | Also, "simple" getter synthesis no longer uses temporary AST objects. llvm-svn: 56544
* Refactor some CodeGen functionality: Daniel Dunbar2008-09-243-16/+59
| | | | | | | | | | - 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
* Add Obj-C runtime methods to get runtime specific functions forDaniel Dunbar2008-09-243-10/+61
| | | | | | implementing property access. llvm-svn: 56542
* Adjust whitespaces.Devang Patel2008-09-241-2/+2
| | | | llvm-svn: 56538
* s/ParamAttrsWithIndex/FnAttributeWithIndex/gDevang Patel2008-09-242-6/+6
| | | | | | Rename to match changes done on llvm side. llvm-svn: 56537
* Improve x86 ABI compatibility.Daniel Dunbar2008-09-171-1/+132
| | | | | | | | | | | | | | - Enables use of ABIArgInfo::Expand when needed. This greatly improves our x86 ABI compatibility. - As the infrastructure for target specific ABI handling isn't built yet, this change means ABI compatibility on other platforms is once again broken in a different way than before. - Upcoming: Figure out how to refactor ABI handling into targets. More documentation. llvm-svn: 56293
* Print current function on verification failures.Daniel Dunbar2008-09-171-1/+4
| | | | llvm-svn: 56291
* Drop CodeGenTypes parameter to classifyArgumentType.Daniel Dunbar2008-09-171-14/+29
| | | | | | | | | Ensure that ABIArgInfo::Default implementation for aggregrate types is sensible (StructRet on return and ByVal on arguments). No functionality change. llvm-svn: 56289
* Add support for ABIArgInfo::ExpandDaniel Dunbar2008-09-174-44/+183
| | | | | | - No functionality change. llvm-svn: 56269
* Make sure to store the exception in the catch parameter.Anders Carlsson2008-09-115-19/+38
| | | | llvm-svn: 56102
* Make sure to emit the catch parameter as well as the catch body.Anders Carlsson2008-09-114-5/+15
| | | | llvm-svn: 56101
* Fix stupid mistake I made in the exception handling codeAnders Carlsson2008-09-111-1/+1
| | | | llvm-svn: 56100
* Use ABIArgInfo for decisions about function arguments (not just returnDaniel Dunbar2008-09-111-29/+145
| | | | | | | | | | | | | value). - Added ABIArgInfo::ByVal (mostly supported) and ABIArgInfo::Expand (asserted out). - Added classifyArgumentType which currently just uses ABIArgInfo::Default or ByVal. This nearly matches old behavior, but we now set ByVal in a few situations we may have left it off before (on complex, for example). llvm-svn: 56086
* Bug fix, apply default argument promotion in message sends for whichDaniel Dunbar2008-09-111-0/+6
| | | | | | | | | no method declaration was found. - This was allowing arrays to pass "by value" among other things. Add assert in CodeGen that arguments cannot have array type. llvm-svn: 56080
* Implement ABIArgType::Coerce support.Daniel Dunbar2008-09-101-27/+40
| | | | | | | | - As a test, enable basic usage for some common x86-32 cases. This increases our x86-32 compliance (on other targets our compliance will just be broken in a different way). llvm-svn: 56051
* Add CodeGenTypes::GetFunctionType overload for getting the effectiveDaniel Dunbar2008-09-103-34/+40
| | | | | | | | | | | | type of a call. Change NeXT runtime to use this instead of trying to bitcasting internally (which doesn't respect the ABI). Fix subtle bug, use of ConvertTypeRecursive instead of ConvertType is bad inside GetFunctionType. llvm-svn: 56050
* Move FunctionType conversion into CGCall.cpp:Daniel Dunbar2008-09-108-159/+111
| | | | | | | | | | | | | - Added CodeGenTypes::GetFunctionType, taking a CGFunctionInfo. - Updated Obj-C runtimes to use this instead of rolling the llvm::FunctionType by hand. - Killed CodeGenTypes::{ConvertReturnType, DecodeArgumentTypes}. Add ABIArgInfo class to encapsulate ABI decision of how to lower types to LLVM. - Will move to target sometime soon. llvm-svn: 56047
* Add ABIArgInfo class to encapsulate ABI decision of how to lower typesDaniel Dunbar2008-09-101-38/+123
| | | | | | | to LLVM. - Will move to target sometime soon. llvm-svn: 56046
* Implement CodeGen support for the 'CXXConditionDeclExpr' expression node, ↵Argyrios Kyrtzidis2008-09-102-0/+12
| | | | | | which represents a 'condition' declaration, e.g: "if (int x=0) {...}". llvm-svn: 56045
* Tweak CGCall functions again:Daniel Dunbar2008-09-105-21/+28
| | | | | | | | - Realized these functions will eventually need access to more data, moved to CodeGenModule. Eventually they should probably live together in some other helper class. llvm-svn: 56039
* Tweak CGCall functions:Daniel Dunbar2008-09-104-66/+82
| | | | | | | | - Move actual param attr list creation to CodeGenFunction::ConstructParamAttrList. - Make ReturnTypeUsesSret static. llvm-svn: 56038
OpenPOWER on IntegriCloud