summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprConstant.cpp
Commit message (Collapse)AuthorAge
* When emitting member function pointers, use the canonical decl if the member ↵Anders Carlsson2010-01-05
| | | | | | function is virtual. Fixes PR5940. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92680 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of some unnecessary code.Eli Friedman2010-01-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92432 91177308-0d34-0410-b5e6-96231b3b80d8
* Update CGExprConstant for change to emit padding values as undef.Daniel Dunbar2009-12-08
| | | | | | - This fixes 2003-05-21-BitfieldHandling. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90876 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove remaining VISIBILITY_HIDDEN from anonymous namespaces.Benjamin Kramer2009-11-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90044 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't build the entire vtable when all we want is the index of a virtual method.Anders Carlsson2009-11-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90017 91177308-0d34-0410-b5e6-96231b3b80d8
* Support emitting aggregate class initializers. Fixes PR5581.Anders Carlsson2009-11-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89569 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid assert-crash in a case where the expression passed to EmitConstantExprEli Friedman2009-11-14
| | | | | | | | legitimately has side-effects (and needs to be generated as a non-constant). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88767 91177308-0d34-0410-b5e6-96231b3b80d8
* Make __func__ and friends work correctly within the initializer for a staticEli Friedman2009-11-14
| | | | | | | | local variable. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88766 91177308-0d34-0410-b5e6-96231b3b80d8
* Obvious fix for PR5474.Eli Friedman2009-11-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88696 91177308-0d34-0410-b5e6-96231b3b80d8
* indirectbr seems to work! Rip out the old code.Chris Lattner2009-11-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86256 91177308-0d34-0410-b5e6-96231b3b80d8
* make clang emit undefs for padding of structs and unions instead of zeros. ↵Nuno Lopes2009-10-29
| | | | | | this enables constant compaction optimizations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85504 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement clang support for indirect branch and address of labelChris Lattner2009-10-28
| | | | | | | | | | using the new LLVM support for this. This is temporarily hiding behind horrible and ugly #ifdefs until the time when the optimizer is stable (hopefully a week or so). Until then, lets make it "opt in" :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85446 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate QualifiedDeclRefExpr, which captured the notion of aDouglas Gregor2009-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | qualified reference to a declaration that is not a non-static data member or non-static member function, e.g., namespace N { int i; } int j = N::i; Instead, extend DeclRefExpr to optionally store the qualifier. Most clients won't see or care about the difference (since QualifierDeclRefExpr inherited DeclRefExpr). However, this reduces the number of top-level expression types that clients need to cope with, brings the implementation of DeclRefExpr into line with MemberExpr, and simplifies and unifies our handling of declaration references. Extended DeclRefExpr to (optionally) store explicitly-specified template arguments. This occurs when naming a declaration via a template-id (which will be stored in a TemplateIdRefExpr) that, following template argument deduction and (possibly) overload resolution, is replaced with a DeclRefExpr that refers to a template specialization but maintains the template arguments as written. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84962 91177308-0d34-0410-b5e6-96231b3b80d8
* Use CK_BitCast for member function pointer casts. Fixes PR5138.Anders Carlsson2009-10-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84438 91177308-0d34-0410-b5e6-96231b3b80d8
* fix test/CodeGen/statements.c on 32-bit hosts.Chris Lattner2009-10-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84039 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify pointer creation with the new Type::getInt*Ptr methods.Benjamin Kramer2009-10-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83964 91177308-0d34-0410-b5e6-96231b3b80d8
* 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