summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Support for code generation of Objective-C top-level language constructs.Anton Korobeynikov2008-06-018-44/+1027
| | | | | | Implemented by David Chisnall! llvm-svn: 51835
* Tweak Sema::ObjCQualifiedIdTypesAreCompatible() to handle qualified ↵Steve Naroff2008-06-011-5/+24
| | | | | | | | | | interface types on the RHS. This eliminates a bogus warning identified in the test below. This fixes <rdar://problem/5968256> clang on xcode: error: incompatible type initializing 'NSObject<XCSelectionSource> *', expected 'id<NSObject,XCSelectionSource>' llvm-svn: 51832
* Teach Sema::CheckConditionalOperands() to check for ObjCQualifiedIdType's. ↵Steve Naroff2008-05-311-1/+7
| | | | | | | | This fixes a bogus error. <rdar://problem/5967036> clang on xcode: error: incompatible operand types ('id<DTOutputStreams>' and 'DTFilterOutputStream *') llvm-svn: 51828
* Calculate alignment for local variables.Eli Friedman2008-05-311-2/+6
| | | | llvm-svn: 51826
* Added "InitializeTU" to ASTConsumer. This is used by Sema::ParseAST to pass aTed Kremenek2008-05-312-1/+7
| | | | | | | | | | | TranslationUnit object instead of an ASTContext. By default it calls Initialize(ASTConstext& Context) (to match with the current interface used by most ASTConsumers). Modified the ObjC-Rewriter to use InitializeTU, and to tell the TranslationUnit to not free its Decls. This is a workaround for: <rdar://problem/5966749> llvm-svn: 51825
* Fix <rdar://problem/5965704> clang: bad receiver type 'id const'Steve Naroff2008-05-311-2/+3
| | | | llvm-svn: 51809
* Teach Expr::isLvalue() about ObjC properties. For now, all properties are ↵Steve Naroff2008-05-301-0/+2
| | | | | | writable. Added a FIXME for another day. llvm-svn: 51800
* PR1893: Fix up the type of tentative definitions of incomplete array Eli Friedman2008-05-301-2/+22
| | | | | | types so that they end up the correct size. llvm-svn: 51787
* Fix and enable generating general union initializers. Essentially, what Eli Friedman2008-05-301-9/+26
| | | | | | | | | | | | this does is reconstruct the type for structs and arrays if the type wouldn't be compatible otherwise. The assertion about packing in the struct type reconstruction code sucks, but I don't see any obvious way to fix it. Maybe we need a general utility method to take a list of types and alignments and try to construct an unpacked type if possible? llvm-svn: 51785
* Allow the type of a global to be different from the type of its Eli Friedman2008-05-301-69/+62
| | | | | | | | | | | | | | | | | associated declaration. This is a prerequisite to handling general union initializations; for example, an array of unions involving pointers has to be turned into a struct because the elements can have incompatible types. I refactored the code a bit to make it more readable; now, the logic for definitions is all in EmitGlobalVarInit. The second parameter for GetAddrOfGlobalVar is now dead; I'll remove it separately. By itself, this patch should not cause any visible changes. llvm-svn: 51783
* Allow a pointer implicitly cast to a bool as a constant expression, as Eli Friedman2008-05-301-17/+34
| | | | | | | | | | required by the standard (the standard doesn't know anything about implicit casts). Disallow pointers cast to non-integral arithmetic types as constant expressions. This was previously allowed by accident. llvm-svn: 51779
* Make sure to allow assigning a pointer to a bool.Eli Friedman2008-05-301-11/+14
| | | | llvm-svn: 51778
* Fix some strict-aliasing warnings by using Stmt* instead of Expr* in ↵Ted Kremenek2008-05-301-3/+3
| | | | | | VariableArrayType, EnumConstantDecl, and VarDecl. llvm-svn: 51772
* Fix constant vector init for initializer lists with an incomplete list Eli Friedman2008-05-301-6/+9
| | | | | | of elements. llvm-svn: 51769
* Always check that the definition of a function has the correct type. Eli Friedman2008-05-301-1/+1
| | | | | | This fixes a crash on the included testcase (found in NetHack). llvm-svn: 51767
* Emit parameter and local variable debug information with -g.Sanjiv Gupta2008-05-303-3/+78
| | | | llvm-svn: 51765
* Add FIXME to CodeGen struct layout.Eli Friedman2008-05-301-1/+5
| | | | llvm-svn: 51764
* Some additions to constant initializer generation code. Adds Eli Friedman2008-05-301-28/+132
| | | | | | | | | | | | | | bit-field initialization; ugly code, X86-only, but it works, at least for basic stuff. Separates/adds union initialization; currently disabled, though, because the struct/array code needs modifications to support elements of the wrong type. Fixes PR2381 and PR2309 with the bit-field initialization. And NetHack compiles and appears to work with a few tweaks (to work around the lack of transparent_union support, and clang being a bit strict about conflicting declarations). llvm-svn: 51763
* Cleanup/refactoring of Sema struct layout. This patch unifies the structEli Friedman2008-05-301-98/+79
| | | | | | | | | | and union codepaths and fixes some minor bugs. I'm reasonably confident this is accurate, at least for X86. I'll correct any bugs as I find them; I haven't found any for a while, though. llvm-svn: 51762
* Add basic support for properties references (a missing feature).Steve Naroff2008-05-304-0/+62
| | | | | | While it is far from complete, it does fix the following <rdar://problem/5967199> clang on xcode: error: member reference is not to a structure or union llvm-svn: 51719
* Fix one strict-aliasing warning.Ted Kremenek2008-05-291-8/+8
| | | | llvm-svn: 51707
* - Move ObjC Expresssion AST's from Expr.h => ExprObjC.hSteve Naroff2008-05-2910-4/+10
| | | | | | - #include ExprObjC.h in many places llvm-svn: 51703
* Implement support for -w, which silences all warnings. PR2384.Chris Lattner2008-05-291-4/+9
| | | | llvm-svn: 51683
* More complete/correct implementation of the comparison operators for Eli Friedman2008-05-291-7/+47
| | | | | | constant expressions. llvm-svn: 51682
* Fix an extremely subtle bug with pointer comparisons: they have to be Eli Friedman2008-05-291-4/+4
| | | | | | | unsigned because it's possible (at least in theory) to have have both positive and negative pointers pointing to the same object. llvm-svn: 51681
* Rearrange EmitLValueForField a bit to work properly for _Bool bitfields Eli Friedman2008-05-291-10/+9
| | | | | | | in unions (we don't want to do the union-specific bitcast for bit-fields). llvm-svn: 51678
* Add codegen support for a few more kinds of initializer constant Eli Friedman2008-05-291-0/+35
| | | | | | expressions. llvm-svn: 51677
* Add CodeGen support for alignment on globals, both for unusual natural Eli Friedman2008-05-291-0/+6
| | | | | | alignment and alignment attributes. llvm-svn: 51676
* A couple minor fixes to make debug info usable for arbitrary code: don't Eli Friedman2008-05-292-1/+8
| | | | | | | | emit incomplete types, because they crash llc, and always use the logical location as the current location so we don't crash doing invalid queries on CurLoc. llvm-svn: 51675
* Tentative declarations are supposed to have common linkage, not weak. Eli Friedman2008-05-291-1/+1
| | | | | | This change makes clang generate the same thing as llvm-gcc. llvm-svn: 51674
* Always use packed structs. This isn't really very nice, but there's Eli Friedman2008-05-291-9/+2
| | | | | | | | | | | | | nothing fundamentally wrong with it. Emitting unpacked structs where possible is more work for almost no practical benefit. We'll probably want to fix it at some point anyway, but it's low priority. The issue with long double in particular is that LLVM thinks an X86 long double is 10 bytes, while clang considers it for all purposes to be either 12 or 16 bytes, depending on the platform, even in a packed struct. llvm-svn: 51673
* Implementation of stdarg.h.Eli Friedman2008-05-291-0/+39
| | | | llvm-svn: 51672
* Fix rewrite rope to keep the leaf list up-to-date as it erases leavesChris Lattner2008-05-281-5/+27
| | | | | | from the rope. rdar://5952468 llvm-svn: 51651
* add an assertionChris Lattner2008-05-281-0/+1
| | | | llvm-svn: 51645
* Fix a couple crashes on invalid input.Chris Lattner2008-05-271-1/+2
| | | | llvm-svn: 51622
* Check first member alignment and uses packed struct if required.Devang Patel2008-05-271-0/+2
| | | | llvm-svn: 51619
* A few more cases for aggregate values.Eli Friedman2008-05-271-0/+10
| | | | llvm-svn: 51596
* Implementation of __builtin_ctlz.Eli Friedman2008-05-271-0/+14
| | | | llvm-svn: 51595
* Assume statement expressions have side effects; this gets rid of a lot Eli Friedman2008-05-271-2/+5
| | | | | | of extra warnings in the Python source. llvm-svn: 51594
* The cache is working again; re-enable it.Eli Friedman2008-05-271-3/+0
| | | | llvm-svn: 51587
* Get the type right for wide string literals; it's wchar_t, not char.Eli Friedman2008-05-271-1/+1
| | | | llvm-svn: 51586
* Add FIXME.Eli Friedman2008-05-271-0/+1
| | | | llvm-svn: 51585
* Don't swap function decls, and add them to the scope as they are Eli Friedman2008-05-272-64/+1
| | | | | | | | | | | | | encountered. Mixing up the decls is unintuitive, and confuses the AST destruction code. Fixes PR2360. Note that there is a need to look up the characteristics and declarations of a function associated with a particular name or decl, but the original swapping code doesn't solve it properly. http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-May/001644.html is one suggestion for how to fix that. llvm-svn: 51584
* Add a more reliable check for whether a static declaration has already Eli Friedman2008-05-271-17/+12
| | | | | | | been used. In preparation for the fix to PR2360, but also a minor bug in its own right. llvm-svn: 51583
* Stop leaking the main Sema object. (Leak found using valgrind.)Eli Friedman2008-05-271-2/+3
| | | | llvm-svn: 51580
* Stop leaking the target data. (Leak found with valgrind.)Eli Friedman2008-05-271-0/+1
| | | | llvm-svn: 51579
* Generalize the float type generation code, and specifically fix the Eli Friedman2008-05-271-5/+19
| | | | | | codegen of X86 long double. llvm-svn: 51578
* Implementation of gcc mode attribute; this is significant because Eli Friedman2008-05-274-1/+143
| | | | | | | | | | it fixes PR2204. Not too much to say about the implementation; it works in a similar way to the vector size attribute. At some point, we need to modify the targets to provide information about the appropriate types. llvm-svn: 51577
* Rewrite struct/union layout. This is mostly cleanup; this might also fix Eli Friedman2008-05-271-192/+80
| | | | | | | | | a few bugs, but I don't know of any in particular. This has good effects besides cleanup, though: it also should make it easier to implement the aligned and packed attributes, and also target-specific struct layouts, because the code won't have to be duplicated in codegen. llvm-svn: 51576
* Stop leaking the TUDecl.Eli Friedman2008-05-271-0/+2
| | | | llvm-svn: 51575
OpenPOWER on IntegriCloud