summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement support for variable length arrays in C++. VLAs are limitedDouglas Gregor2010-05-222-9/+34
| | | | | | | | | | | | | in several important ways: - VLAs of non-POD types are not permitted. - VLAs cannot be used in conjunction with C++ templates. These restrictions are intended to keep VLAs out of the parts of the C++ type system where they cause the most trouble. Fixes PR5678 and <rdar://problem/8013618>. llvm-svn: 104443
* Improve our handling of reference binding for subobjects ofDouglas Gregor2010-05-224-25/+52
| | | | | | | | | | | | | | | | | | | | | | | | | temporaries. There are actually several interrelated fixes here: - When converting an object to a base class, it's only an lvalue cast when the original object was an lvalue and we aren't casting pointer-to-derived to pointer-to-base. Previously, we were misclassifying derived-to-base casts of class rvalues as lvalues, causing various oddities (including problems with reference binding not extending the lifetimes of some temporaries). - Teach the code for emitting a reference binding how to look through no-op casts and parentheses directly, since Expr::IgnoreParenNoOpCasts is just plain wrong for this. Also, make sure that we properly look through multiple levels of indirection from the temporary object, but destroy the actual temporary object; this fixes the reference-binding issue mentioned above. - Teach Objective-C message sends to bind the result as a temporary when needed. This is actually John's change, but it triggered the reference-binding problem above, so it's included here. Now John can actually test his return-slot improvements. llvm-svn: 104434
* Attempt to make MSVC happy.Daniel Dunbar2010-05-221-1/+1
| | | | llvm-svn: 104432
* Daniel re-educated me about what Alias does and does not do. Turn that off forChandler Carruth2010-05-221-0/+8
| | | | | | | | '-fasm' and explicitly map from that flag to -fgnu-keywords in the driver. Turn off the driver in the lexer test for this madness and add a test to the driver that the translation actually works. llvm-svn: 104428
* Push a return-value slot throughout ObjC message-send codegen. Will beJohn McCall2010-05-226-33/+66
| | | | | | | critical for ObjC++ correctness; hard to test independently of various required Sema changes, though. llvm-svn: 104422
* Driver: When printing a "command was signalled" type of diagnostic, use theDaniel Dunbar2010-05-221-19/+22
| | | | | | | | | | | short name of the tool in use, instead of the name of the action that created the command. The practical impact is we now get: clang: error: clang frontend command failed due to signal 6 (use -v to see invocation) instead of: clang: error: assembler command failed due to signal 6 (use -v to see invocation) when clang crashes on a job that uses the integrated assembler. llvm-svn: 104417
* Driver: Add Tool::ShortName, intended to be a human readable name for the tool.Daniel Dunbar2010-05-222-25/+42
| | | | llvm-svn: 104416
* Improve recovery when we see a dependent template name that is missingDouglas Gregor2010-05-213-1/+32
| | | | | | | | | | | | | | | the required "template" keyword, using the same heuristics we do for dependent template names in member access expressions, e.g., test/SemaTemplate/dependent-template-recover.cpp:11:8: error: use 'template' keyword to treat 'getAs' as a dependent template name T::getAs<U>(); ^ template Fixes PR5404. llvm-svn: 104409
* Clang missing warning about conflicting declaration vs. definition Fariborz Jahanian2010-05-211-0/+4
| | | | | | for variable arguments list methods. (radar 8006060). llvm-svn: 104407
* Improve parser recovery when we encounter a dependent template nameDouglas Gregor2010-05-218-18/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that is missing the 'template' keyword, e.g., t->getAs<T>() where getAs is a member of an unknown specialization. C++ requires that we treat "getAs" as a value, but that would fail to parse since T is the name of a type. We would then fail at the '>', since a type cannot be followed by a '>'. This is a very common error for C++ programmers to make, especially since GCC occasionally allows it when it shouldn't (as does Visual C++). So, when we are in this case, we use tentative parsing to see if the tokens starting at "<" can only be parsed as a template argument list. If so, we produce a diagnostic with a fix-it that states that the 'template' keyword is needed: test/SemaTemplate/dependent-template-recover.cpp:5:8: error: 'template' keyword is required to treat 'getAs' as a dependent template name t->getAs<T>(); ^ template This is just a start of this patch; I'd like to apply the same approach to everywhere that a template-id with dependent template name can be parsed. llvm-svn: 104406
* Unbreak self-host.Anders Carlsson2010-05-217-30/+13
| | | | llvm-svn: 104390
* Update retain-release checker to understand changes to how 'super' is ↵Ted Kremenek2010-05-211-7/+51
| | | | | | | | represented in the ASTs. Fixes <rdar://problem/8015556>. llvm-svn: 104389
* Pass around an error SourceRange instead of an Expr* when reporting errorsTed Kremenek2010-05-211-10/+10
| | | | | | in the Objective-C memory checker. llvm-svn: 104388
* Rename CodeGenFunction::EmitMemSetToZero to EmitNullInitialization. Handle ↵Anders Carlsson2010-05-217-13/+30
| | | | | | setting null data member pointers correctly. Fixes PR7139. llvm-svn: 104387
* When instantiating a function declaration within a function template,Douglas Gregor2010-05-211-0/+1
| | | | | | | be sure to merge its parameter scope with its parent's scope. Fixes PR7184. llvm-svn: 104386
* Improved TypeLoc::getSourceRange().Abramo Bagnara2010-05-211-0/+36
| | | | llvm-svn: 104382
* Propagate access specifiers to anonymous union members nested within classes.John McCall2010-05-217-20/+31
| | | | | | Fixes <rdar://problem/7987650>. llvm-svn: 104376
* Fix crash in CFG construction for 'break' statements appearing in statement ↵Ted Kremenek2010-05-211-7/+8
| | | | | | | | expressions within the increment code of a for loop. llvm-svn: 104375
* Use CanQualType to enforce the use of a canonical type argument toDouglas Gregor2010-05-213-5/+4
| | | | | | | CXXBasePaths::isAmbiguous(), rather than just asserting that we have a canonical type. Fixes PR7176. llvm-svn: 104374
* don't make _Bool be a keyword in -fms-extensions mode, patch byChris Lattner2010-05-211-1/+3
| | | | | | Steven Watanabe! llvm-svn: 104373
* Try to fix MSVC build.Benjamin Kramer2010-05-211-0/+1
| | | | llvm-svn: 104371
* Don't remove the break/continue scope of a for loop until after we'veDouglas Gregor2010-05-211-4/+2
| | | | | | | | emitted the increment expression. Fixes PR7189. If someone knows how to write a useful test for this, I'd be grateful. llvm-svn: 104335
* When generating the call arguments in a thunk to call the thunkee, doDouglas Gregor2010-05-211-3/+9
| | | | | | | | not make copies non-POD arguments or arguments passed by reference: just copy the pointers directly. This eliminates another source of the dreaded memcpy-of-non-PODs. Fixes PR7188. llvm-svn: 104327
* Add braces to avoid an ambiguous else, fixing a GCC warning.Chandler Carruth2010-05-211-1/+2
| | | | llvm-svn: 104314
* Allocate space in a block record for implicit references to the Objective CJohn McCall2010-05-214-115/+125
| | | | | | | | | | 'self' variable arising from uses of the 'super' keyword. Also reorganize some code so that BlockInfo (now CGBlockInfo) can be opaque outside of CGBlocks.cpp. Fixes rdar://problem/8010633. llvm-svn: 104312
* When emitting an lvalue for an anonymous struct or union member duringJohn McCall2010-05-213-2/+36
| | | | | | | class initialization, drill down through an arbitrary number of anonymous records. llvm-svn: 104310
* Introduce a method to get from an anonymous struct or union record declarationJohn McCall2010-05-212-30/+12
| | | | | | to the associated object declaration. llvm-svn: 104309
* When instantiating anonymous structs/unions within a function, makeDouglas Gregor2010-05-211-1/+18
| | | | | | | | | sure that the anonymous struct/union record declaration gets instantiated before the variable declaration, and that it and its fields (recursively) get entries in the local instantiation map. Fixes PR7088. llvm-svn: 104305
* Fix a crasher in constructor-initializer reordering warnings (PR7179).Douglas Gregor2010-05-201-3/+1
| | | | llvm-svn: 104299
* Generate objc_memmove_collectable write-barrier for Fariborz Jahanian2010-05-201-1/+7
| | | | | | classes whose base class have GC'able object pointers. llvm-svn: 104296
* Be sure to apply initializers to members of anonymous structs and unionsJohn McCall2010-05-201-61/+92
| | | | | | | | recursively, e.g. so that members of anonymous unions inside anonymous structs still get initialized. Also generate default constructor calls for anonymous struct members when necessary. llvm-svn: 104292
* Improve parser recovery when a switch condition is invalid; fixesDouglas Gregor2010-05-201-3/+4
| | | | | | <rdar://problem/7971948>. llvm-svn: 104291
* Add a new failure kind, FK_Incomplete, to InitializationSequence, toDouglas Gregor2010-05-203-2/+17
| | | | | | | | | capture failures when we try to initialize an incomplete type. Previously, we would (ab)use FK_ConversionFailed, then occasionally dereference a null pointer when trying to diagnose the failure. Fixes <rdar://problem/7959007>. llvm-svn: 104286
* Driver: Switch to using the integrated assembler for standalone assembly jobsDaniel Dunbar2010-05-201-2/+18
| | | | | | (or -save-temps), when the integrated assembler is enabled. llvm-svn: 104282
* Adds support for generation of objc_memmove_collectable APIFariborz Jahanian2010-05-201-1/+5
| | | | | | in Objective-C++ mode. llvm-svn: 104281
* Driver: Add a tool definition for the Clang integrated assembler.Daniel Dunbar2010-05-202-0/+72
| | | | llvm-svn: 104280
* Reinstate r104117, Chandler Carruth's change that "[provides] a namingDouglas Gregor2010-05-202-12/+11
| | | | | | | class for UnresolvedLookupExprs, even when occuring on template names" along with a fix for an Objective-C++ crasher it introduced. llvm-svn: 104277
* Driver/MC: Add 'clang -cc1as' integrated assembler tool, currently accepts ↵Daniel Dunbar2010-05-203-2/+43
| | | | | | approximately the same interface as 'llvm-mc'. llvm-svn: 104239
* Driver: Move some argument lookup utilities into driver::ArgList.Daniel Dunbar2010-05-202-72/+70
| | | | llvm-svn: 104237
* Copy construction of non-trivial properties must notFariborz Jahanian2010-05-202-8/+4
| | | | | | be turned into a setter call (fixes radar 8008649). llvm-svn: 104235
* Picky, pickyDouglas Gregor2010-05-201-1/+1
| | | | llvm-svn: 104230
* Fix a thinkoDouglas Gregor2010-05-201-1/+1
| | | | llvm-svn: 104229
* Assert that we do not try to memcpy a non-POD class type in C++. ThisDouglas Gregor2010-05-201-1/+7
| | | | | | | | | | | | | | particular issue was the cause of the Boost.Interprocess failures, and in general will lead to horrendous, hard-to-diagnose miscompiles. The assertion itself has survives self-host and a full Boost build, so we are close to eradicating this problem in C++. Note that the assertion is *not* turned on for Objective-C++, where we still have problems with introducing memcpy's of non-POD class types. That part of the assertion will go away as soon as we fix the known issues in Objective-C++. llvm-svn: 104227
* Added TemplateArgumentListInfo to FunctionTemplateSpecializationInfo.Abramo Bagnara2010-05-202-25/+31
| | | | llvm-svn: 104226
* Fix my inability to spell 'continue' and a case where message sends ↵David Chisnall2010-05-201-4/+7
| | | | | | returning non-pointer-sized things were generating invalid IR inside @try blocks. llvm-svn: 104222
* Renamed misleading getSourceRange -> getLocalSourceRange and ↵Abramo Bagnara2010-05-2014-27/+27
| | | | | | getFullSourceRange -> getSourceRange for TypeLoc. llvm-svn: 104220
* Rework our handling of binding a reference to a temporaryDouglas Gregor2010-05-201-18/+100
| | | | | | | | | | | | | | | | | | | | subobject. Previously, we could only properly bind to a base class subobject while extending the lifetime of the complete object (of a derived type); for non-static data member subobjects, we could memcpy (!) the result and bind to that, which is rather broken. Now, we pull apart the expression that we're binding to, to figure out which subobject we're accessing, then construct the temporary object (adding a destruction if needed) and, finally, dig out the subobject we actually meant to access. This fixes yet another instance where we were memcpy'ing rather than doing the right thing. However, note the FIXME in references.cpp: there's more work to be done for binding to subobjects, since the AST is incorrectly modeling some member accesses in base classes as lvalues when they are really rvalues. llvm-svn: 104219
* Whoops.John McCall2010-05-201-1/+1
| | | | llvm-svn: 104218
* Don't try to check jump scopes in invalid functions. FixesJohn McCall2010-05-201-1/+3
| | | | | | <rdar://problem/7995494>. llvm-svn: 104217
* When creating a this-adjustment thunk where the return value is of C++Douglas Gregor2010-05-201-2/+9
| | | | | | | | | class type (that uses a return slot), pass the return slot to the callee directly rather than allocating new storage and trying to copy the object. This appears to have been the cause of the remaining two Boost.Interprocess failures. llvm-svn: 104215
OpenPOWER on IntegriCloud