summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Patch by Anton Lokhmotov to add OpenCL work group size attributes.Tanya Lattner2012-07-091-0/+10
| | | | llvm-svn: 159965
* Significantly simplify CGExprAgg's logic about ignored results:John McCall2012-07-021-4/+5
| | | | | | | | | | | | if we want to ignore a result, the Dest will be null. Otherwise, we must copy into it. This means we need to ensure a slot when loading from a volatile l-value. With all that in place, fix a bug with chained assignments into __block variables of aggregate type where we were losing insight into the actual source of the value during the second assignment. llvm-svn: 159630
* Dead code eliminate the massive hexagon builtin intrinsic supporting code.Benjamin Kramer2012-06-281-2/+0
| | | | | | | | The tablegen'd code does the same thing without this egregious duplication. In my limited testing everything seems to work, however there can be differences if the clang and llvm builtin definitions don't match. llvm-svn: 159371
* Support MIPS DSP Rev1 intrinsics. Simon Atanasyan2012-06-281-0/+1
| | | | | | This patch was reviewed in the llvm-commits list by Jim Grosbach. llvm-svn: 159366
* Propagate lvalue alignment into bitfields. Per report on cfe-dev.Eli Friedman2012-06-271-3/+0
| | | | llvm-svn: 159295
* block literal irgen: several improvements on naming blockFariborz Jahanian2012-06-261-1/+1
| | | | | | | | | | | | literal helper functions. All helper functions (global and locals) use block_invoke as their prefix. Local literal helper names are prefixed by their enclosing mangled function names. Blocks in non-local initializers (e.g. a global variable or a C++11 field) are prefixed by their mangled variable name. The descriminator number added to end of the name starts off with blank (for first block) and _<N> (for the N+2-th block). llvm-svn: 159206
* Etch out the code path for MS-style inline assembly.Chad Rosier2012-06-111-0/+1
| | | | llvm-svn: 158325
* objective-c: fix a sema and IRGen crash when propertyFariborz Jahanian2012-05-291-0/+1
| | | | | | | | getter result type is safe but does not match with property type resulting in spurious warning followed by crash in IRGen. // rdar://11515196 llvm-svn: 157641
* Implement IRGen for C++11's "T{1, 2, 3}", where T is an aggregate and theRichard Smith2012-05-141-0/+1
| | | | | | expression is treated as an lvalue. llvm-svn: 156781
* add -fbounds-checking option.Nuno Lopes2012-05-081-0/+5
| | | | | | | | When enabled, clang generates bounds checks for array and pointers dereferences. Work to follow in LLVM's backend. OK'ed by Chad; thanks for the review. llvm-svn: 156431
* Abstract the emission of global destructors into ABI-specific codeJohn McCall2012-05-011-4/+3
| | | | | | | | | | | | | and only consider using __cxa_atexit in the Itanium logic. The default logic is to use atexit(). Emit "guarded" initializers in Microsoft mode unconditionally. This is definitely not correct, but it's closer to correct than just not emitting the initializer. Based on a patch by Timur Iskhodzhanov! llvm-svn: 155894
* Implements boxed expressions for Objective-C. <rdar://problem/10194391>Patrick Beard2012-04-191-1/+1
| | | | llvm-svn: 155082
* Propagate alignment on lvalues through EmitLValueForField. PR12395.Eli Friedman2012-04-161-6/+4
| | | | llvm-svn: 154789
* Add an AttributedStmt type to represent a statement with C++11 attributesRichard Smith2012-04-141-0/+1
| | | | | | | | | attached. Since we do not support any attributes which appertain to a statement (yet), testing of this is necessarily quite minimal. Patch by Alexander Kornienko! llvm-svn: 154723
* Step forward with supporting of ARM homogenous aggregates:Anton Korobeynikov2012-04-131-0/+2
| | | | | | | - Handle unions - Handle C++ classes llvm-svn: 154664
* Express the number of ULPs in fpaccuracy metadata as a real rather than a Duncan Sands2012-04-101-2/+1
| | | | | | rational number, eg as 2.5 rather than 5, 2. OK'd by Peter Collingbourne. llvm-svn: 154388
* Rename GenerateCXXGlobalDtorFunc to GenerateCXXGlobalDtorsFunc.John McCall2012-04-061-4/+4
| | | | llvm-svn: 154190
* Revert r153723, and its follow-ups r153728 and r153733.Chandler Carruth2012-03-301-11/+11
| | | | | | | | | | | | | | | | These patches cause us to miscompile and/or reject code with static function-local variables in an extern-C context. Previously, we were papering over this as long as the variables are within the same translation unit, and had not seen any failures in the wild. We still need a proper fix, which involves mangling static locals inside of an extern-C block (as GCC already does), but this patch causes pretty widespread regressions. Firefox, and many other applications no longer build. Lots of test cases have been posted to the list in response to this commit, so there should be no problem reproducing the issues. llvm-svn: 153768
* Do the static-locals thing properly in the face of unions andJohn McCall2012-03-301-11/+11
| | | | | | other things which might mess with the variable's type. llvm-svn: 153733
* Revert r153613 as it's causing large compile-time regressions on the nightly ↵Chad Rosier2012-03-291-10/+4
| | | | | | testers. llvm-svn: 153660
* When we can't prove that the target of an aggregate copy isJohn McCall2012-03-281-4/+10
| | | | | | | a complete object, the memcpy needs to use the data size of the structure instead of its sizeof() value. Fixes PR12204. llvm-svn: 153613
* Add back r153360 with a fix for enums that cover all the 32 bit values.Rafael Espindola2012-03-241-0/+1
| | | | | | Thanks to NAKAMURA Takumi for finding it! llvm-svn: 153383
* Revert r153360 (and r153380), "Second part of PR12251. Produce the range ↵NAKAMURA Takumi2012-03-241-1/+0
| | | | | | | | | | metadata in clang for booleans and". For i686 targets (eg. cygwin), I saw "Range must not be empty!" in verifier. It produces (i32)[0x80000000:0x80000000) from (uint64_t)[0xFFFFFFFF80000000ULL:0x0000000080000000ULL), for signed i32 on MDNode::Range. llvm-svn: 153382
* Second part of PR12251. Produce the range metadata in clang for booleans andRafael Espindola2012-03-241-0/+1
| | | | | | c++ enums. llvm-svn: 153360
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-3/+3
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr toJohn McCall2012-03-101-7/+2
| | | | | | | | track whether the referenced declaration comes from an enclosing local context. I'm amenable to suggestions about the exact meaning of this bit. llvm-svn: 152491
* Unify the BlockDeclRefExpr and DeclRefExpr paths so thatJohn McCall2012-03-101-0/+30
| | | | | | | | we correctly emit loads of BlockDeclRefExprs even when they don't qualify as ODR-uses. I think I'm adequately convinced that BlockDeclRefExpr can die. llvm-svn: 152479
* Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,Ted Kremenek2012-03-061-0/+5
| | | | | | | | | | | | | NSNumber, and boolean literals. This includes both Sema and Codegen support. Included is also support for new Objective-C container subscripting. My apologies for the large patch. It was very difficult to break apart. The patch introduces changes to the driver as well to cause clang to link in additional runtime support when needed to support the new language features. Docs are forthcoming to document the implementation and behavior of these features. llvm-svn: 152137
* PR12094: Set the alignment of memory intrinsic instructions based on theJay Foad2012-03-021-0/+10
| | | | | | types of the pointer arguments. llvm-svn: 151927
* Implement "optimization" for lambda-to-block conversion which inlines the ↵Eli Friedman2012-03-011-1/+0
| | | | | | | | 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
* Implement IRGen for the retain-autorelease in the lambda ↵Eli Friedman2012-02-281-0/+1
| | | | | | conversion-to-block-pointer outside of ARC. Testcases coming up soon. llvm-svn: 151603
* Work-in-progress for lambda conversion-to-block operator. Still need to ↵Eli Friedman2012-02-251-1/+6
| | | | | | 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
* Use an ArrayRef when we can instead of passing in a SmallVectorImpl reference.Bill Wendling2012-02-221-1/+1
| | | | llvm-svn: 151150
* Make heap-allocation of std::initializer_list 'work'.Sebastian Redl2012-02-191-1/+1
| | | | llvm-svn: 150931
* Get recursive initializer lists to work and add a test. Codegen of ↵Sebastian Redl2012-02-191-1/+2
| | | | | | std::initializer_list is now complete. Onward to array new. llvm-svn: 150926
* Basic code generation support for std::initializer_list.Sebastian Redl2012-02-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | We now generate temporary arrays to back std::initializer_list objects initialized with braces. The initializer_list is then made to point at the array. We support both ptr+size and start+end forms, although the latter is untested. Array lifetime is correct for temporary std::initializer_lists (e.g. call arguments) and local variables. It is untested for new expressions and member initializers. Things left to do: Massively increase the amount of testing. I need to write tests for start+end init lists, temporary objects created as a side effect of initializing init list objects, new expressions, member initialization, creation of temporary objects (e.g. std::vector) for initializer lists, and probably more. Get lifetime "right" for member initializers and new expressions. Not that either are very useful. Implement list-initialization of array new expressions. llvm-svn: 150803
* Rework the Sema/AST/IRgen dance for the lambda closure type'sDouglas Gregor2012-02-171-5/+2
| | | | | | | | | | | | | | | | | | | | 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
* Initial implementation of IRGen for the lambda ↵Eli Friedman2012-02-161-0/+4
| | | | | | conversion-to-function-pointer operator. llvm-svn: 150660
* Start of IRGen for lambda conversion operators.Eli Friedman2012-02-161-0/+3
| | | | llvm-svn: 150649
* Teach clang to add metadata tags to calls and invokes in ObjC withDan Gohman2012-02-161-0/+2
| | | | | | | | | -fno-objc-arc-exceptions. This will allow the optimizer to perform optimizations which are only safe under that flag. This is a part of rdar://10803830. llvm-svn: 150644
* Implement IRGen of lambda expressions which capture arrays.Eli Friedman2012-02-141-0/+3
| | | | llvm-svn: 150452
* Deal with a horrible C++11 special case. If a non-literal type has a constexprRichard Smith2012-02-131-3/+6
| | | | | | | | | | | constructor, and that constructor is used to initialize an object of static storage duration such that all members and bases are initialized by constant expressions, constant initialization is performed. In this case, the object can still have a non-trivial destructor, and if it does, we must emit a dynamic initializer which performs no initialization and instead simply registers that destructor. llvm-svn: 150419
* Basic support for referring to captured variables from lambdas. Some simple ↵Eli Friedman2012-02-111-1/+5
| | | | | | examples seem to work. Tests coming up soon. llvm-svn: 150293
* Refactor lambda IRGen so AggExprEmitter::VisitLambdaExpr does the right thing.Eli Friedman2012-02-091-0/+2
| | | | llvm-svn: 150146
* A little bit of lambda IRGen.Eli Friedman2012-02-081-0/+1
| | | | llvm-svn: 150058
* revert r149184Fariborz Jahanian2012-01-291-69/+1
| | | | llvm-svn: 149205
* objc-arc: Perform null check on receiver before sending methods whichFariborz Jahanian2012-01-281-1/+69
| | | | | | | | consume one or more of their arguments. If not done, this will cause a leak as method will not consume the argument when receiver is null. // rdar://10444474 llvm-svn: 149184
* Use function pointers, rather than references, to pass DestroyersPeter Collingbourne2012-01-261-7/+7
| | | | | | | around, in the process cleaning up the various gcc/msvc compiler workarounds. llvm-svn: 149036
* Some improvements to the handling of C11 atomic types:David Chisnall2012-01-161-4/+5
| | | | | | | | | | | | | | | | | | - Add atomic-to/from-nonatomic cast types - Emit atomic operations for arithmetic on atomic types - Emit non-atomic stores for initialisation of atomic types, but atomic stores and loads for every other store / load - Add a __atomic_init() intrinsic which does a non-atomic store to an _Atomic() type. This is needed for the corresponding C11 stdatomic.h function. - Enables the relevant __has_feature() checks. The feature isn't 100% complete yet, but it's done enough that we want people testing it. Still to do: - Make the arithmetic operations on atomic types (e.g. Atomic(int) foo = 1; foo++;) use the correct LLVM intrinsic if one exists, not a loop with a cmpxchg. - Add a signal fence builtin - Properly set the fenv state in atomic operations on floating point values - Correctly handle things like _Atomic(_Complex double) which are too large for an atomic cmpxchg on some platforms (this requires working out what 'correctly' means in this context) - Fix the many remaining corner cases llvm-svn: 148242
* Remove a redundant word.Zhongxing Xu2012-01-141-1/+1
| | | | llvm-svn: 148179
OpenPOWER on IntegriCloud