summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Fixes a rewriter bug rewriting call to a byrefFariborz Jahanian2011-04-011-0/+8
| | | | | | block pointer nested inside a block. // rdar:// 9204669 llvm-svn: 128747
* ANother rewrite bug, rewriting a call ofFariborz Jahanian2011-04-011-0/+1
| | | | | | __byref block. // rdar://9204669 llvm-svn: 128726
* Do not try calculate the size of forward-declared template type array.Devang Patel2011-04-011-0/+10
| | | | llvm-svn: 128725
* IRgen: Reapply r128691 with a fix to ensure we don't increase alignment pastDaniel Dunbar2011-04-011-0/+157
| | | | | | that of the array element type. llvm-svn: 128698
* Revert r128691, "IRgen: Improve GCC compatibility when dealing with packedDaniel Dunbar2011-04-011-147/+0
| | | | | | arrays by propagating", it's breaking test in ways I don't understand yet. llvm-svn: 128693
* IRgen: Improve GCC compatibility when dealing with packed arrays by propagatingDaniel Dunbar2011-03-311-0/+147
| | | | | | | | the array alignment to the array access. - This is more or less the best we can do without having alignment present in the type system, but is a long way from truly matching how GCC handles this. llvm-svn: 128691
* Fix couple of rewriter bugs related to rewriting aFariborz Jahanian2011-03-311-0/+8
| | | | | | __block block declaration. //rdar://9204669 llvm-svn: 128682
* -Wuninitialized should not warn about variables captured by blocks as byref.Ted Kremenek2011-03-311-0/+9
| | | | | | | | | Note this can potentially be enhanced to detect if the __block variable is actually written by the block, or only when the block "escapes" or is actually used, but that requires more analysis than it is probably worth for this simple check. llvm-svn: 128681
* Add security syntax checker for strcpy() which causes the Static Analyzer to ↵Lenny Maiorani2011-03-311-0/+37
| | | | | | generate a warning any time the strcpy() function is used with a note suggesting to use a function which provides bounded buffers. llvm-svn: 128679
* Adding Static Analyzer checker for mempcpy().Lenny Maiorani2011-03-311-0/+101
| | | | | | Models mempcpy() so that if length is NULL the destination pointer is returned. Otherwise, the source and destination are confirmed not to be NULL and not overlapping. Finally the copy is validated to not cause a buffer overrun and the return value is bound to the address of the byte after the last byte copied. llvm-svn: 128677
* After much contemplation, I've decided that we probably shouldn't "unique"John McCall2011-03-311-0/+32
| | | | | | | | | | | | | __block object copy/dispose helpers for C++ objects with those for different variables with completely different semantics simply because they happen to both be no more aligned than a pointer. Found by inspection. Also, internalize most of the helper generation logic within CGBlocks.cpp, and refactor it to fit my peculiar aesthetic sense. llvm-svn: 128618
* Static analyzer: fix bug in handling of dynamic_cast<>. The sink node ↵Ted Kremenek2011-03-311-0/+14
| | | | | | | | wouldn't always be the final node, thus causing the state to continue propagating. Instead, recover some path-sensitivity by conjuring a symbol. llvm-svn: 128612
* Teach static analyzer about the basics of handling new[]. We still don't ↵Ted Kremenek2011-03-311-0/+8
| | | | | | simulate constructors, but at least the analyzer doesn't think the return value is uninitialized. llvm-svn: 128611
* Change Clang's __VERSION__ to include the same basic info as in clang -v.Daniel Dunbar2011-03-311-1/+1
| | | | | | - Please never ever ever ever write a tool that sniffs this. llvm-svn: 128599
* Begin reworking static analyzer support for C++ method calls. The current ↵Ted Kremenek2011-03-303-0/+18
| | | | | | | | | | | logic was divorced from how we process ordinary function calls, had a tremendous about of redundancy, and relied strictly on inlining behavior (which was incomplete) to provide semantics instead of falling back to the conservative analysis we use for C functions. This is a significant step into making C++ analyzer support more useful. llvm-svn: 128557
* de-sugared when accessing property reference type.Fariborz Jahanian2011-03-301-0/+44
| | | | | | Add a test case for synthesize ivar. // rdar://9070460 llvm-svn: 128554
* Fix IRGen issues related to using property-dot syntaxFariborz Jahanian2011-03-301-0/+34
| | | | | | for prperty reference types. // rdar://9208606. llvm-svn: 128551
* Robustify test string.Devang Patel2011-03-291-2/+2
| | | | llvm-svn: 128486
* Add target triple.Devang Patel2011-03-291-1/+1
| | | | llvm-svn: 128480
* Do not line number entry for unconditional branches. Usually, users do not ↵Devang Patel2011-03-292-0/+24
| | | | | | want to stop at closing '}'. llvm-svn: 128471
* Add a triple to make the test friendly on no windows platform.Francois Pichet2011-03-291-1/+1
| | | | llvm-svn: 128459
* Accept __declspec(dllimport) for function defined at class scope in ↵Francois Pichet2011-03-291-0/+13
| | | | | | | | Microsoft mode. This fixes a bunch of errors when compiling MSVC header files with the -DDLL flag. llvm-svn: 128457
* Fix a bug in how we were resolving the address of overloaded functionsChandler Carruth2011-03-291-1/+65
| | | | | | | | | | | | | | | | | | | | | | | | when the resolution took place due to a single template specialization being named with an explicit template argument list. In this case, the "resolution" doesn't take into account the target type at all, and therefore can take place for functions, static member functions, and *non-static* member functions. The latter weren't being properly checked and their proper form enforced in this scenario. We now do so. The result of this last form slipping through was some confusing logic in IsStandardConversion handling of these resolved address-of expressions which eventually exploded in an assert. Simplify this logic a bit and add some more aggressive asserts to catch improperly formed expressions getting into this routine. Finally add systematic testing of member functions, both static and non-static, in the various forms they can take. One of these is essentially PR9563, and this commit fixes the crash in that PR. However, the diagnostics for this are still pretty terrible. We at least are now accepting the correct constructs and rejecting the invalid ones rather than accepting invalid or crashing as before. llvm-svn: 128456
* Add workaround for Sema issue found in <rdar://problem/9188004>, which leads ↵Ted Kremenek2011-03-291-1/+22
| | | | | | | | | to an assertion failure in the uninitialized variables analysis. The problem is that Sema isn't properly registering a variable in a DeclContext (which -Wuninitialized relies on), but my expertise on the template instantiation logic isn't good enough to fix this problem for real. This patch worksaround the problem in -Wuninitialized, but we should fix it for real later. llvm-svn: 128443
* Don't do the checks of Sema::DiagnoseEqualityWithExtraParens() on ↵Argyrios Kyrtzidis2011-03-281-0/+13
| | | | | | type-dependent expressions. Fixes rdar://9027658. llvm-svn: 128437
* Implements property of reference types. AddingFariborz Jahanian2011-03-281-2/+2
| | | | | | | an executable test to llvm test suite. // rdar://9070460. llvm-svn: 128435
* Also 'self' in blocks need be handled specially.Fariborz Jahanian2011-03-281-1/+4
| | | | | | // rdar://9181463 llvm-svn: 128410
* Fix PR9572 and neighboring lurking crashers.Matt Beaumont-Gay2011-03-281-0/+15
| | | | llvm-svn: 128401
* Add my test case for r128353. I think this is the last test case to failChandler Carruth2011-03-271-0/+11
| | | | | | to be added... Sorry for the noise. llvm-svn: 128395
* Add tests for the uninitialized checks added in r128376. Also clean upChandler Carruth2011-03-271-11/+42
| | | | | | | | | | | | | | | and flesh out the existing uninitialized testing for field initializers. The tests come from Richard's original patch, but I've cleaned them up a bit and ordered them more naturally. Also, I added a test for the most simple base case: int x = x; And it turns out we miss this one! =[ That and another bad FIXME on the field initializer checking are left in the test. llvm-svn: 128394
* Flip the default for showing include stacks on notes to false. ThisChandler Carruth2011-03-274-3/+22
| | | | | | | | | | | | | required modifying a few tests that specifically use note include stacks to check the source manager's view of include stacks. I've simply added the flag to these tests for now, they may have to be more substantially changed if we decide to remove support for note include stacks altogether. Also, add a test for include stacks on notes that was supposed to go in with the previous commit. llvm-svn: 128390
* 'self' is objective-c's 'self' objc pointer only inFariborz Jahanian2011-03-271-0/+23
| | | | | | an objc method. Fixes // rdar://9181463 llvm-svn: 128389
* Improve recovery (error + fix-it) when parsing type dependent template name ↵Francois Pichet2011-03-272-0/+43
| | | | | | | | | | | without the "template" keyword. For example: typename C1<T>:: /*template*/ Iterator<0> pos; Also the error is downgraded to an ExtWarn in Microsoft mode. llvm-svn: 128387
* AltiVec vector comparison logic now affect only vectors of fundamental ↵Anton Yartsev2011-03-271-0/+3
| | | | | | AltiVec vector types. It fixes bug 9347. llvm-svn: 128381
* Diagnose uninitialized uses of a variable within its own initializer.Chandler Carruth2011-03-274-7/+12
| | | | | | | | | | | This is basically the same idea as the warning on uninitialized uses of fields within an initializer list. As such, it is on by default and under -Wuninitialized. Original patch by Richard Trieu, with some massaging from me on the wording and grouping of the diagnostics. llvm-svn: 128376
* supported: AltiVec vector initialization with a single literal according to ↵Anton Yartsev2011-03-273-170/+198
| | | | | | PIM section 2.5.1 - after initialization all elements have the value specified by the literal llvm-svn: 128375
* We were emitting construction v-tables with internal linkage all the time.John McCall2011-03-271-2/+2
| | | | | | | | | | | | | | | Emit them instead with the linkage of the VTT. I'm actually really ambivalent about this; it's what GCC does, but outside of improving code size (if the linkage is coalescing), I'm not sure it's at all relevant. Construction vtables are naturally referenced only by the VTT, which is itself only referenced by complete-object constructors and destructors; giving the construction vtables possibly-external linkage is important if you have an optimization that drills through the VTT to a reference to a particular construction vtable which it cannot just emit itself. llvm-svn: 128374
* Improve -Wheader-hygiene to warn about using directives inside linkageDouglas Gregor2011-03-262-0/+45
| | | | | | specifications within the global scope, from Elliot Glaysher. llvm-svn: 128352
* More coherent diagnostic attempting to assign to a member of a const object ↵Fariborz Jahanian2011-03-261-0/+24
| | | | | | | | returned from an objective-c message: // rdar://9005189 llvm-svn: 128348
* For Diagnostic::Reset() also reset the state related to #pragma diagnostic. ↵Argyrios Kyrtzidis2011-03-261-0/+13
| | | | | | Fixes rdar://9170766. llvm-svn: 128346
* fix the second part of rdar://8366474 - clang fails to parse ObjC selectors ↵Chris Lattner2011-03-261-10/+16
| | | | | | with '::', when :: isn't the first part of the selector. llvm-svn: 128344
* Make diagnostic clearer.Fariborz Jahanian2011-03-263-11/+11
| | | | llvm-svn: 128343
* Don't add a symbolic region for 'this' if the member function is static.Anders Carlsson2011-03-261-0/+11
| | | | llvm-svn: 128340
* Add a __has_feature check for the 'availability' attributeDouglas Gregor2011-03-261-0/+5
| | | | llvm-svn: 128337
* On Mac OS X, the presence of an 'availability' attribute for thatDouglas Gregor2011-03-262-3/+34
| | | | | | | | | platform implies default visibility. To achieve these, refactor our lookup of explicit visibility so that we search for both an explicit VisibilityAttr and an appropriate AvailabilityAttr, favoring the VisibilityAttr if it is present. llvm-svn: 128336
* Test attribute merging for the availability attribute.Douglas Gregor2011-03-261-0/+6
| | | | llvm-svn: 128334
* Extend the new 'availability' attribute with support for anDouglas Gregor2011-03-262-0/+8
| | | | | | | 'unavailable' argument, which specifies that the declaration to which the attribute appertains is unavailable on that platform. llvm-svn: 128329
* Allow GC qualifiers to be added/removed by conversions from/to void*John McCall2011-03-261-0/+11
| | | | | | without a warning. llvm-svn: 128328
* Don't warn about the 'extern' in 'extern "C"' on a tag decl. This isJohn McCall2011-03-261-0/+3
| | | | | | usually useless, but not always. llvm-svn: 128326
* Fix the recovery from missing semis on @property declarations to not consumeJohn McCall2011-03-261-0/+5
| | | | | | | | the following '@'. Conceivably, we could skip tokens until something that can validly start an @interface declaration here, but it's not clear that it matters. llvm-svn: 128325
OpenPOWER on IntegriCloud