summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Move some of the CodeGenFunction blocks code up and out. NoMike Stump2009-03-041-2/+2
| | | | | | functionality change. llvm-svn: 66048
* Create a new TypeNodes.def file that enumerates all of the types,Douglas Gregor2009-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | giving them rough classifications (normal types, never-canonical types, always-dependent types, abstract type representations) and making it far easier to make sure that we've hit all of the cases when decoding types. Switched some switch() statements on the type class over to using this mechanism, and filtering out those things we don't care about. For example, CodeGen should never see always-dependent or non-canonical types, while debug info generation should never see always-dependent types. More switch() statements on the type class need to be moved over to using this approach, so that we'll get warnings when we add a new type then fail to account for it somewhere in the compiler. As part of this, some types have been renamed: TypeOfExpr -> TypeOfExprType FunctionTypeProto -> FunctionProtoType FunctionTypeNoProto -> FunctionNoProtoType There shouldn't be any functionality change... llvm-svn: 65591
* Add Type::hasPointerRepresentation predicate.Daniel Dunbar2009-02-261-8/+2
| | | | | | | | | - For types whose native representation is a pointer. - Use to replace ExprConstant.cpp:HasPointerEvalType, CodeGenFunction::isObjCPointerType. llvm-svn: 65569
* Drop uses of isPointerLikeType.Daniel Dunbar2009-02-261-2/+2
| | | | | | - No functionality change. llvm-svn: 65560
* CodeGen support for copied BlockDeclRefExprs.Mike Stump2009-02-251-0/+1
| | | | llvm-svn: 65487
* Pull COdeGenFunction::CreateStaticBlockVarDecl (just for creating theDaniel Dunbar2009-02-251-6/+7
| | | | | | | | global variable) out of GenerateStaticBlockVarDecl. - No intended functionality change. - Prep for some mild cleanups and PR3662. llvm-svn: 65466
* Add low level support for generating invoke instead of calls.Daniel Dunbar2009-02-231-1/+1
| | | | | | - No functionality change. llvm-svn: 65325
* Add CodeGen support for the helper for BlockDeclRefExprs. The easierMike Stump2009-02-211-3/+14
| | | | | | stuff is mostly done. Move BlockHasCopyDispose up. llvm-svn: 65242
* Address Chris's comments regarding C++ name mangling.Douglas Gregor2009-02-181-2/+1
| | | | llvm-svn: 64984
* Add CodeGen support for the nodebug attribute.Anders Carlsson2009-02-131-4/+8
| | | | llvm-svn: 64445
* 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
* Pull CodeGenFunction::EmitVAArg into target specific ABIInfo classes.Daniel Dunbar2009-02-101-35/+0
| | | | llvm-svn: 64235
* Remove the last remnants of the Obj-C EH stack code.Anders Carlsson2009-02-101-1/+1
| | | | llvm-svn: 64205
* Add DidCallStackSave variable to CodeGenFunction.Anders Carlsson2009-02-091-0/+1
| | | | llvm-svn: 64156
* Reuse case destinations.Anders Carlsson2009-02-081-8/+27
| | | | llvm-svn: 64100
* Always check if we can remove branch fixups, even if the cleanup stack is empty.Anders Carlsson2009-02-081-17/+15
| | | | llvm-svn: 64099
* Misc fixes to the cleanup stack code.Anders Carlsson2009-02-081-1/+10
| | | | llvm-svn: 64096
* More cleanup stack work, PopCleanupBlock now returns a struct with the ↵Anders Carlsson2009-02-081-28/+32
| | | | | | switch block and end block. llvm-svn: 64072
* Split some functions upAnders Carlsson2009-02-081-22/+38
| | | | llvm-svn: 64069
* CleanupScope needs to push the cleanup block in its destructorAnders Carlsson2009-02-081-5/+1
| | | | llvm-svn: 64068
* Implement support for branch fixups.Anders Carlsson2009-02-081-1/+71
| | | | llvm-svn: 64064
* More cleanup stack work.Anders Carlsson2009-02-081-0/+41
| | | | llvm-svn: 64059
* When emitting blocks, keep track of which cleanup scope they have. Minor ↵Anders Carlsson2009-02-081-1/+19
| | | | | | fixes and cleanup. llvm-svn: 64053
* Add support for emitting cleanup blocks. Make EmitCompoundStatement emit ↵Anders Carlsson2009-02-071-0/+21
| | | | | | cleanup blocks if necessary llvm-svn: 64051
* Add plumbing for the cleanup stack.Anders Carlsson2009-02-071-0/+9
| | | | llvm-svn: 64043
* Fixup goto codegen in and around VLAs.Mike Stump2009-02-071-1/+1
| | | | llvm-svn: 64014
* Follow Eli's advice and store the VLA size with the native size_t type. ↵Anders Carlsson2009-02-051-5/+6
| | | | | | Fixes PR3491. llvm-svn: 63879
* Add CodeGenFunction::ConvertTypeForMem forwarding function.Daniel Dunbar2009-02-031-0/+4
| | | | llvm-svn: 63678
* Thread CGFunctionInfo construction through CodeGenTypes.Daniel Dunbar2009-02-021-1/+1
| | | | | | - Inefficient & leaks memory currently, will be cleaned up subsequently. llvm-svn: 63567
* More ABI API cleanup.Daniel Dunbar2009-02-021-2/+4
| | | | | | | - Lift CGFunctionInfo creation above ReturnTypeUsesSret and EmitFunction{Epi,Pro}log. llvm-svn: 63553
* Pull EmitReturnBlock out of FinishFunction and catch unified returnDaniel Dunbar2009-01-261-7/+41
| | | | | | case correctly. llvm-svn: 63068
* Skip emission of final return block if possible (e.g., functions withDaniel Dunbar2009-01-261-3/+7
| | | | | | a unified return). llvm-svn: 63038
* Slight cleanup, and fix for va_arg on architectures where va_list is a Eli Friedman2009-01-201-0/+7
| | | | | | struct. llvm-svn: 62585
* Block pointer types are not aggregate types.Daniel Dunbar2009-01-091-1/+4
| | | | llvm-svn: 61973
* Handle typedefs to VLAs (Emit the size expr when we encounter the typedefAnders Carlsson2008-12-201-15/+15
| | | | llvm-svn: 61290
* Make sure to generate code for arguments that have a variably modified type.Anders Carlsson2008-12-201-0/+10
| | | | llvm-svn: 61288
* Change EmitVLASize to take a QualType that must be a variably modified type.Anders Carlsson2008-12-201-21/+32
| | | | | | | | | | | | Emit the size even if the declared type is a variably modified type. This lets us handle void f(int n) { int (*a)[n]; printf("size: %d\n", sizeof(*a)); } llvm-svn: 61285
* Split up emitting of VLA sizes and getting the size of a VLA.Anders Carlsson2008-12-201-17/+25
| | | | llvm-svn: 61284
* Add map of VLA types and their sizesAnders Carlsson2008-12-121-0/+27
| | | | llvm-svn: 60939
* Change more code over to using the new Expr::EvaluateAnders Carlsson2008-12-011-6/+4
| | | | llvm-svn: 60324
* Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make itChris Lattner2008-11-241-1/+2
| | | | | | | | | assert if the name is not an identifier. Update callers to do the right thing and avoid this method in unsafe cases. This also fixes an objc warning that was missing a space, and migrates a couple more to taking IdentifierInfo and QualTypes instead of std::strings. llvm-svn: 59936
* An expression is not foldable if it can't be fully evaluated. Fixes PR3060Anders Carlsson2008-11-221-2/+4
| | | | llvm-svn: 59887
* Introduction the DeclarationName class, as a single, general method ofDouglas Gregor2008-11-171-1/+1
| | | | | | | | representing the names of declarations in the C family of languages. DeclarationName is used in NamedDecl to store the name of the declaration (naturally), and ObjCMethodDecl is now a NamedDecl. llvm-svn: 59441
* rename Expr::tryEvaluate to Expr::Evaluate.Chris Lattner2008-11-161-1/+1
| | | | llvm-svn: 59426
* Normalize many BasicBlock names.Daniel Dunbar2008-11-131-2/+2
| | | | | | | | | | - 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
* Quick fix for crash in IRgen when we can tryEvaluate a condition toDaniel Dunbar2008-11-121-2/+5
| | | | | | | | | something that is not an int. - Ignore these cases for now, added FIXME that we should also boolize them. llvm-svn: 59184
* Handle ?: in EmitBranchOnBoolExpr.Daniel Dunbar2008-11-121-0/+17
| | | | llvm-svn: 59129
* Handle Unary ! in EmitBranchOnBoolExpr, so that we can efficientlyChris Lattner2008-11-121-1/+6
| | | | | | codegen stuff like "if (!(X && Y))" llvm-svn: 59115
* Move EmitBranchOnBoolExpr and ConstantFoldsToSimpleInteger toChris Lattner2008-11-121-0/+85
| | | | | | | | | | 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
* Rework IRgen invariant w.r.t. current insert point.Daniel Dunbar2008-11-111-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
OpenPOWER on IntegriCloud