summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Generate fpmath metadata when -ffast-math. Note that no optimizations are hookedDuncan Sands2012-04-161-1/+6
| | | | | | up to this yet. llvm-svn: 154835
* Propagate alignment on lvalues through EmitLValueForField. PR12395.Eli Friedman2012-04-161-2/+6
| | | | llvm-svn: 154789
* [frontend] Add support for disabling the "inline" keyword using Chad Rosier2012-03-141-7/+8
| | | | | | | | | | | -fno-inline-functions. This behaves much like -fno-inline in gcc, but based on a discussion with Daniel it was decided that -fno-inline-functions should subsume -fno-inline. Please speak up if you object. The -fno-inline flag remains ignored. Final part of rdar://10972766 llvm-svn: 152754
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-5/+5
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Implement "optimization" for lambda-to-block conversion which inlines the ↵Eli Friedman2012-03-011-2/+1
| | | | | | | | generated block literal for lambdas which are immediately converted to block pointer type. This simplifies the AST, avoids an unnecessary copy of the lambda and makes it much easier to avoid copying the result onto the heap. Note that this transformation has a substantial semantic effect outside of ARC: it gives the converted lambda lifetime semantics similar to a block literal. With ARC, the effect is much less obvious because the lifetime of blocks is already managed. llvm-svn: 151797
* Work-in-progress for lambda conversion-to-block operator. Still need to ↵Eli Friedman2012-02-251-1/+2
| | | | | | implement the retain+autorelease outside of ARC, and there's a bug that causes the generated code to crash in ARC (which I think is unrelated to my code, although I'm not completely sure). llvm-svn: 151428
* Remove redundant check.Chad Rosier2012-02-181-3/+2
| | | | llvm-svn: 150855
* Rework the Sema/AST/IRgen dance for the lambda closure type'sDouglas Gregor2012-02-171-7/+9
| | | | | | | | | | | | | | | | | | | | conversion to function pointer. Rather than having IRgen synthesize the body of this function, we instead introduce a static member function "__invoke" with the same signature as the lambda's operator() in the AST. Sema then generates a body for the conversion to function pointer which simply returns the address of __invoke. This approach makes it easier to evaluate a call to the conversion function as a constant, makes the linkage of the __invoke function follow the normal rules for member functions, and may make life easier down the road if we ever want to constexpr'ify some of lambdas. Note that IR generation is responsible for filling in the body of __invoke (Sema just adds a dummy body), because the body can't generally be expressed in C++. Eli, please review! llvm-svn: 150783
* Start of IRGen for lambda conversion operators.Eli Friedman2012-02-161-0/+9
| | | | llvm-svn: 150649
* Remove useless if statement.Eli Friedman2012-02-141-19/+14
| | | | llvm-svn: 150459
* Basic support for referring to captured variables from lambdas. Some simple ↵Eli Friedman2012-02-111-7/+27
| | | | | | examples seem to work. Tests coming up soon. llvm-svn: 150293
* CodeGen: Move EHPersonality from CGException.h into the cpp file, it has no ↵Benjamin Kramer2012-02-081-1/+0
| | | | | | | | other users. While at it make it value-initializable to get rid of static ctors. llvm-svn: 150070
* simplify a bunch of code to use the well-known LLVM IR types computed by ↵Chris Lattner2012-02-071-4/+2
| | | | | | CodeGenModule. llvm-svn: 149943
* Fixed VLA code generation.Abramo Bagnara2012-01-111-14/+22
| | | | llvm-svn: 147933
* Fixed TypeofExpr AST and code generation.Abramo Bagnara2012-01-071-5/+19
| | | | llvm-svn: 147730
* Small refactoring and simplification of constant evaluation and some of itsRichard Smith2011-12-281-7/+5
| | | | | | clients. No functionality change. llvm-svn: 147318
* Enter the cleanups for a block outside the enclosingJohn McCall2011-11-101-1/+9
| | | | | | | | | | | | full-expression. Naturally they're inactive before we enter the block literal expression. This restores the intended behavior that blocks belong to their enclosing scope. There's a useful -O0 / compile-time optimization that we're missing here with activating cleanups following straight-line code from their inactive beginnings. llvm-svn: 144268
* Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it willRichard Smith2011-10-291-1/+1
| | | | | | | | implicitly perform an lvalue-to-rvalue conversion if used on an lvalue expression. Also improve the documentation of Expr::Evaluate* to indicate which of them will accept expressions with side-effects. llvm-svn: 143263
* Fix mismatched new[]/delete[].Benjamin Kramer2011-10-241-1/+1
| | | | llvm-svn: 142803
* Fix PR11073 by adding the argument type information to the decl we constructEric Christopher2011-10-211-3/+10
| | | | | | | | for the function type. Update a testcase accordingly. Patch initially by Anders Waldenborg! llvm-svn: 142700
* Recommit:Eric Christopher2011-10-131-0/+3
| | | | | | | | | | | | | | | Start handling debug line and scope information better: Migrate most of the location setting within the larger API in CGDebugInfo and update a lot of callers. Remove the existing file/scope change machinery in UpdateLineDirectiveRegion and replace it with DILexicalBlockFile usage. Finishes off the rest of rdar://10246360 after fixing a few bugs that were exposed in gdb testsuite testing. llvm-svn: 141893
* Support for C1x _Atomic specifier (see testcase). This is primarily being ↵Eli Friedman2011-10-061-0/+8
| | | | | | | | committed at the moment to help support C++0x <atomic>, but it should be a solid base for implementing the full specification of C1x _Atomic. Thanks to Jeffrey Yasskin for the thorough review! llvm-svn: 141330
* CUDA: IR generation support for device stubsPeter Collingbourne2011-10-061-0/+5
| | | | llvm-svn: 141304
* de-tmpify clang.Benjamin Kramer2011-09-271-1/+1
| | | | llvm-svn: 140637
* Throw the switch to convert clang to the new exception handling model!Bill Wendling2011-09-191-1/+4
| | | | | | | | | | | | | This model uses the 'landingpad' instruction, which is pinned to the top of the landing pad. (A landing pad is defined as the destination of the unwind branch of an invoke instruction.) All of the information needed to generate the correct exception handling metadata during code generation is encoded into the landingpad instruction. The new 'resume' instruction takes the place of the llvm.eh.resume intrinsic call. It's lowered in much the same way as the intrinsic is. llvm-svn: 140049
* Bring llvm.annotation* intrinsics support back to where it was in llvm-gcc: canJulien Lerouge2011-09-091-0/+47
| | | | | | | annotate global, local variables, struct fields, or arbitrary statements (using the __builtin_annotation), rdar://8037476. llvm-svn: 139423
* Carry the debug information from single exit unified return blockEric Christopher2011-09-091-1/+2
| | | | | | | | along with the new insert point. Fixes PR10829 llvm-svn: 139416
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-021-1/+1
| | | | | | | | builtin types (When requested). This is another step toward making ASTUnit build the ASTContext as needed when loading an AST file, rather than doing so after the fact. No actual functionality change (yet). llvm-svn: 138985
* Simplify EH control flow by observing that EH scopes form a simpleJohn McCall2011-08-111-3/+3
| | | | | | | | | | | | | | | hierarchy of delegation, and that EH selector values are meaningful function-wide (good thing, too, or inlining wouldn't work). 2,3d 1a hierarchy of delegation and that EH selector values have the same meaning everywhere in the function instead of being meaningful only in the context of a specific selector. This removes the need for routing edges through EH cleanups, since a cleanup simply always branches to its enclosing scope. llvm-svn: 137293
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-2/+2
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to useJay Foad2011-07-221-2/+1
| | | | | | ArrayRef. llvm-svn: 135761
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-181-4/+4
| | | | llvm-svn: 135370
* Change intrinsic getter to take an ArrayRef, now that the underlying ↵Benjamin Kramer2011-07-141-1/+1
| | | | | | function in LLVM does. llvm-svn: 135155
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-4/+4
| | | | llvm-svn: 134831
* A number of array-related IR-gen cleanups.John McCall2011-07-091-0/+78
| | | | | | | | | | | | - Emit default-initialization of arrays that were partially initialized with initializer lists with a loop, rather than emitting the default initializer N times; - support destroying VLAs of non-trivial type, although this is not yet exposed to users; and - support the partial destruction of arrays initialized with initializer lists when an initializer throws an exception. llvm-svn: 134784
* Change the IR-generation of VLAs so that we capture bounds,John McCall2011-06-241-47/+114
| | | | | | | not sizes; so that we use well-typed allocas; and so that we properly recurse through the full set of variably-modified types. llvm-svn: 133827
* Automatic Reference Counting.John McCall2011-06-151-1/+18
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Convert Clang over to resuming from landing pads with llvm.eh.resume.John McCall2011-05-281-3/+3
| | | | | | It's quite likely that this will explode, but I need to know how. :) llvm-svn: 132269
* Eliminate temporary argument vectors.Benjamin Kramer2011-05-281-9/+5
| | | | llvm-svn: 132260
* Fix crash on C++ code when compiling with -finstrument-functions.Ted Kremenek2011-05-161-1/+1
| | | | llvm-svn: 131435
* Make CGF.getContext() inlinable, because it's trivial, and optimizeJohn McCall2011-05-151-7/+35
| | | | | | hasAggregateLLVMType. llvm-svn: 131375
* Eliminate some literal 8s from EmitNullInitialization() by convertingKen Dyck2011-04-221-7/+9
| | | | | | variables to CharUnits. No change in functionality intended. llvm-svn: 130001
* PR9214: Convert Metadata API to use ArrayRef.Jay Foad2011-04-211-1/+1
| | | | llvm-svn: 129929
* C1X: implement generic selectionsPeter Collingbourne2011-04-151-2/+1
| | | | | | | As an extension, generic selection support has been added for all supported languages. The syntax is the same as for C1X. llvm-svn: 129554
* Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad2011-03-301-3/+3
| | | | | | PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128538
* Use the "undergoes default argument promotion" bit on parameters toJohn McCall2011-03-091-15/+8
| | | | | | | | | | simplify the logic of initializing function parameters so that we don't need both a variable declaration and a type in FunctionArgList. This also means that we need to propagate the CGFunctionInfo down in a lot of places rather than recalculating it from the FAL. There's more we can do to eliminate redundancy here, and I've left FIXMEs behind to do it. llvm-svn: 127314
* DebugInfo can be enabled or disabled at function level (e.g. using an ↵Devang Patel2011-03-071-3/+3
| | | | | | attribute). However, at module level it is determined by command line option and the state of command line option does not change during compilation. Make this layering explicit and fix accidental cases where the code generator was checking whether module has debug info enabled instead of checking whether debug info is enabled for this function or not. llvm-svn: 127165
* Initialize variable.Bill Wendling2011-03-041-2/+2
| | | | llvm-svn: 127039
* Revert "Add CC_Win64ThisCall and set it in the necessary places."Tilmann Scheller2011-03-021-4/+3
| | | | | | This reverts commit 126863. llvm-svn: 126886
* Add CC_Win64ThisCall and set it in the necessary places.Tilmann Scheller2011-03-021-3/+4
| | | | llvm-svn: 126863
OpenPOWER on IntegriCloud