summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprConstant.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* If a global initializer has a non-trivial destructor it can't be emitted as ↵Anders Carlsson2010-02-051-1/+10
| | | | | | a constant (even if it has a trivial constructor). llvm-svn: 95363
* Calculate offset correctly when taking the address of a virtual member function.Anders Carlsson2010-02-041-2/+5
| | | | llvm-svn: 95305
* Revert "Numerous changes to selector handling:", this breaks a whole bunch ofDaniel Dunbar2010-02-031-8/+0
| | | | | | working code, for no apparent reason. llvm-svn: 95244
* Numerous changes to selector handling:David Chisnall2010-02-031-0/+8
| | | | | | | | | | | | | | | | | | | | | | | - Don't use GlobalAliases with non-0 GEPs (GNU runtime) - this was unsupported and LLVM will be generating errors if you do it soon. This also simplifies the code generated by the GNU runtime a bit. - Make GetSelector() return a constant (GNU runtime), not a load of a store of a constant. - Recognise @selector() expressions as valid static initialisers (as GCC does). - Add methods to GCObjCRuntime to emit selectors as constants (needed for using @selector() expressions as constants. These need implementing for the Mac runtimes - I couldn't figure out how to do this, they seem to require a load. - Store an ObjCMethodDecl in an ObjCSelectorExpr so that we can get at the type information for the selector. This is needed for generating typed selectors from @selector() expressions (as GCC does). Ideally, this information should be stored in the Selector, but that would be an invasive change. We should eventually add checks for common uses of @selector() expressions. Possibly adding an attribute that can be applied to method args providing the types of a selector so, for example, you'd do something like this: - (id)performSelector: __attribute__((selector_types(id, SEL, id)))(SEL) withObject: (id)object; Then, any @selector() expressions passed to the method will be check to ensure that it conforms to this signature. We do this at run time on the GNU runtime already, but it would be nice to do it at compile time on all runtimes. - Made @selector() expressions emit type info if available and the runtime supports it. Someone more familiar with the Mac runtime needs to implement the GetConstantSelector() function in CGObjCMac. This currently just assert()s. llvm-svn: 95189
* Use the Arg variable rather than re-computing it. This also silences GCC'sChandler Carruth2010-02-021-1/+1
| | | | | | unused variable warning. llvm-svn: 95085
* Codegen CXXConstructExprs with trivial constructors as constants.John McCall2010-02-021-0/+23
| | | | | | Eliminates a lot of spurious global initializers, fixing PR6205. llvm-svn: 95077
* Improve handling of emitting 'null' pointers to data members.Anders Carlsson2010-02-021-28/+58
| | | | llvm-svn: 95066
* Move pointer to data member emission to CodeGenModule and use it in ↵Anders Carlsson2010-02-021-8/+32
| | | | | | CGExprConstant. Fixes PR5674. llvm-svn: 95063
* Some class related cleanup.Anders Carlsson2010-01-311-2/+2
| | | | llvm-svn: 94938
* Created __builtin___NSStringMakeConstantString() builtin, which generates ↵David Chisnall2010-01-231-3/+11
| | | | | | constant Objective-C strings. llvm-svn: 94274
* Convert the type of the LValue offset variable in APValue to CharUnits, movingKen Dyck2010-01-151-1/+1
| | | | | | the LValue-related methods of APValue out of line to avoid header file leaching. llvm-svn: 93512
* When emitting member function pointers, use the canonical decl if the member ↵Anders Carlsson2010-01-051-0/+2
| | | | | | function is virtual. Fixes PR5940. llvm-svn: 92680
* Get rid of some unnecessary code.Eli Friedman2010-01-021-27/+2
| | | | llvm-svn: 92432
* Update CGExprConstant for change to emit padding values as undef.Daniel Dunbar2009-12-081-1/+5
| | | | | | - This fixes 2003-05-21-BitfieldHandling. llvm-svn: 90876
* Remove remaining VISIBILITY_HIDDEN from anonymous namespaces.Benjamin Kramer2009-11-281-4/+2
| | | | llvm-svn: 90044
* Don't build the entire vtable when all we want is the index of a virtual method.Anders Carlsson2009-11-271-2/+3
| | | | llvm-svn: 90017
* Support emitting aggregate class initializers. Fixes PR5581.Anders Carlsson2009-11-211-1/+1
| | | | llvm-svn: 89569
* Avoid assert-crash in a case where the expression passed to EmitConstantExprEli Friedman2009-11-141-3/+1
| | | | | | legitimately has side-effects (and needs to be generated as a non-constant). llvm-svn: 88767
* Make __func__ and friends work correctly within the initializer for a staticEli Friedman2009-11-141-6/+8
| | | | | | local variable. llvm-svn: 88766
* Obvious fix for PR5474.Eli Friedman2009-11-131-1/+1
| | | | llvm-svn: 88696
* indirectbr seems to work! Rip out the old code.Chris Lattner2009-11-061-8/+0
| | | | llvm-svn: 86256
* make clang emit undefs for padding of structs and unions instead of zeros. ↵Nuno Lopes2009-10-291-3/+3
| | | | | | this enables constant compaction optimizations. llvm-svn: 85504
* Implement clang support for indirect branch and address of labelChris Lattner2009-10-281-0/+6
| | | | | | | | 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" :) llvm-svn: 85446
* Eliminate QualifiedDeclRefExpr, which captured the notion of aDouglas Gregor2009-10-231-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 84962
* Use CK_BitCast for member function pointer casts. Fixes PR5138.Anders Carlsson2009-10-181-1/+5
| | | | llvm-svn: 84438
* fix test/CodeGen/statements.c on 32-bit hosts.Chris Lattner2009-10-131-1/+12
| | | | llvm-svn: 84039
* Simplify pointer creation with the new Type::getInt*Ptr methods.Benjamin Kramer2009-10-131-2/+1
| | | | llvm-svn: 83964
* Teach sema and codegen about the difference between address of labels,Chris Lattner2009-10-131-1/+22
| | | | | | | | | | 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. llvm-svn: 83957
* Move the vtable builder to CGVtable.cpp, general cleanup.Anders Carlsson2009-10-111-1/+1
| | | | llvm-svn: 83798
* Pass the canonical method decl to GetVtableIndex. Fixes PR5120.Anders Carlsson2009-10-031-1/+1
| | | | llvm-svn: 83272
* Handle base-to-derived casts of member function pointers in CGExprConstant.cppAnders Carlsson2009-10-031-0/+37
| | | | llvm-svn: 83265
* Handle members to function pointers in CGExprConstant.Anders Carlsson2009-10-031-0/+43
| | | | llvm-svn: 83264
* Don't update the struct alignment when adding fields to a packed struct. ↵Anders Carlsson2009-10-021-1/+6
| | | | | | Fixes PR5118. llvm-svn: 83235
* When building constant structs, check if the resulting LLVM struct will be ↵Anders Carlsson2009-10-021-38/+59
| | | | | | bigger than the record layout size and use a packed struct if that's the case. Fixes PR5108. llvm-svn: 83230
* Improve support for member function pointers.Anders Carlsson2009-09-291-2/+9
| | | | llvm-svn: 83039
* Make clang stop relying on ConstantStruct::get's default value for isPackedNick Lewycky2009-09-191-2/+4
| | | | | | which will be going away (ie. it's becoming a required parameter) later today. llvm-svn: 82323
* GlobalDecl doesn't have an explicit constructor anymore.Anders Carlsson2009-09-101-1/+1
| | | | llvm-svn: 81481
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-135/+135
| | | | llvm-svn: 81346
* Make address-space qualification work correctly for compound literals. Eli Friedman2009-08-261-2/+3
| | | | | | | | | | 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. llvm-svn: 80131
* More member pointer work.Anders Carlsson2009-08-241-5/+11
| | | | llvm-svn: 79922
* Whoops, comment this out for now. I'll fix it shortly.Anders Carlsson2009-08-231-0/+2
| | | | llvm-svn: 79806
* More work towards zero-initializing structs that contain member pointers in ↵Anders Carlsson2009-08-231-0/+8
| | | | | | constant expressions. llvm-svn: 79805
* Handle CK_NullToMemberPointer casts in the constant expr emitter.Anders Carlsson2009-08-231-0/+2
| | | | llvm-svn: 79790
* Change the constant expression emitter to look at the cast kind for to-union ↵Anders Carlsson2009-08-221-14/+19
| | | | | | casts. llvm-svn: 79789
* Update for LLVM API change.Owen Anderson2009-08-131-11/+14
| | | | llvm-svn: 78946
* Improve handling of member pointers.Anders Carlsson2009-08-091-2/+22
| | | | llvm-svn: 78536
* Fix clang breakage, CGF can be null in this context.Daniel Dunbar2009-08-061-1/+1
| | | | llvm-svn: 78269
* Update for LLVM API change.Owen Anderson2009-08-051-5/+8
| | | | llvm-svn: 78259
* use CodeGenModule::EmitNullConstant in a couple of places.Anders Carlsson2009-08-021-1/+1
| | | | llvm-svn: 77915
* Fix a minor issue with unions in the new struct building code.Eli Friedman2009-08-011-2/+5
| | | | llvm-svn: 77829
OpenPOWER on IntegriCloud