summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
...
* objective-C: Fixes a bogus warning due to not settingFariborz Jahanian2013-02-103-3/+22
| | | | | | | | the "nonatomic" attribute in property redeclaration in class extension. Also, improved on diagnostics in this area while at it. // rdar://13156292 llvm-svn: 174821
* FileCheck'ize testsDmitri Gribenko2013-02-094-9/+16
| | | | llvm-svn: 174815
* FileCheck'ize a testDmitri Gribenko2013-02-091-1/+2
| | | | llvm-svn: 174814
* QoI: -Wreadonly-iboutlet-property should have the warning's location on the ↵Ted Kremenek2013-02-091-8/+6
| | | | | | | | | | property. There's no need to refer to the @implementation at all. Fixes <rdar://problem/13186515> llvm-svn: 174802
* Ensure that type definitions present in just-loaded modules areDouglas Gregor2013-02-093-1/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | visible. The basic problem here is that a given translation unit can use forward declarations to form pointers to a given type, say, class X; X *x; and then import a module that includes a definition of X: import XDef; We will then fail when attempting to access a member of X, e.g., x->method() because the AST reader did not know to look for a default of a class named X within the new module. This implementation is a bit of a C-centric hack, because the only definitions that can have this property are enums, structs, unions, Objective-C classes, and Objective-C protocols, and all of those are either visible at the top-level or can't be defined later. Hence, we can use the out-of-date-ness of the name and the identifier-update mechanism to force the update. In C++, we will not be so lucky, and will need a more advanced solution, because the definitions could be in namespaces defined in two different modules, e.g., // module 1 namespace N { struct X; } // module 2 namespace N { struct X { /* ... */ }; } One possible implementation here is for C++ to extend the information associated with each identifier table to include the declaration IDs of any definitions associated with that name, regardless of context. We would have to eagerly load those definitions. llvm-svn: 174794
* Properly validate UCNs for C99 and C++03 (both more restrictive than C(++)11).Jordan Rose2013-02-092-0/+146
| | | | | | | | Add warnings under -Wc++11-compat, -Wc++98-compat, and -Wc99-compat when a particular UCN is incompatible with a different standard, and -Wunicode when a UCN refers to a surrogate character in C++03. llvm-svn: 174788
* [analyzer] Invalidation checker: move the "missing implementation" checkAnna Zaks2013-02-091-2/+2
| | | | | | | | | | | | The missing definition check should be in the same category as the missing ivar validation - in this case, the intent is to invalidate in the given class, as described in the declaration, but the implementation does not perform the invalidation. Whereas the MissingInvalidationMethod checker checks the cases where the method intention is not to invalidate. The second checker has potential to have a much higher false positive rate. llvm-svn: 174787
* [analyzer] Split IvarInvalidation into two checkersAnna Zaks2013-02-081-16/+32
| | | | | | | Separate the checking for the missing invalidation methods into a separate checker so that it can be turned on/off independently. llvm-svn: 174781
* [analyzer] IvarInvalidation: add annotation for partial invalidationAnna Zaks2013-02-081-6/+72
| | | | | | | | | | | The new annotation allows having methods that only partially invalidate IVars and might not be called from the invalidation methods directly (instead, are guaranteed to be called before the invalidation occurs). The checker is going to trust the programmer to call the partial invalidation method before the invalidator.This is common in cases when partial object tear down happens before the death of the object. llvm-svn: 174779
* objective-C: don't issue bogus warning aboutFariborz Jahanian2013-02-081-0/+21
| | | | | | | | "auto-synthesized may not work correctly with 'nib' loader" when 'readonly' property is redeclared 'readwrite' in class extension. // rdar://13123861 llvm-svn: 174775
* Simplify logic for avoiding concatenation after numeric constants.Jordan Rose2013-02-081-1/+9
| | | | | | | I threw in a couple of test cases for UD-suffixes -- already working, but it wasn't immediately obvious to me. llvm-svn: 174767
* StmtPrinter: Write large char values using \u or \U.Jordan Rose2013-02-081-6/+6
| | | | | | | | | This may not always be valid, but we were previously just emitting them raw. While here, s/isprint/isPrintable/ (using the new CharInfo). llvm-svn: 174766
* Teach BugReporter (extensive diagnostics) to emit a diagnostic when a loop ↵Ted Kremenek2013-02-081-0/+631
| | | | | | | | body is skipped. Fixes <rdar://problem/12322528>. llvm-svn: 174736
* [libclang] Add a test to make sure annotation works fine in the presence ofArgyrios Kyrtzidis2013-02-081-0/+27
| | | | | | | | | | | 'override' on the method. This was fixed in a previous commit, generally handling attributes that are at the end of the declaration. rdar://13140589 llvm-svn: 174734
* objective-C modern translation: Fix another random translation bugFariborz Jahanian2013-02-081-0/+43
| | | | | | | involving property getter expressions on rhs of property setter. // rdar://13138459 llvm-svn: 174729
* objective-C modern translator. Fixes a trivialFariborz Jahanian2013-02-081-0/+20
| | | | | | | rewriting bug where #ifdef ended up on the same line as the attribute declaration. llvm-svn: 174719
* Improve filechecking of volatile test.Tim Northover2013-02-081-37/+110
| | | | | | | | | | | | My previous attempt was extremely deficient, allowing more volatiles to be introduced and not even checking all of the ones that are present. This attempt doesn't try to keep track of the values stored or offsets within particular objects, just that the correct objects are accessed in a correctly volatile manner throughout. llvm-svn: 174700
* CMake: Include Clang unit tests in check-clang target in standalone builds.Jordan Rose2013-02-081-19/+25
| | | | | | | | | | | | | | | | Also, remove CLANG_BUILD_TESTS option. It won't have consistent behavior between standalone and non-standalone builds, so I'm not going to bother hooking it up for standalone builds. LLVM_BUILD_TESTS will continue to control unit test inclusion in the "all" target in non-standalone builds. Finally, fix the default value of CLANG_INCLUDE_TESTS, which was being set to the boolean value of "LLVM_INCLUDE_TESTS", i.e. OFF, rather than actually reading the variable ${LLVM_INCLUDE_TESTS}! If you picked up my earlier commit, YOU WILL HAVE TO MANUALLY SET THIS OPTION BACK ON. My apologies! Part two of r174691 (allow the unit tests to be built in standalone mode). llvm-svn: 174698
* Fix test failure by making sure this file isn't identical to any other fileNick Lewycky2013-02-081-0/+1
| | | | | | | included in the same test. Clang gets confused about whether it's already built a module for this file, when running on a content-addressible filesystem. llvm-svn: 174694
* Fix conflict between r174685 and r174645 (rename -fmodule-cache-path <foo> ↵Richard Smith2013-02-081-1/+1
| | | | | | to -fmodules-cache-path=<foo>). llvm-svn: 174690
* [libclang] Attribute visitation happens out-of-source-order, make sureArgyrios Kyrtzidis2013-02-082-2/+30
| | | | | | | | | we annotate properly when there is an attribute and not skip type specs if the attribute is after the declaration. rdar://13129077 llvm-svn: 174689
* Use the target address space value when mangling names.Tanya Lattner2013-02-082-0/+8
| | | | llvm-svn: 174688
* Fix stack overflow and improve performance when a module contains manyRichard Smith2013-02-083-0/+2017
| | | | | | | | | | | | | overloads of a name by claiming that there are no lookup results for that name in modules while loading the names from the module. Lookups in deserialization really don't want to find names which they themselves are in the process of introducing. This also has the pleasant side-effect of automatically caching PCH lookups which found no names. The runtime here is still quadratic in the number of overloads, but the constant is lower. llvm-svn: 174685
* objective-C modern translator. Generate #lineFariborz Jahanian2013-02-081-0/+40
| | | | | | | info in the translated code under -g only. // rdar://13138170 llvm-svn: 174684
* Teach subframework header lookup to suggest modules <rdar://problem/13176200>.Douglas Gregor2013-02-087-0/+17
| | | | llvm-svn: 174683
* [analyzer] Report bugs when freeing memory with offset pointerAnna Zaks2013-02-071-0/+100
| | | | | | | | | | | | | | | | | The malloc checker will now catch the case when a previously malloc'ed region is freed, but the pointer passed to free does not point to the start of the allocated memory. For example: int *p1 = malloc(sizeof(int)); p1++; free(p1); // warn From the "memory.LeakPtrValChanged enhancement to unix.Malloc" entry in the list of potential checkers. A patch by Branden Archer! llvm-svn: 174678
* [analyzer] Add pointer escape type param to checkPointerEscape callbackAnna Zaks2013-02-074-0/+61
| | | | | | | | | | | | | | The checkPointerEscape callback previously did not specify how a pointer escaped. This change includes an enum which describes the different ways a pointer may escape. This enum is passed to the checkPointerEscape callback when a pointer escapes. If the escape is due to a function call, the call is passed. This changes previous behavior where the call is passed as NULL if the escape was due to indirectly invalidating the region the pointer referenced. A patch by Branden Archer! llvm-svn: 174677
* [analyzer] Don't reinitialize static globals more than once along a pathAnna Zaks2013-02-072-0/+36
| | | | | | | | | | | This patch makes sure that we do not reinitialize static globals when the function is called more than once along a path. The motivation is code with initialization patterns that rely on 2 static variables, where one of them has an initializer while the other does not. Currently, we reset the static variables with initializers on every visit to the function along a path. llvm-svn: 174676
* Form the default -fmodules-cache-path= properly.Douglas Gregor2013-02-071-1/+1
| | | | llvm-svn: 174674
* objective-C modern translator. More fixups for Fariborz Jahanian2013-02-071-0/+48
| | | | | | | modern meta-data abi translation. Still wip. // rdar://13138459 llvm-svn: 174672
* Add missing header from r174648Douglas Gregor2013-02-071-0/+3
| | | | llvm-svn: 174649
* Retain all hidden methods in the global method pool, because they may become ↵Douglas Gregor2013-02-074-0/+14
| | | | | | visible <rdar://problem/13172858>. llvm-svn: 174648
* Rename -fmodule-cache-path <blah> to -fmodules-cache-path=<blah> for ↵Douglas Gregor2013-02-0749-114/+114
| | | | | | consistency. llvm-svn: 174645
* Thread safety analysis: make sure that expressions in attributes are parsedDeLesley Hutchins2013-02-071-0/+13
| | | | | | in an unevaluated context. llvm-svn: 174644
* Testcase for r174477.Chad Rosier2013-02-071-0/+11
| | | | llvm-svn: 174640
* Enable overloading of OpenCL events - this is needed for the overloaded ↵Guy Benyei2013-02-071-0/+11
| | | | | | OpenCL builtin functions. llvm-svn: 174630
* FileCheckize volatile testTim Northover2013-02-071-3/+37
| | | | llvm-svn: 174627
* Only check for volatile memcpys in test.Tim Northover2013-02-071-1/+1
| | | | | | | | AArch64 handles aggFct's return struct slightly differently, leading to an extra memcpy. This test is fortunately only concerned about volatile copies, so we can modify the grep text to filter it. llvm-svn: 174621
* Add AArch64 wchar definition to testTim Northover2013-02-071-1/+1
| | | | | | This should allow it to pass if the default triple is AArch64 llvm-svn: 174620
* XFAIL test that's inappropriate for AArch64 ABITim Northover2013-02-071-0/+8
| | | | | | | | Only some ABIs require the "signext" attribute on parameters. On most platforms, however, it's a useful test so it's best not to limit it to some random arbitrary platform. llvm-svn: 174619
* Permit ABIs where the caller extends the result (test change).Tim Northover2013-02-071-1/+1
| | | | | | | | | This test was written to make sure *something* sane is generated, not to test any ABI's signedness semantics. This should allow the test to pass if AArch64 is the default target. llvm-svn: 174618
* Add OpenCL samplers as Clang builtin types and check sampler related ↵Guy Benyei2013-02-075-0/+45
| | | | | | restrictions. llvm-svn: 174601
* Apply the pure-virtual odr rule to other constructs which can call overloadedNick Lewycky2013-02-071-0/+38
| | | | | | operators. llvm-svn: 174584
* Fix handling of module imports adding names to a DeclContext after qualifiedRichard Smith2013-02-073-6/+33
| | | | | | | | | | | | | | | | name lookup has been performed in that context (this probably only happens in C++). 1) Whenever we add names to a context, set a flag on it, and if we perform lookup and discover that the context has had a lookup table built but has the flag set, update all entries in the lookup table with additional names from the external source. 2) When marking a DeclContext as having external visible decls, mark the context in which lookup is performed, not the one we are adding. These won't be the same if we're adding another copy of a pre-existing namespace. llvm-svn: 174577
* -Wimplicit-fallthrough: fixed two cases where "fallthrough annotation in ↵Alexander Kornienko2013-02-071-11/+29
| | | | | | | | | | | | | | | | | | | | | | unreachable code" was issued incorrectly. Summary: -Wimplicit-fallthrough: fixed two cases where "fallthrough annotation in unreachable code" was issued incorrectly: 1. In actual unreachable code, but not immediately on a fall-through execution path "fallthrough annotation does not directly precede switch label" is better; 2. After default: in a switch with covered enum cases. Actually, these shouldn't be treated as unreachable code for our purpose. Reviewers: rsmith Reviewed By: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D374 llvm-svn: 174575
* objective-C modern translator. Fix up the translatedFariborz Jahanian2013-02-072-6/+62
| | | | | | | metadata to handle ivar bitfields. This is wip. // rdar://13138459 llvm-svn: 174573
* AST dumping: indicate the previous declaration for a redeclaration, andRichard Smith2013-02-071-0/+13
| | | | | | | indicate the semantic DC if it's not the lexical DC. In passing, correct the ascii-art child marker for a child of a FriendDecl. llvm-svn: 174570
* Be a little more permissive with -fmodules-ignore-macro= by removing ↵Douglas Gregor2013-02-071-0/+7
| | | | | | everything after the second '=' if it is there. llvm-svn: 174567
* Introduce -fmodules-ignore-macro=NNN to ignore a macro when building/loading ↵Douglas Gregor2013-02-071-2/+22
| | | | | | | | | | | | | | | | | | | | | modules. The use of this flag enables a modules optimization where a given set of macros can be labeled as "ignored" by the modules system. Definitions of those macros will be completely ignored when building the module hash and will be stripped when actually building modules. The overall effect is that this flag can be used to drastically reduce the number of Eventually, we'll want modules to tell us what set of macros they respond to (the "configuration macros"), and anything not in that set will be excluded. However, that requires a lot of per-module information that must be accurate, whereas this option can be used more readily. Fixes the rest of <rdar://problem/13165109>. llvm-svn: 174560
* Detect when we end up trying to load conflicting module files.Douglas Gregor2013-02-063-0/+34
| | | | | | | | | | | | This can happen when one abuses precompiled headers by passing more -D options when using a precompiled hedaer than when it was built. This is intentionally permitted by precompiled headers (and is exploited by some build environments), but causes problems for modules. First part of <rdar://problem/13165109>, detecting when something when horribly wrong. llvm-svn: 174554
OpenPOWER on IntegriCloud