summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprConstant.cpp
Commit message (Collapse)AuthorAge
...
* Teach sema and codegen about the difference between address of labels,Chris Lattner2009-10-13
| | | | | | | | | | | which is a common idiom to improve PIC'ness of code using the addr of label extension. This implementation is a gross hack, but the only other alternative would be to teach evalutate about this horrid combination. While GCC allows things like "&&foo - &&bar + 1", people don't use this in practice. This implements PR5131. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83957 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the vtable builder to CGVtable.cpp, general cleanup.Anders Carlsson2009-10-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83798 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass the canonical method decl to GetVtableIndex. Fixes PR5120.Anders Carlsson2009-10-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83272 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle base-to-derived casts of member function pointers in CGExprConstant.cppAnders Carlsson2009-10-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83265 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle members to function pointers in CGExprConstant.Anders Carlsson2009-10-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83264 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't update the struct alignment when adding fields to a packed struct. ↵Anders Carlsson2009-10-02
| | | | | | Fixes PR5118. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83235 91177308-0d34-0410-b5e6-96231b3b80d8
* When building constant structs, check if the resulting LLVM struct will be ↵Anders Carlsson2009-10-02
| | | | | | bigger than the record layout size and use a packed struct if that's the case. Fixes PR5108. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83230 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve support for member function pointers.Anders Carlsson2009-09-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83039 91177308-0d34-0410-b5e6-96231b3b80d8
* Make clang stop relying on ConstantStruct::get's default value for isPackedNick Lewycky2009-09-19
| | | | | | | which will be going away (ie. it's becoming a required parameter) later today. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82323 91177308-0d34-0410-b5e6-96231b3b80d8
* GlobalDecl doesn't have an explicit constructor anymore.Anders Carlsson2009-09-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81481 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
* Make address-space qualification work correctly for compound literals. Eli Friedman2009-08-26
| | | | | | | | | | | | Issue reported on cfe-dev. Also fixed the code to use isConstant to determine whether to generate a constant global, to be consistent with CodeGenModule. This probably needs to be refactored to deal with C++, though. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80131 91177308-0d34-0410-b5e6-96231b3b80d8
* More member pointer work.Anders Carlsson2009-08-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79922 91177308-0d34-0410-b5e6-96231b3b80d8
* Whoops, comment this out for now. I'll fix it shortly.Anders Carlsson2009-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79806 91177308-0d34-0410-b5e6-96231b3b80d8
* More work towards zero-initializing structs that contain member pointers in ↵Anders Carlsson2009-08-23
| | | | | | constant expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79805 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle CK_NullToMemberPointer casts in the constant expr emitter.Anders Carlsson2009-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79790 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the constant expression emitter to look at the cast kind for to-union ↵Anders Carlsson2009-08-22
| | | | | | casts. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79789 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for LLVM API change.Owen Anderson2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78946 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve handling of member pointers.Anders Carlsson2009-08-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78536 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix clang breakage, CGF can be null in this context.Daniel Dunbar2009-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78269 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for LLVM API change.Owen Anderson2009-08-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78259 91177308-0d34-0410-b5e6-96231b3b80d8
* use CodeGenModule::EmitNullConstant in a couple of places.Anders Carlsson2009-08-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77915 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a minor issue with unions in the new struct building code.Eli Friedman2009-08-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77829 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the old struct builder code.Anders Carlsson2009-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77738 91177308-0d34-0410-b5e6-96231b3b80d8
* Move code from EmitUnion directly into the function that handles cast-to-union.Anders Carlsson2009-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77735 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the struct builder for unions.Anders Carlsson2009-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77732 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for LLVM API change.Owen Anderson2009-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77722 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for LLVM API change.Owen Anderson2009-07-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77514 91177308-0d34-0410-b5e6-96231b3b80d8
* Change uses of:Ted Kremenek2009-07-29
| | | | | | | | | | | | | | | | | | | | | Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsRecordType() -> Type::getAs<RecordType>() Type::getAsPointerType() -> Type::getAs<PointerType>() Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>() Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>() Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>() Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>() Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsTagType() -> Type::getAs<TagType>() And remove Type::getAsReferenceType(), etc. This change is similar to one I made a couple weeks ago, but that was partly reverted pending some additional design discussion. With Doug's pending smart pointer changes for Types, it seemed natural to take this approach. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77510 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for LLVM API change.Owen Anderson2009-07-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77492 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for LLVM API change.Owen Anderson2009-07-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77368 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for LLVM API change.Owen Anderson2009-07-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77349 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for LLVM API change.Owen Anderson2009-07-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77267 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for LLVM API change.Owen Anderson2009-07-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77249 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable the new constant struct builder by default. The old code is still in ↵Anders Carlsson2009-07-27
| | | | | | place but will be removed shortly. The new struct builder works on big endian systems. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77185 91177308-0d34-0410-b5e6-96231b3b80d8
* More work on the constant struct builder, fix a couple of thinkos and add ↵Anders Carlsson2009-07-27
| | | | | | support for inserting part of a bitfield in the previous byte. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77180 91177308-0d34-0410-b5e6-96231b3b80d8
* More work on bitfield support in the new constant struct builder.Anders Carlsson2009-07-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77177 91177308-0d34-0410-b5e6-96231b3b80d8
* More work on the constant struct builder. We can now convert the struct to a ↵Anders Carlsson2009-07-25
| | | | | | packed struct when necessary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77038 91177308-0d34-0410-b5e6-96231b3b80d8
* More work on the constant struct builder. We now try to layout all constant ↵Anders Carlsson2009-07-25
| | | | | | structs but throw away the result. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77021 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for LLVM API change.Owen Anderson2009-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77012 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a release build warning.Anders Carlsson2009-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76985 91177308-0d34-0410-b5e6-96231b3b80d8
* Check in a half finished new constant struct builder (Obviously not used yet).Anders Carlsson2009-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76969 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the LLVM field number for bit fields into the BitFieldInfo structure, ↵Anders Carlsson2009-07-23
| | | | | | since it's meaning is completely different than for non-bit fields. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76882 91177308-0d34-0410-b5e6-96231b3b80d8
* Use arrays as union padding. Also, since the resulting struct will always ↵Anders Carlsson2009-07-23
| | | | | | contain a single element and either a single i8 element or an array of i8s, there's no reason to use a packed struct. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76854 91177308-0d34-0410-b5e6-96231b3b80d8
* Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methodsTed Kremenek2009-07-17
| | | | | | | | | | until Doug Gregor's Type smart pointer code lands (or more discussion occurs). These methods just call the new Type::getAs<XXX> methods, so we still have reduced implementation redundancy. Having explicit getAsXXXType() methods makes it easier to set breakpoints in the debugger. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76193 91177308-0d34-0410-b5e6-96231b3b80d8
* Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), ↵Ted Kremenek2009-07-17
| | | | | | Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76139 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for LLVM API change, and contextify a bunch of related stuff.Owen Anderson2009-07-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75705 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for API change.Owen Anderson2009-07-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75569 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for LLVM API change.Owen Anderson2009-07-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75446 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for LLVM API change.Owen Anderson2009-07-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75028 91177308-0d34-0410-b5e6-96231b3b80d8