summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Initial implementation of arbitrary fixed-width integer types. Eli Friedman2009-02-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently only used for 128-bit integers. Note that we can't use the fixed-width integer types for other integer modes without other changes because glibc headers redefines (u)int*_t and friends using the mode attribute. For example, this means that uint64_t has to be compatible with unsigned __attribute((mode(DI))), and uint64_t is currently defined to long long. And I have a feeling we'll run into issues if we try to define uint64_t as something which isn't either long or long long. This doesn't get the alignment right in most cases, including the 128-bit integer case; I'll file a PR shortly. The gist of the issue is that the targets don't really expose the information necessary to figure out the alignment outside of the target description, so there's a non-trivial amount of work involved in getting it working right. That said, the alignment used is conservative, so the only issue with the current implementation is ABI compatibility. This makes it trivial to add some sort of "bitwidth" attribute to make arbitrary-width integers; I'll do that in a followup. We could also use this for stuff like the following for compatibility with gcc, but I have a feeling it would be a better idea for clang to be consistent between C and C++ modes rather than follow gcc's example for C mode. struct {unsigned long long x : 33;} x; unsigned long long a(void) {return x.x+1;} llvm-svn: 64434
* Add mangling for variadic functions and conversion functionsDouglas Gregor2009-02-131-2/+8
| | | | llvm-svn: 64425
* Add basic support for C++ name mangling according to the Itanium C++Douglas Gregor2009-02-138-18/+597
| | | | | | | | | | | | | | | | ABI to the CodeGen library. Since C++ code-generation is so incomplete, we can't exercise much of this mangling code. However, a few smoke tests show that it's doing the same thing as GCC. When C++ codegen matures, we'll extend the ABI tester to verify name-mangling as well, and complete the implementation here. At this point, the major client of name mangling is in the uses of the new "overloadable" attribute in C, which allows overloading. Any "overloadable" function in C (or in an extern "C" block in C++) will be mangled the same way that the corresponding C++ function would be mangled. llvm-svn: 64413
* Honor attribute section on static block var decls.Daniel Dunbar2009-02-121-0/+4
| | | | llvm-svn: 64411
* Fix a bug whereby, an ivar used to synthesize a property belongsFariborz Jahanian2009-02-121-4/+25
| | | | | | to a base class (nonfragile abi ir gen bug). llvm-svn: 64391
* Initial codegen for block literals. This is a work in progress. I'veMike Stump2009-02-121-6/+142
| | | | | | | | tried to put FIXMEs on the most important things to fix up. Lots left to do including more codegen, more documentation and cleaning code and style cleanups. llvm-svn: 64390
* Add a very basic implemenation of global blocks. This needs to be cleaned up.Anders Carlsson2009-02-125-13/+153
| | | | llvm-svn: 64387
* Several cleanups:Steve Naroff2009-02-121-1/+1
| | | | | | | | - rename isObjCIdType/isObjCClassType -> isObjCIdStructType/isObjCClassStructType. The previous name didn't do what you would expect. - add back isObjCIdType/isObjCClassType to do what you would expect. Not currently used, however many of the isObjCIdStructType/isObjCClassStructType clients could be converted over time. - move static Sema function areComparableObjCInterfaces to ASTContext (renamed to areComparableObjCPointerTypes, since it now operates on pointer types). llvm-svn: 64385
* Support __attribute__(section(<name>))Daniel Dunbar2009-02-121-0/+6
| | | | llvm-svn: 64380
* x86_64: Initial varargs support.Daniel Dunbar2009-02-121-1/+153
| | | | | | | | | | | | | | | | | | | | | | | | | - Doesn't yet handle case where values are passed in mixed (general purpose & floating point) registers; otherwise largely functional. Code still needs some cleaning. Fixes: MultiSource/Applications/lua/lua MultiSource/Applications/siod/siod MultiSource/Applications/sqlite3/sqlite3 SingleSource/Regression/C/PR640 SingleSource/UnitTests/2003-07-09-SignedArgs SingleSource/UnitTests/2007-03-02-VaCopy gcc compat test suite results (Darwin x86-32 & -64): -- # of expected passes 1262 # of unexpected failures 56 # of unresolved testcases 34 # of unsupported tests 2 Compare to: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090209/012050.html llvm-svn: 64370
* Add support for generating block call expressions.Anders Carlsson2009-02-123-1/+140
| | | | llvm-svn: 64346
* Use EmitVAListRef instead of EmitLValue directly to handle array decayDaniel Dunbar2009-02-114-4/+3
| | | | | | case on x86_64. llvm-svn: 64333
* Support IRgen of va_arg of structure as l-value.Daniel Dunbar2009-02-112-2/+12
| | | | llvm-svn: 64325
* ir-gen for objc's @selector expression in nonfragile abi mode.Fariborz Jahanian2009-02-111-1/+26
| | | | llvm-svn: 64323
* Silence a warning about an unused variable in -Asserts buildsDouglas Gregor2009-02-111-1/+1
| | | | llvm-svn: 64306
* Fix rdar://6518463, increment of a bool is always true, due toChris Lattner2009-02-111-0/+7
| | | | | | | subtle and non-obvious promotion rules. We already handle += and +1 correctly. llvm-svn: 64296
* finish off codegen support for sub of pointer to functions, Chris Lattner2009-02-111-2/+7
| | | | | | finishing off rdar://6520707 llvm-svn: 64295
* Handle the case where EmitBlock might be called multiple times for the same ↵Anders Carlsson2009-02-101-2/+8
| | | | | | block. Fixes PR3536. llvm-svn: 64252
* This patch is all it takes to pass all objc2's fast-enumerationFariborz Jahanian2009-02-101-1/+1
| | | | | | tests in the dejagnu test suite in the nonfragile abi mode. llvm-svn: 64251
* Pull CodeGenFunction::EmitVAArg into target specific ABIInfo classes.Daniel Dunbar2009-02-101-0/+11
| | | | | | - Missed this file. llvm-svn: 64238
* Pull CodeGenFunction::EmitVAArg into target specific ABIInfo classes.Daniel Dunbar2009-02-102-38/+55
| | | | llvm-svn: 64235
* Generate ir for ivar offset. This will passFariborz Jahanian2009-02-101-23/+42
| | | | | | | type-nsobject-attribute.m in the dejagnu test suite in the nonfragile abi mode. llvm-svn: 64233
* Some refactoring of Ivar offset code gen.Fariborz Jahanian2009-02-104-14/+60
| | | | | | in preparation for nonfragile ivar offset work. llvm-svn: 64225
* Tweak x86-64 ABI to allow reuse for vararg handling.Daniel Dunbar2009-02-101-22/+26
| | | | llvm-svn: 64221
* Remove the last remnants of the Obj-C EH stack code.Anders Carlsson2009-02-104-220/+4
| | | | llvm-svn: 64205
* Start removing the old Obj-C EH stack now that the cleanup stack is used ↵Anders Carlsson2009-02-103-78/+16
| | | | | | instead. llvm-svn: 64203
* Function parameters for PIC16 are like local variables. So use the keyword ↵Sanjiv Gupta2009-02-101-1/+1
| | | | | | ".auto." to mangle their names. The working of PIC16AsmPrinter relies on that keyword currently. llvm-svn: 64198
* Support va_arg on _Complex.Daniel Dunbar2009-02-101-0/+18
| | | | | | | | | | | gcc compat test suite results (Darwin x86-32 & -64): -- # of expected passes 1110 # of unexpected failures 74 # of unresolved testcases 168 # of unsupported tests 2 llvm-svn: 64197
* ABI: Correctly handle load/store of values which have a different LLVMDaniel Dunbar2009-02-101-21/+22
| | | | | | | | | memory representation (e.g., bool). - This upgrades (downgrades) MultiSource/Applications/ClamAV/clamscan to a miscompile and fixes SingleSource/UnitTests/2003-05-31-CastToBool. llvm-svn: 64194
* Add util Emit{LoadOf,StoreTo}Scalar methods to encapsulate conversionDaniel Dunbar2009-02-102-23/+50
| | | | | | | from LLVM memory type to/from LLVM temporary type. - No intended functionality change. llvm-svn: 64191
* Make sure to initialize local variables, even if they were ignored byDaniel Dunbar2009-02-101-0/+7
| | | | | | ABI. llvm-svn: 64187
* Use the new cleanup infrastructure for VLAs. The next iteration of patches ↵Anders Carlsson2009-02-091-2/+12
| | | | | | will remove the old Obj-C EH cleanup code. llvm-svn: 64161
* Use the new cleanup infrastructure for @try/@finallyAnders Carlsson2009-02-091-21/+17
| | | | llvm-svn: 64160
* Replace a bunch of EmitBranch calls with EmitBranchThroughCleanup. No ↵Anders Carlsson2009-02-091-5/+5
| | | | | | functionality change (yet). llvm-svn: 64159
* Save and restore the DidCallStackSave variableAnders Carlsson2009-02-091-0/+4
| | | | llvm-svn: 64157
* Add DidCallStackSave variable to CodeGenFunction.Anders Carlsson2009-02-092-0/+5
| | | | llvm-svn: 64156
* Start processing template-ids as types when the template-name refersDouglas Gregor2009-02-091-0/+1
| | | | | | | | | | | | | | | | | | | | | to a class template. For example, the template-id 'vector<int>' now has a nice, sugary type in the type system. What we can do now: - Parse template-ids like 'vector<int>' (where 'vector' names a class template) and form proper types for them in the type system. - Parse icky template-ids like 'A<5>' and 'A<(5 > 0)>' properly, using (sadly) a bool in the parser to tell it whether '>' should be treated as an operator or not. This is a baby-step, with major problems and limitations: - There are currently two ways that we handle template arguments (whether they are types or expressions). These will be merged, and, most likely, TemplateArg will disappear. - We don't have any notion of the declaration of class template specializations or of template instantiations, so all template-ids are fancy names for 'int' :) llvm-svn: 64153
* Add some more documentation. Also reflowed comments to 80 col.Mike Stump2009-02-081-226/+214
| | | | llvm-svn: 64105
* Reuse case destinations.Anders Carlsson2009-02-081-8/+27
| | | | llvm-svn: 64100
* Always check if we can remove branch fixups, even if the cleanup stack is empty.Anders Carlsson2009-02-081-17/+15
| | | | llvm-svn: 64099
* Add a simplified EmitJumpThroughFinally and use it in CGObjC in preparation ↵Anders Carlsson2009-02-082-11/+15
| | | | | | of making it use the cleanup stack. llvm-svn: 64098
* Misc fixes to the cleanup stack code.Anders Carlsson2009-02-081-1/+10
| | | | llvm-svn: 64096
* When we're at the stack depth we want, there isn't anything to do.Mike Stump2009-02-081-0/+4
| | | | llvm-svn: 64095
* Wire up break and continue processing to the new stack depth adjuster.Mike Stump2009-02-082-42/+68
| | | | | | | | If people could beat on it and let me know if there are any new semantics required by newer language standards or DRs or any little details I goofed on, I'd be happy to fix any issues found. llvm-svn: 64079
* More cleanup stack work, PopCleanupBlock now returns a struct with the ↵Anders Carlsson2009-02-082-40/+56
| | | | | | switch block and end block. llvm-svn: 64072
* Split some functions upAnders Carlsson2009-02-082-25/+50
| | | | llvm-svn: 64069
* CleanupScope needs to push the cleanup block in its destructorAnders Carlsson2009-02-082-11/+9
| | | | llvm-svn: 64068
* Implement support for branch fixups.Anders Carlsson2009-02-081-1/+71
| | | | llvm-svn: 64064
* More cleanup stack work.Anders Carlsson2009-02-082-0/+52
| | | | llvm-svn: 64059
* When emitting blocks, keep track of which cleanup scope they have. Minor ↵Anders Carlsson2009-02-083-1/+36
| | | | | | fixes and cleanup. llvm-svn: 64053
OpenPOWER on IntegriCloud