summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
Commit message (Collapse)AuthorAge
...
* Add CodeGen support for the helper for BlockDeclRefExprs. The easierMike Stump2009-02-21
| | | | | | | stuff is mostly done. Move BlockHasCopyDispose up. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65242 91177308-0d34-0410-b5e6-96231b3b80d8
* Address Chris's comments regarding C++ name mangling.Douglas Gregor2009-02-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64984 91177308-0d34-0410-b5e6-96231b3b80d8
* Add CodeGen support for the nodebug attribute.Anders Carlsson2009-02-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64445 91177308-0d34-0410-b5e6-96231b3b80d8
* Add basic support for C++ name mangling according to the Itanium C++Douglas Gregor2009-02-13
| | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64413 91177308-0d34-0410-b5e6-96231b3b80d8
* Pull CodeGenFunction::EmitVAArg into target specific ABIInfo classes.Daniel Dunbar2009-02-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64235 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the last remnants of the Obj-C EH stack code.Anders Carlsson2009-02-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64205 91177308-0d34-0410-b5e6-96231b3b80d8
* Add DidCallStackSave variable to CodeGenFunction.Anders Carlsson2009-02-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64156 91177308-0d34-0410-b5e6-96231b3b80d8
* Reuse case destinations.Anders Carlsson2009-02-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64100 91177308-0d34-0410-b5e6-96231b3b80d8
* Always check if we can remove branch fixups, even if the cleanup stack is empty.Anders Carlsson2009-02-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64099 91177308-0d34-0410-b5e6-96231b3b80d8
* Misc fixes to the cleanup stack code.Anders Carlsson2009-02-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64096 91177308-0d34-0410-b5e6-96231b3b80d8
* More cleanup stack work, PopCleanupBlock now returns a struct with the ↵Anders Carlsson2009-02-08
| | | | | | switch block and end block. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64072 91177308-0d34-0410-b5e6-96231b3b80d8
* Split some functions upAnders Carlsson2009-02-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64069 91177308-0d34-0410-b5e6-96231b3b80d8
* CleanupScope needs to push the cleanup block in its destructorAnders Carlsson2009-02-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64068 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement support for branch fixups.Anders Carlsson2009-02-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64064 91177308-0d34-0410-b5e6-96231b3b80d8
* More cleanup stack work.Anders Carlsson2009-02-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64059 91177308-0d34-0410-b5e6-96231b3b80d8
* When emitting blocks, keep track of which cleanup scope they have. Minor ↵Anders Carlsson2009-02-08
| | | | | | fixes and cleanup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64053 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for emitting cleanup blocks. Make EmitCompoundStatement emit ↵Anders Carlsson2009-02-07
| | | | | | cleanup blocks if necessary git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64051 91177308-0d34-0410-b5e6-96231b3b80d8
* Add plumbing for the cleanup stack.Anders Carlsson2009-02-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64043 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixup goto codegen in and around VLAs.Mike Stump2009-02-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64014 91177308-0d34-0410-b5e6-96231b3b80d8
* Follow Eli's advice and store the VLA size with the native size_t type. ↵Anders Carlsson2009-02-05
| | | | | | Fixes PR3491. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63879 91177308-0d34-0410-b5e6-96231b3b80d8
* Add CodeGenFunction::ConvertTypeForMem forwarding function.Daniel Dunbar2009-02-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63678 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread CGFunctionInfo construction through CodeGenTypes.Daniel Dunbar2009-02-02
| | | | | | | - Inefficient & leaks memory currently, will be cleaned up subsequently. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63567 91177308-0d34-0410-b5e6-96231b3b80d8
* More ABI API cleanup.Daniel Dunbar2009-02-02
| | | | | | | | - Lift CGFunctionInfo creation above ReturnTypeUsesSret and EmitFunction{Epi,Pro}log. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63553 91177308-0d34-0410-b5e6-96231b3b80d8
* Pull EmitReturnBlock out of FinishFunction and catch unified returnDaniel Dunbar2009-01-26
| | | | | | | case correctly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63068 91177308-0d34-0410-b5e6-96231b3b80d8
* Skip emission of final return block if possible (e.g., functions withDaniel Dunbar2009-01-26
| | | | | | | a unified return). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63038 91177308-0d34-0410-b5e6-96231b3b80d8
* Slight cleanup, and fix for va_arg on architectures where va_list is a Eli Friedman2009-01-20
| | | | | | | | struct. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62585 91177308-0d34-0410-b5e6-96231b3b80d8
* Block pointer types are not aggregate types.Daniel Dunbar2009-01-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61973 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle typedefs to VLAs (Emit the size expr when we encounter the typedefAnders Carlsson2008-12-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61290 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure to generate code for arguments that have a variably modified type.Anders Carlsson2008-12-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61288 91177308-0d34-0410-b5e6-96231b3b80d8
* Change EmitVLASize to take a QualType that must be a variably modified type.Anders Carlsson2008-12-20
| | | | | | | | | | | | | | 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)); } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61285 91177308-0d34-0410-b5e6-96231b3b80d8
* Split up emitting of VLA sizes and getting the size of a VLA.Anders Carlsson2008-12-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61284 91177308-0d34-0410-b5e6-96231b3b80d8
* Add map of VLA types and their sizesAnders Carlsson2008-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60939 91177308-0d34-0410-b5e6-96231b3b80d8
* Change more code over to using the new Expr::EvaluateAnders Carlsson2008-12-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60324 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make itChris Lattner2008-11-24
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59936 91177308-0d34-0410-b5e6-96231b3b80d8
* An expression is not foldable if it can't be fully evaluated. Fixes PR3060Anders Carlsson2008-11-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59887 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduction the DeclarationName class, as a single, general method ofDouglas Gregor2008-11-17
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59441 91177308-0d34-0410-b5e6-96231b3b80d8
* rename Expr::tryEvaluate to Expr::Evaluate.Chris Lattner2008-11-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59426 91177308-0d34-0410-b5e6-96231b3b80d8
* Normalize many BasicBlock names.Daniel Dunbar2008-11-13
| | | | | | | | | | | - Use dotted notation for blocks related to a particular statement type. - Use .end for landing pads. No functionality change in NDEBUG mode. :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59210 91177308-0d34-0410-b5e6-96231b3b80d8
* Quick fix for crash in IRgen when we can tryEvaluate a condition toDaniel Dunbar2008-11-12
| | | | | | | | | | something that is not an int. - Ignore these cases for now, added FIXME that we should also boolize them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59184 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle ?: in EmitBranchOnBoolExpr.Daniel Dunbar2008-11-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59129 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle Unary ! in EmitBranchOnBoolExpr, so that we can efficientlyChris Lattner2008-11-12
| | | | | | | codegen stuff like "if (!(X && Y))" git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59115 91177308-0d34-0410-b5e6-96231b3b80d8
* Move EmitBranchOnBoolExpr and ConstantFoldsToSimpleInteger toChris Lattner2008-11-12
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59113 91177308-0d34-0410-b5e6-96231b3b80d8
* Rework IRgen invariant w.r.t. current insert point.Daniel Dunbar2008-11-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59089 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit debug region end in unified return block.Daniel Dunbar2008-11-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59081 91177308-0d34-0410-b5e6-96231b3b80d8
* short circuit && and || when possible. This substantially reducesChris Lattner2008-11-11
| | | | | | | | | the size of the -O0 output on some cases. For example, on expr.c from 176.gcc, it shrinks the .ll file from 43164 to 42835 lines, and removed references to two external symbols. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59034 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove CodeGenFunction::StartBlock.Daniel Dunbar2008-11-11
| | | | | | | - Was confusing and only used in one small part of the code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59020 91177308-0d34-0410-b5e6-96231b3b80d8
* Centralize basic block creation in CodeGenFunction::createBasicBlock.Daniel Dunbar2008-11-11
| | | | | | | - No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59017 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement lowering of va_arg in clang directly. (This is 32-bit X86 only for ↵Anders Carlsson2008-11-04
| | | | | | now). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58681 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't run the verifier as part of IRgen, this is now down (per module)Daniel Dunbar2008-10-28
| | | | | | | in the driver (this means we no longer run the verifier per function, however). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58307 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug info bug fix, function start wasn't getting generated correctlyDaniel Dunbar2008-10-18
| | | | | | | for Obj-C methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57769 91177308-0d34-0410-b5e6-96231b3b80d8