summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprConstant.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* After some discussion with Doug, we decided that it made a lot more senseJohn McCall2011-04-121-2/+0
| | | | | | | | | for __unknown_anytype resolution to destructively modify the AST. So that's what it does now, which significantly simplifies some of the implementation. Normal member calls work pretty cleanly now, and I added support for propagating unknown-ness through &. llvm-svn: 129331
* More __unknown_anytype work.John McCall2011-04-111-0/+1
| | | | llvm-svn: 129269
* Remove CK_DynamicToNull.Anders Carlsson2011-04-111-1/+0
| | | | llvm-svn: 129265
* As a first step towards fixing PR9641, add a CK_DynamicToNull cast kind whichAnders Carlsson2011-04-101-0/+1
| | | | | | | | | | | | | | | | | | represents a dynamic cast where we know that the result is always null. For example: struct A { virtual ~A(); }; struct B final : A { }; struct C { }; bool f(B* b) { return dynamic_cast<C*>(b); } llvm-svn: 129256
* Basic, untested implementation for an "unknown any" type requested by LLDB.John McCall2011-04-071-0/+1
| | | | | | | | | | | | The idea is that you can create a VarDecl with an unknown type, or a FunctionDecl with an unknown return type, and it will still be valid to access that object as long as you explicitly cast it at every use. I'm still going back and forth about how I want to test this effectively, but I wanted to go ahead and provide a skeletal implementation for the LLDB folks' benefit and because it also improves some diagnostic goodness for placeholder expressions. llvm-svn: 129065
* supported: AltiVec vector initialization with a single literal according to ↵Anton Yartsev2011-03-271-6/+23
| | | | | | PIM section 2.5.1 - after initialization all elements have the value specified by the literal llvm-svn: 128375
* Eliminate some literal '8's in FillInNullDataMemberPointers() by switchingKen Dyck2011-03-221-5/+6
| | | | | | to CharUnits. No change in functionality intended. llvm-svn: 128047
* Use CharUnits's new increment operator. No change in functionality intended.Ken Dyck2011-03-191-2/+2
| | | | llvm-svn: 127938
* Replace literal '8's with CharWidth in AppendBitField. No change inKen Dyck2011-03-191-13/+15
| | | | | | functionality intended. llvm-svn: 127927
* Add support for language-specific address spaces. On top of that,Peter Collingbourne2011-03-181-1/+1
| | | | | | | | | add support for the OpenCL __private, __local, __constant and __global address spaces, as well as the __read_only, _read_write and __write_only image access specifiers. Patch originally by ARM; language-specific address space support by myself. llvm-svn: 127915
* Convert alignment values to CharUnits. No change in functionality intended.Ken Dyck2011-03-181-18/+18
| | | | llvm-svn: 127848
* Convert getSizeInBytes() to getSizeInChars(), which returns its result inKen Dyck2011-03-181-9/+10
| | | | | | CharUnits. No change in functionality intended. llvm-svn: 127846
* Convert variables to CharUnits in ConvertStructToPacked(). No change inKen Dyck2011-03-181-12/+12
| | | | | | functionality intended. llvm-svn: 127844
* Convert NextOffsetInBytes to CharUnits and rename to NextOffsetInChars. NoKen Dyck2011-03-171-36/+40
| | | | | | change in functionality intended. llvm-svn: 127787
* Politely inform GCC that we will never fall off the end of that switch.Matt Beaumont-Gay2011-03-171-0/+1
| | | | llvm-svn: 127783
* Reorganize the emission of (unfoldable) constant casts a bit, andJohn McCall2011-03-151-36/+97
| | | | | | | make sure that upcasts of member pointer types are covered as constants. Fixed rdar://problem/9130221 llvm-svn: 127702
* Introduce a CharUnits FieldOffsetInChars variable in AppendField() toKen Dyck2011-03-151-3/+7
| | | | | | | | replace some uses of FieldOffsetInBytes. The remaining uses of FieldOffsetInBytes will be replaced once NextFieldOffsetInBytes is converted to CharUnits. No change in functionality intended. llvm-svn: 127641
* Use CharUnits for argument passed to AppendPadding() from AppendBitField().Ken Dyck2011-03-121-5/+6
| | | | | | No change in functionality intended. llvm-svn: 127538
* Change parameter to AppendPadding from bytes to CharUnits. No change inKen Dyck2011-03-111-11/+11
| | | | | | functionality intended. llvm-svn: 127513
* Convert the RecordSize parameter of AppendTailPadding() to CharUnits toKen Dyck2011-03-111-8/+6
| | | | | | | avoid converting to bits and back again. No change in functionality intended. llvm-svn: 127455
* Only emit string initializers in-place if types match. Fixes PR9373.Benjamin Kramer2011-03-021-1/+1
| | | | llvm-svn: 126883
* improve support for big endian targets, fixing PR8171, patchChris Lattner2011-02-171-1/+1
| | | | | | by Heikki Kultala! llvm-svn: 125784
* Perform zero-initialization of virtual base classes when emitting John McCall2011-02-151-62/+97
| | | | | | | | | | | | a zero constant for a complete class. rdar://problem/8424975 To make this happen, track the field indexes for virtual bases in the complete object. I'm curious whether we might be better off making CGRecordLayoutBuilder *much* more reliant on ASTRecordLayout; we're currently duplicating an awful lot of the ABI layout logic. llvm-svn: 125555
* update for ConstantVector API change.Chris Lattner2011-02-151-1/+1
| | | | llvm-svn: 125538
* revert my ConstantVector patch, it seems to have made the llvm-gccChris Lattner2011-02-141-1/+1
| | | | | | builders unhappy. llvm-svn: 125505
* update for ConstantVector::get API change.Chris Lattner2011-02-141-1/+1
| | | | llvm-svn: 125488
* Add a helper function, ASTContext::toBits(), that converts sizes inKen Dyck2011-02-111-2/+1
| | | | | | | CharUnits to sizes in bits, and use it to tidy up the places where the conversion was done explicitly. llvm-svn: 125332
* Convert RecordLayout::Size to CharUnits from bits. No changes toKen Dyck2011-02-091-3/+4
| | | | | | functionality intended. llvm-svn: 125156
* More capturing of 'this': implicit member expressions. Getting thatJohn McCall2011-02-031-13/+38
| | | | | | | | | | | right for anonymous struct/union members led to me discovering some seemingly broken code in that area of Sema, which I fixed, partly by changing the representation of member pointer constants so that IndirectFieldDecls aren't expanded. This led to assorted cleanups with member pointers in CodeGen, and while I was doing that I saw some random other things to clean up. llvm-svn: 124785
* PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() andJay Foad2010-12-071-16/+12
| | | | | | | | zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method trunc(), to be const and to return a new value instead of modifying the object in place. llvm-svn: 121121
* Refactor the null-initialization for record types and make it handle bases ↵Anders Carlsson2010-11-221-75/+85
| | | | | | that aren't i8 arrays. llvm-svn: 119980
* Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a ↵Anders Carlsson2010-10-311-1/+1
| | | | | | getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset. llvm-svn: 117881
* Death to blocks, or at least the word "block" in one particular obnoxiouslyJohn McCall2010-10-151-1/+1
| | | | | | ambiguous context. llvm-svn: 116567
* Teach IR generation to return 'this' from constructors and destructorsJohn McCall2010-08-311-0/+1
| | | | | | under the ARM ABI. llvm-svn: 112588
* GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall2010-08-251-4/+4
| | | | | | to the new constants. llvm-svn: 112047
* Abstract out everything having to do with member pointers into the ABIJohn McCall2010-08-231-47/+6
| | | | | | | | | | | class; they should just be completely opaque throughout IR gen now, although I haven't really audited that. Fix a bug apparently inherited from gcc-4.2 where we failed to null-check member data pointers when performing derived-to-base or base-to-derived conversions on them. llvm-svn: 111789
* Go back to asking CodeGenTypes whether a type is zero-initializable.John McCall2010-08-221-7/+5
| | | | | | | | | Make CGT defer to the ABI on all member pointer types. This requires giving CGT a handle to the ABI. It's way easier to make that work if we avoid lazily creating the ABI. Make it so. llvm-svn: 111786
* Experiment with using first-class aggregates to represent member functionJohn McCall2010-08-221-5/+13
| | | | | | | | | | pointers. I find the resulting code to be substantially cleaner, and it makes it very easy to use the same APIs for data member pointers (which I have conscientiously avoided here), and it avoids a plethora of potential inefficiencies due to excessive memory copying, but we'll have to see if it actually works. llvm-svn: 111776
* Abstract out member-pointer creation. I'm really unhappy about the currentJohn McCall2010-08-221-16/+1
| | | | | | | | duplication between the constant and non-constant paths in all of this. Implement ARM ABI semantics for member pointer constants and conversion. llvm-svn: 111772
* Abstract more member-pointerness out.John McCall2010-08-221-37/+14
| | | | llvm-svn: 111771
* Detabify.Eli Friedman2010-08-221-1/+1
| | | | llvm-svn: 111768
* IRgen: Eliminate EmitPredefinedFunctionName(), it doesn't need to be ↵Daniel Dunbar2010-08-211-1/+1
| | | | | | factored out. llvm-svn: 111715
* Store inheritance paths after CastExprs instead of inside them.John McCall2010-08-071-1/+3
| | | | | | | | | | | | | | | This takes some trickery since CastExpr has subclasses (and indeed, is abstract). Also, smoosh the CastKind into the bitfield from Expr. Drops two words of storage from Expr in the common case of expressions which don't need inheritance paths. Avoids a separate allocation and another word of overhead in cases needing inheritance paths. Also has the advantage of not leaking memory, since destructors for AST nodes are never run. llvm-svn: 110507
* Fix crash initializing a bit-field with a non-constant in a place where weEli Friedman2010-07-171-4/+3
| | | | | | try to evaluate the initializer as a constant. llvm-svn: 108632
* fix PR7564 a cast where the bitfield struct init codeChris Lattner2010-07-051-4/+31
| | | | | | wasn't handling array padding elements right. llvm-svn: 107621
* AppendBitField really can never fail, so return its return value. Chris Lattner2010-07-051-14/+8
| | | | | | Everyone knows that no bugs are ever possible with bitfields. llvm-svn: 107620
* use more efficient type comparison predicates.Chris Lattner2010-06-261-2/+2
| | | | llvm-svn: 106958
* Don't try to explicitly zero out bit-fields.Anders Carlsson2010-06-031-0/+5
| | | | llvm-svn: 105391
* Fix for PR7040: Don't try to compute the LLVM type for a function where itEli Friedman2010-05-301-23/+1
| | | | | | | | | | | isn't possible to compute. This patch is mostly refactoring; the key change is the addition of the code starting with the comment, "Check whether the function has a computable LLVM signature." The solution here is essentially the same as the way the vtable code handles such functions. llvm-svn: 105151
* When null-initializing bases with data member pointers, don't assert on ↵Anders Carlsson2010-05-271-2/+10
| | | | | | virtual bases. Just initialize them to null. llvm-svn: 104868
OpenPOWER on IntegriCloud