summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* objective-C: Fixes a bogus warning due to not settingFariborz Jahanian2013-02-105-7/+36
| | | | | | | | the "nonatomic" attribute in property redeclaration in class extension. Also, improved on diagnostics in this area while at it. // rdar://13156292 llvm-svn: 174821
* Formatter: Add test for default arguments.Nico Weber2013-02-091-0/+2
| | | | llvm-svn: 174816
* FileCheck'ize testsDmitri Gribenko2013-02-094-9/+16
| | | | llvm-svn: 174815
* FileCheck'ize a testDmitri Gribenko2013-02-091-1/+2
| | | | llvm-svn: 174814
* Remove unreachable statementDmitri Gribenko2013-02-091-1/+0
| | | | llvm-svn: 174811
* Comment parsing: use CharInfo.hDmitri Gribenko2013-02-092-43/+17
| | | | | | | This also gives us 0.2% speedup on '-fsyntax-only -Wdocumentation' time for a testcase that consists of all Clang headers. llvm-svn: 174810
* libclang: use CXCursor getters to simplify codeDmitri Gribenko2013-02-091-3/+2
| | | | llvm-svn: 174809
* Remove some stray uses of <ctype.h> functions.Jordan Rose2013-02-095-5/+9
| | | | | | These are causing assertions on some MSVC builds. llvm-svn: 174805
* QoI: -Wreadonly-iboutlet-property should have the warning's location on the ↵Ted Kremenek2013-02-093-12/+10
| | | | | | | | | | property. There's no need to refer to the @implementation at all. Fixes <rdar://problem/13186515> llvm-svn: 174802
* Release notes: mention support for Unicode and UCNs in identifiers.Jordan Rose2013-02-091-0/+9
| | | | | | | | | | I'm using the name "Extended Identifiers" for the feature because that's what GCC calls them. According to the standard, the new feature is "universal character names are now allowed in identifiers", but the more interesting "feature" is that identifiers can now contain Unicode characters, however they are written. llvm-svn: 174798
* Ensure that type definitions present in just-loaded modules areDouglas Gregor2013-02-0912-38/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* clang/lib/StaticAnalyzer/Core/BugReporter.cpp: Appease old msvc in ↵NAKAMURA Takumi2013-02-091-1/+2
| | | | | | std::pair(0, 0). llvm-svn: 174792
* Properly validate UCNs for C99 and C++03 (both more restrictive than C(++)11).Jordan Rose2013-02-096-89/+741
| | | | | | | | 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-092-14/+15
| | | | | | | | | | | | 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] Move DefaultBool so that all checkers can share it.Anna Zaks2013-02-084-22/+8
| | | | llvm-svn: 174782
* [analyzer] Split IvarInvalidation into two checkersAnna Zaks2013-02-083-61/+123
| | | | | | | 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: refactor, pull out the diagnostic printingAnna Zaks2013-02-081-49/+69
| | | | llvm-svn: 174780
* [analyzer] IvarInvalidation: add annotation for partial invalidationAnna Zaks2013-02-082-45/+150
| | | | | | | | | | | 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-082-12/+51
| | | | | | | | "auto-synthesized may not work correctly with 'nib' loader" when 'readonly' property is redeclared 'readwrite' in class extension. // rdar://13123861 llvm-svn: 174775
* CharInfo: Add missing "using namespace clang::charinfo" in .cpp file.Jordan Rose2013-02-081-2/+3
| | | | | | Should fix the MSC bot. llvm-svn: 174769
* Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.Jordan Rose2013-02-0831-106/+258
| | | | | | | Nearly all of these changes are one-to-one replacements; the few that aren't have to do with custom identifier validation. llvm-svn: 174768
* Simplify logic for avoiding concatenation after numeric constants.Jordan Rose2013-02-082-7/+14
| | | | | | | 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-082-14/+15
| | | | | | | | | 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
* Pull Lexer's CharInfo table out for general use throughout Clang.Jordan Rose2013-02-086-170/+626
| | | | | | | | | | | Rewriting the same predicates over and over again is bad for code size and code maintainence. Using the functions in <ctype.h> is generally unsafe unless they are specified to be locale-independent (i.e. only isdigit and isxdigit). The next commit will try to clean up uses of <ctype.h> functions within Clang. llvm-svn: 174765
* Note that checker-271 is newer than the analyzer in Xcode 4.6Ted Kremenek2013-02-081-0/+1
| | | | llvm-svn: 174759
* Update open source checker build to checker-271.Ted Kremenek2013-02-082-1/+16
| | | | llvm-svn: 174758
* Always keep highest identifier, selector, and macro IDs when we'veDouglas Gregor2013-02-081-5/+21
| | | | | | read another one, just as we do for types. llvm-svn: 174745
* Never cache the result of a module file lookup.Douglas Gregor2013-02-083-8/+15
| | | | llvm-svn: 174744
* Fix indentation-detection at indent level 0.Manuel Klimek2013-02-082-3/+8
| | | | | | | | | | | This correctly formats: { a; } where { is incorrectly indented by 2, but is at level 0, when reformatting only 'a;'. llvm-svn: 174737
* Teach BugReporter (extensive diagnostics) to emit a diagnostic when a loop ↵Ted Kremenek2013-02-082-3/+682
| | | | | | | | 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
* Remove stale instance variable.Ted Kremenek2013-02-081-1/+0
| | | | llvm-svn: 174730
* objective-C modern translation: Fix another random translation bugFariborz Jahanian2013-02-082-0/+45
| | | | | | | involving property getter expressions on rhs of property setter. // rdar://13138459 llvm-svn: 174729
* Takes the context into account when re-indenting regions.Manuel Klimek2013-02-082-25/+113
| | | | | | Fixes llvm.org/PR14916. llvm-svn: 174720
* objective-C modern translator. Fixes a trivialFariborz Jahanian2013-02-082-3/+23
| | | | | | | rewriting bug where #ifdef ended up on the same line as the attribute declaration. llvm-svn: 174719
* Fix handling of fake parenthesis during formatting.Daniel Jasper2013-02-083-2/+7
| | | | | | | | | | | | | | | | | | They are much easier to handle when attached to the previous token. Before: unsigned Indent = formatFirstToken(TheLine.First, IndentForLevel[TheLine.Level] >= 0 ? IndentForLevel[TheLine.Level] : TheLine.Level * 2, TheLine.InPPDirective, PreviousEndOfLineColumn); After: unsigned Indent = formatFirstToken( TheLine.First, IndentForLevel[TheLine.Level] >= 0 ? IndentForLevel[TheLine.Level] : TheLine.Level * 2, TheLine.InPPDirective, PreviousEndOfLineColumn); llvm-svn: 174718
* Implement a tiny expression parser to improve formatting decisions.Daniel Jasper2013-02-084-44/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With this patch, the formatter introduces 'fake' parenthesis according to the operator precedence of binary operators. Before: return aaaa & AAAAAAAAAAAAAAAAAAAAAAAAAAAAA || bbbb & BBBBBBBBBBBBBBBBBBBBBBBBBBBBB || cccc & CCCCCCCCCCCCCCCCCCCCCCCCCC || dddd & DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD; f(aaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaaa); After: return aaaa & AAAAAAAAAAAAAAAAAAAAAAAAAAAAA || bbbb & BBBBBBBBBBBBBBBBBBBBBBBBBBBBB || cccc & CCCCCCCCCCCCCCCCCCCCCCCCCC || dddd & DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD; f(aaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaaa); Future improvements: - Get rid of some of the hacky ways to nicely format certain constructs. - Merge this parser and the AnnotatingParser as we now have several parsers that analyze (), [], etc. llvm-svn: 174714
* Avoid unnecessary line breaks in nested ObjC calls.Daniel Jasper2013-02-082-20/+40
| | | | | | | | | | | | Before: [pboard setData:[NSData dataWithBytes:&button length:sizeof(button)] forType:kBookmarkButtonDragType]; After: [pboard setData:[NSData dataWithBytes:&button length:sizeof(button)] forType:kBookmarkButtonDragType]; llvm-svn: 174701
* 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-082-25/+26
| | | | | | | | | | | | | | | | 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
* CMake: Optionally allow running the Clang unit tests in standalone builds.Jordan Rose2013-02-081-4/+11
| | | | | | | | | | | | | The reason this is not enabled by default is because there is no way for Clang to guarantee that the LLVM unit testing infrastruture has been built. However, if it /has/ been built, there's no reason why the standalone Clang build can't use it! This should have no effect on existing builds -- in a combined build the value of the CLANG_INCLUDE_TESTS option defaults to the LLVM equivalent, and in a standalone build it defaults to off. llvm-svn: 174691
* 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-083-10/+53
| | | | | | | | | 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-083-1/+10
| | | | llvm-svn: 174688
* Fix stack overflow and improve performance when a module contains manyRichard Smith2013-02-084-5/+2024
| | | | | | | | | | | | | 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-084-9/+56
| | | | | | | 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-0810-5/+45
| | | | llvm-svn: 174683
* [analyzer] Remove redundant check as per Jordan's feedback.Anna Zaks2013-02-071-3/+2
| | | | llvm-svn: 174680
* [analyzer] Fix typo.Anna Zaks2013-02-071-1/+1
| | | | llvm-svn: 174679
OpenPOWER on IntegriCloud