summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprScalar.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.Ted Kremenek2009-07-161-5/+5
| | | | | | | | | | | | | | | | | | | | | This method is intended to eventually replace the individual Type::getAsXXXType<> methods. The motivation behind this change is twofold: 1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of them are basically copy-and-paste. 2) By centralizing the implementation of the getAs<Type> logic we can more smoothly move over to Doug Gregor's proposed canonical type smart pointer scheme. Along with this patch: a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>. b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>. llvm-svn: 76098
* Update for LLVM API change, and contextify a bunch of related stuff.Owen Anderson2009-07-141-56/+63
| | | | llvm-svn: 75705
* Introduce Type::isAnyPointerType() and convert all clients (suggested by Chris).Steve Naroff2009-07-141-1/+1
| | | | | | I don't love the name, however it simplifies the code and is a worthwhile change. If/when we come up with a better name, we can do a search/replace. llvm-svn: 75650
* Rename RecordLayout.h to ASTRecordLayout.hAnders Carlsson2009-07-141-1/+0
| | | | llvm-svn: 75641
* Update for LLVM API change.Owen Anderson2009-07-131-8/+8
| | | | llvm-svn: 75446
* This patch includes a conceptually simple, but very intrusive/pervasive change. Steve Naroff2009-07-101-10/+14
| | | | | | | | | | | | The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches. This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic. By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time. Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks. llvm-svn: 75314
* reimplement vector comparisons as [fi]cmp+sext instead of using v[if]cmp.Chris Lattner2009-07-081-19/+10
| | | | | | | Also, enable them in sema so that they are tested, and now that the x86 backend has stablized. llvm-svn: 74983
* Update clang for the add ->add/fadd split. Likewise for sub and mul.Chris Lattner2009-06-171-6/+18
| | | | llvm-svn: 73604
* Use PushConditionalTempDestruction/PopConditionalTempDestruction for the ↵Anders Carlsson2009-06-041-1/+5
| | | | | | ternary operator. llvm-svn: 72842
* Use conditional temp destruction for || and &&.Anders Carlsson2009-06-041-0/+6
| | | | llvm-svn: 72838
* Add a new function for emitting new functions.Anders Carlsson2009-05-311-0/+3
| | | | llvm-svn: 72656
* Call EmitCXXExprWithTemporaries.Anders Carlsson2009-05-311-2/+1
| | | | llvm-svn: 72652
* Fixup the rest of the trivial cases of the codegen of volatile. IfMike Stump2009-05-291-29/+78
| | | | | | | any body can spot codegen bugs with volatile, or knows of any in the bug database, let me know. llvm-svn: 72572
* Functions that return references can be rvalues as well.Anders Carlsson2009-05-271-0/+3
| | | | llvm-svn: 72457
* Fixup codegen for __block int i; i += rhs();. Should also slightlyMike Stump2009-05-221-4/+5
| | | | | | improve codegen in some cases. llvm-svn: 72273
* Fixup blocks codegen for { __block i; i = rhs(); }, we want the rhsMike Stump2009-05-211-1/+3
| | | | | | | evaluated first. This can also improve codegen just a bit as we might have another register to play with for the evaluation of the rhs. llvm-svn: 72226
* Don't always zext the result of the not unary operator to an int.Anders Carlsson2009-05-191-2/+2
| | | | llvm-svn: 72117
* Have AggExprEmitter::VisitCXXConstructExpr make new variables if necessary. ↵Anders Carlsson2009-05-191-0/+5
| | | | | | Stub out VisitCXXExprWithTemporaries. llvm-svn: 72103
* Fix pointer addressing and array subscripting of Objective-C interfaceDaniel Dunbar2009-04-251-2/+29
| | | | | | | | | | | types. - I broke this in the switch to representing interfaces with opaque types. - <rdar://problem/6822660> clang crashes on subscript of interface in 32-bit mode llvm-svn: 70009
* Clang part of r69947. Reverting back 69574 as it is no longer needed.Sanjiv Gupta2009-04-241-10/+4
| | | | llvm-svn: 69949
* PR3247: Handle a couple of cases where we weren't emitting VLA sizes (and Eli Friedman2009-04-201-1/+5
| | | | | | subsequently crashed). llvm-svn: 69567
* PR3248: Make sure the evaluate the operand of a sizeof when it has a VLA type.Eli Friedman2009-04-201-0/+4
| | | | | | Adapted from patch by Tim Northover. llvm-svn: 69566
* Support code generation of 'this' exprsAnders Carlsson2009-04-141-0/+5
| | | | llvm-svn: 69050
* Make sure value is initialized when built w/o asserts.Daniel Dunbar2009-04-081-0/+1
| | | | llvm-svn: 68615
* Pointer width on targets like PIC16 is 16-bit, while the valid index size to ↵Sanjiv Gupta2009-04-081-4/+10
| | | | | | GEP is only 32 or 64. So promote index to 32 in such cases. llvm-svn: 68590
* Remove -ftrapu.Mike Stump2009-04-021-57/+28
| | | | llvm-svn: 68330
* Fixup -ftrapv to be more gcc compatible. -ftrapu (for want of aMike Stump2009-04-021-3/+17
| | | | | | | | | | better name) is the option that SmallTalk can use to intercept all overflows, including unsigned. I added some testcases so we don't break anything. Also included is another patch from David for += and friends. llvm-svn: 68267
* Add -ftrapv support, patch from David Chisnall; well all except theMike Stump2009-04-011-2/+115
| | | | | | clang option code that is and two bug fixes. llvm-svn: 68240
* Revert r68221, -ftrapv support, which causes several regressions inDouglas Gregor2009-04-011-111/+0
| | | | | | Clang's test suite. llvm-svn: 68230
* Add -ftrapv support, patch from David Chisnall; well all except theMike Stump2009-04-011-0/+111
| | | | | | clang option code that is. llvm-svn: 68221
* Trivial cleanup.Eli Friedman2009-03-281-2/+2
| | | | llvm-svn: 67899
* Misc small fixes/cleanups/comment changes.Eli Friedman2009-03-281-20/+28
| | | | llvm-svn: 67895
* Change compound assignment operators to keep track of both the promoted Eli Friedman2009-03-281-62/+17
| | | | | | | | | | | | | | | | | LHS type and the computation result type; this encodes information into the AST which is otherwise non-obvious. Fix Sema to always come up with the right answer for both of these types. Fix IRGen and the analyzer to account for these changes. This fixes PR2601. The approach is inspired by PR2601 comment 2. Note that this changes real *= complex in CodeGen from a silent miscompilation to an explicit error. I'm not really sure that the analyzer changes are correct, or how to test them... someone more familiar with the analyzer should check those changes. llvm-svn: 67889
* Fix a subtle bug in CodeGen for the increment of a bitfield.Eli Friedman2009-03-231-5/+7
| | | | llvm-svn: 67499
* fix PR3809, codegen for inc/dec of function pointers.Chris Lattner2009-03-181-3/+11
| | | | llvm-svn: 67165
* Almost complete implementation of rvalue references. One bug, and a few ↵Sebastian Redl2009-03-161-0/+1
| | | | | | unclear areas. Maybe Doug can shed some light on some of the fixmes. llvm-svn: 67059
* Back out the patch in r66302, and re-fix it properly. We assume for Eli Friedman2009-03-071-3/+0
| | | | | | | | performance that the type of the returned llvm::Value for an expression matches the converted type of the clang::Expr; mismatches will cause all sorts of errors and silent miscompilations. llvm-svn: 66321
* Codegen support for copy helpers for block literals.Mike Stump2009-03-071-2/+1
| | | | llvm-svn: 66319
* Fixed a bug where generation of read-barriers causedFariborz Jahanian2009-03-061-0/+3
| | | | | | crash in ir-gen. llvm-svn: 66302
* Minor cleanup for choose expressions: add a helper that returns the Eli Friedman2009-03-041-3/+1
| | | | | | chosen sub-expression, rather than just evaluating the condition. llvm-svn: 66018
* Attempt to fix PR3709: when converting from an integer to a pointer, Eli Friedman2009-03-041-1/+8
| | | | | | first extend the integer to the correct width. llvm-svn: 66009
* First cut CodeGen support for __block variables.Mike Stump2009-02-281-32/+3
| | | | llvm-svn: 65688
* Change the AST generated for offsetof a bit so that it looks like a Eli Friedman2009-02-271-40/+2
| | | | | | | | normal expression, and change Evaluate and IRGen to evaluate it like a normal expression. This simplifies the code significantly, and fixes PR3396. llvm-svn: 65622
* CodeGen support for copied BlockDeclRefExprs.Mike Stump2009-02-251-7/+3
| | | | llvm-svn: 65487
* first wave of fixes for @encode sema support. This is part of PR3648.Chris Lattner2009-02-241-17/+4
| | | | | | | The big difference here is that (like string literal) @encode has array type, not pointer type. llvm-svn: 65391
* Cleanp code with some recent suggestions.Mike Stump2009-02-221-7/+1
| | | | llvm-svn: 65285
* Add CodeGen support for the helper for BlockDeclRefExprs. The easierMike Stump2009-02-211-0/+45
| | | | | | stuff is mostly done. Move BlockHasCopyDispose up. llvm-svn: 65242
* More codegen for blocks. The type of block literals should be better.Mike Stump2009-02-191-4/+1
| | | | | | The size calculation is improved. llvm-svn: 64994
* rip out __builtin_overloadChris Lattner2009-02-181-6/+0
| | | | llvm-svn: 64961
* Generate the helper function for blocks. Now basic codegen isMike Stump2009-02-141-1/+1
| | | | | | starting to work for blocks. llvm-svn: 64570
OpenPOWER on IntegriCloud