summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* clang-format: Improve formatting of operators forced to new lines.Daniel Jasper2013-11-082-4/+14
| | | | | | | | | | | | | | | | | | | | | | | Before: unsigned ContentSize = sizeof(int16_t) // DWARF ARange version number + sizeof(int32_t) // Offset of CU in the .debug_info section + sizeof(int8_t) // Pointer Size (in bytes) + sizeof(int8_t); // Segment Size (in bytes) After: unsigned ContentSize = sizeof(int16_t) // DWARF ARange version number + sizeof(int32_t) // Offset of CU in the .debug_info section + sizeof(int8_t) // Pointer Size (in bytes) + sizeof(int8_t); // Segment Size (in bytes) This fixes llvm.org/PR17687. llvm-svn: 194276
* Thread-safety analysis: check guarded_by and pt_guarded_by on array access.DeLesley Hutchins2013-11-082-14/+87
| | | | | | Currently supported only with -Wthread-safety-beta. llvm-svn: 194275
* Untabify.Richard Smith2013-11-081-29/+25
| | | | llvm-svn: 194274
* Issue a diagnostic if we see a templated friend declaration that we do notRichard Smith2013-11-087-14/+40
| | | | | | support. llvm-svn: 194273
* clang-format: Don't auto-break short macros in WebKit style.Daniel Jasper2013-11-082-1/+12
| | | | | | This fixes llvm.org/PR17842. llvm-svn: 194268
* clang-format: Improve linebreaking and indentation for ObjC calls.Daniel Jasper2013-11-083-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | Before: popup_wdow_.reset([[RenderWidgetPopupWindow alloc] iniithContentRect: NSMakRet(origin_global.x, origin_global.y, pos.width(), pos.height()) syeMask:NSBorderlessWindowMask bking:NSBackingStoreBuffered der:NO]); [self param:function( // parameter)] After: popup_wdow_.reset([[RenderWidgetPopupWindow alloc] iniithContentRect:NSMakRet(origin_global.x, origin_global.y, pos.width(), pos.height()) syeMask:NSBorderlessWindowMask bking:NSBackingStoreBuffered der:NO]); [self param:function( // parameter)] llvm-svn: 194267
* Revert 'Tweak ContainerNonEmptyMap with "int" instead of "bool"'.Jordan Rose2013-11-081-3/+3
| | | | | | | | | I've added the missing ImutProfileInfo [sic] specialization for bool, so this patch on r194235 is no longer needed. This reverts r194244 / 2baea2887dfcf023c8e3560e5d4713c42eed7b6b. llvm-svn: 194265
* Thread the info about vbptr sharing through ASTRecordLayoutTimur Iskhodzhanov2013-11-084-36/+26
| | | | | | Reviewed at http://llvm-reviews.chandlerc.com/D2120 llvm-svn: 194256
* Remove diagnostic leftover from the ancient times when C++1y support was ↵Benjamin Kramer2013-11-081-4/+0
| | | | | | incomplete. llvm-svn: 194254
* clang-format: Write files atomicallyAlp Toker2013-11-081-11/+1
| | | | | | | | | | | | | | | | | | | | | | Switch clang-format over to Rewriter::overwriteChangedFiles(). The previous implementation was attempting to stream back directly to the original file and failing if it was already memory mapped by MemoryBuffer, an operation unsupported by Windows. MemoryBuffer generally mmaps files larger than the physical page size so this will have been difficult to reproduce consistently. This change also reduces flicker in code editors and IDEs on all platforms when reformatting in-place. Note that other incorrect uses of MemoryBuffer exist in LLVM/clang and will need a similar fix. A test should be added for Windows when libFormat performance issues are fixed (it takes longer than a day to format a 1MB file at present!) llvm-svn: 194250
* Improve the missing ASM parser test for MS-style assemblyAlp Toker2013-11-082-11/+13
| | | | | | | | | | | | It's better to test clang-check rather than the internal c-index-test utility. Also adds a target so we can remove the XFAILs. Thanks to Richard Barton for spotting the test failure on ARM. Test originally from r193685. llvm-svn: 194249
* Add .clang-format without column limit to subdirectory tests/.Daniel Jasper2013-11-081-0/+2
| | | | | | | | | A column limit in the test folder can lead to trouble as the RUN, CHECK, etc. comments can potentially be broken over multiple lines changing their meaning. Without column limit, clang-format will simply keep the test author's line breaks. llvm-svn: 194248
* clang/test/CXX/drs/dr1xx.cpp: Add explicit triple x86_64-unknown-unknown to ↵NAKAMURA Takumi2013-11-081-3/+3
| | | | | | | | | | | | satisfy check7a and check8a since r194240. For i686 targets and LLP64 targets, we can see; error: 'error' diagnostics seen but not expected: File clang/test/CXX/drs/dr1xx.cpp Line 761: 'check7a' declared as an array with a negative size File clang/test/CXX/drs/dr1xx.cpp Line 765: 'check8a' declared as an array with a negative size 2 errors generated. llvm-svn: 194246
* StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp: Tweak ↵NAKAMURA Takumi2013-11-081-3/+3
| | | | | | | | | ContainerNonEmptyMap with "int" instead of "bool", to appease building since r194235. In ADT/ImmutableSet, ImutProfileInfo<bool> cannot be matched to ImutProfileInteger. I didn't have idea it'd the right way if PROFILE_INTEGER_INFO(bool) could be added there. llvm-svn: 194244
* Fix tests effected by r194221David Majnemer2013-11-082-2/+2
| | | | | | | GEP expressions were folded differently from before, change the tests to reflect this. llvm-svn: 194243
* s/DebugPrint/dump/gDouglas Gregor2013-11-083-15/+15
| | | | llvm-svn: 194242
* clang-format: Properly indent ObjC calls wrapped before first selectorDaniel Jasper2013-11-082-1/+8
| | | | | | | | | | | | | | | | Before: [self // break a:a aa:aa aaaaa:aaa]; After: [self // break a:a aa:aa aaaaa:aaa]; llvm-svn: 194241
* Tests for core issue 170-200.Richard Smith2013-11-083-22/+319
| | | | llvm-svn: 194240
* Objective-C++ ARC: Improve the conversion to a const __unsafe_unretained ↵Douglas Gregor2013-11-083-9/+37
| | | | | | | | | | | | | reference. Under ARC++, a reference to a const Objective-C pointer is implicitly treated as __unsafe_unretained, and can be initialized with (e.g.) a __strong lvalue. Make sure this behavior does not break template argument deduction and (related) that partial ordering still prefers a 'T* const&' template over a 'T const&' template when this case kicks in. Fixes <rdar://problem/14467941>. llvm-svn: 194239
* ObjectiveC migrator. Added a dropped check in myFariborz Jahanian2013-11-081-1/+2
| | | | | | last patch. llvm-svn: 194238
* Fix a bogus assert I introduced in r194224Douglas Gregor2013-11-081-1/+1
| | | | llvm-svn: 194237
* [analyzer] Add IdenticalExprChecker, to find copy-pasted code.Jordan Rose2013-11-085-1/+1170
| | | | | | | | | | | | | This syntactic checker looks for expressions on both sides of comparison operators that are structurally the same. As a special case, the floating-point idiom "x != x" for "isnan(x)" is left alone. Currently this only checks comparison operators, but in the future we could extend this to include logical operators or chained if-conditionals. Checker by Per Viberg! llvm-svn: 194236
* [analyzer] Track whether an ObjC for-in loop had zero iterations.Jordan Rose2013-11-082-22/+216
| | | | | | | | | | | | | | | | | An Objective-C for-in loop will have zero iterations if the collection is empty. Previously, we could only detect this case if the program asked for the collection's -count /before/ the for-in loop. Now, the analyzer distinguishes for-in loops that had zero iterations from those with at least one, and can use this information to constrain the result of calling -count after the loop. In order to make this actually useful, teach the checker that methods on NSArray, NSDictionary, and the other immutable collection classes don't change the count. <rdar://problem/14992886> llvm-svn: 194235
* [analyzer] Specialize "loop executed 0 times" for for-in and for-range loops.Jordan Rose2013-11-083-24/+35
| | | | | | | | | | The path note that says "Loop body executed 0 times" has been changed to "Loop body skipped when range is empty" for C++11 for-range loops, and to "Loop body skipped when collection is empty" for Objective-C for-in loops. Part of <rdar://problem/14992886> llvm-svn: 194234
* ObjectiveC migrator. Fixes an obscure bug whereFariborz Jahanian2013-11-084-4/+276
| | | | | | | | NS_RETURNS_INNER_POINTER ends up unintentionally on the @property under -objcmt-migrate-all // rdar://15396636 llvm-svn: 194233
* ubsan: Only emit constants for filenames and type descriptors once.Will Dietz2013-11-083-6/+20
| | | | | | | | Produces neater IR in significantly less time. (~18% faster -O0 compile time for sqlite3 with -fsanitize=undefined) llvm-svn: 194231
* clang-format: Make breaking before ternary operators configurable.Daniel Jasper2013-11-085-16/+123
| | | | llvm-svn: 194229
* Eliminate an unnecessary .c_str()Douglas Gregor2013-11-081-1/+1
| | | | llvm-svn: 194228
* Adds the ability to inject a DiagnosticConsumer into ClangTools.Manuel Klimek2013-11-073-17/+63
| | | | llvm-svn: 194226
* Modules: Teach the preprocessor to recognize 'import' only after an '@'.Douglas Gregor2013-11-073-4/+20
| | | | | | | | | | | | The preprocessor currently recognizes module declarations to load a module based on seeing the 'import' keyword followed by an identifier. This sequence is fairly unlikely in C (one would need a type named 'import'), but is more common in Objective-C (where a variable named 'import' can cause problems). Since import declarations currently require a leading '@', recognize that in the preprocessor as well. Fixes <rdar://problem/15084587>. llvm-svn: 194225
* Re-instate contextual conversion to Objective-C pointers in message sends.Douglas Gregor2013-11-075-33/+134
| | | | | | | | | When performing an Objective-C message send to a value of class type, perform a contextual conversion to an Objective-C pointer type. We've had this for a long time, but it recently regressed. Fixes <rdar://problem/15234703>. llvm-svn: 194224
* Introduce MatchFinder::matchAST.Peter Collingbourne2013-11-074-12/+46
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2115 llvm-svn: 194223
* Re-introduce MatchFinder::addDynamicMatcher.Peter Collingbourne2013-11-074-2/+70
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2114 llvm-svn: 194222
* PR17800: When performing pack expansion, we must always rebuild the AST nodesRichard Smith2013-11-072-1/+18
| | | | | | | to avoid breaking AST invariants by reusing Stmt nodes within the same function. llvm-svn: 194217
* clang-format: Improve binary operator detection in macros.Daniel Jasper2013-11-072-1/+2
| | | | | | | | | | | | Before: #define M(NAME) assert(!Context.Verifying &&#NAME); After: #define M(NAME) assert(!Context.Verifying && #NAME); This fixes llvm.org/PR16156. llvm-svn: 194216
* Tests for CWG issue 165-170.Richard Smith2013-11-072-4/+58
| | | | llvm-svn: 194215
* clang-format: Improve ObjC variadic and binary expression parameters.Daniel Jasper2013-11-073-6/+17
| | | | | | | | | | | | | | | | | | | | | | Before: [self aaaaaaaaaaaaaaa:aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa]; [self aaaaaaaaaaaaaaa:aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa]; After: [self aaaaaaaaaaaaaaa:aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa]; [self aaaaaaaaaaaaaaa:aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa, aaaaaaaaaaaaaaa]; This addresses llvm.org/PR15349 and llvm.org/PR16185. llvm-svn: 194214
* PR17615: A delegating constructor initializer is a full-expression. Don'tRichard Smith2013-11-072-2/+16
| | | | | | forget to clean up temporaries at the end of it. llvm-svn: 194213
* Added a test case for the fix to bug 17632 in r193751Chris Wailes2013-11-071-0/+2
| | | | llvm-svn: 194212
* XFAIL the test for non-x86 targets for which this message cannot be generated.Richard Barton2013-11-071-0/+1
| | | | llvm-svn: 194211
* clang-format: Improve formatting of constructor initializers.Daniel Jasper2013-11-073-6/+16
| | | | | | | | | | | | | Before: Constructor() : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa(aaaa, aaaa)) {} After: Constructor() : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaa(aaaa, aaaa)) {} llvm-svn: 194210
* clang-format: Remove old hack that mainly made incorrect tests pass.Daniel Jasper2013-11-072-16/+27
| | | | | | | | As a side-effect, constructors definitions will correctly be recognized and formatted as function declarations. Tests will be added in a follow-up patch actually using the correct recognition. llvm-svn: 194209
* Remove an unnecessary condition that I added hastily: Unsigned numbers are ↵Faisal Vali2013-11-071-1/+1
| | | | | | | | obviously >= 0 ;) Also - others have complained about some white space issues - sorry about that - continues to be a pain point for me - will try and see what I can do with clang-format this evening after work - as a short term fix, if anyone can email me the files that they have already identified with issues, it would help me speed up a focused fix. sorry. llvm-svn: 194206
* clang-format: Fix corner case for brace alignment.Daniel Jasper2013-11-072-1/+8
| | | | | | | | | | | | | | | | Before: Constructor::Constructor() : some_value{ // aaaaaaa // } {} After: Constructor::Constructor() : some_value{ // aaaaaaa // } {} llvm-svn: 194204
* Minor refinement of VTableBuilder.h: fix wrong indentation, rename a struct ↵Timur Iskhodzhanov2013-11-073-18/+16
| | | | | | field with a more appropriate name llvm-svn: 194202
* Add parens for || in && in assert. No functionality change.Benjamin Kramer2013-11-071-2/+2
| | | | llvm-svn: 194200
* Ubuntu has published its Saucy release. 'Trusty Tahr' dev has just started. ↵Sylvestre Ledru2013-11-071-1/+3
| | | | | | Add its support in Clang llvm-svn: 194198
* Fixed bug in return type of __builtin_va_start().Enea Zaffanella2013-11-072-0/+8
| | | | llvm-svn: 194197
* Mark generic lambdas, and thus C++14, as complete. Add commented-out stub ↵Richard Smith2013-11-071-5/+16
| | | | | | for C++17. llvm-svn: 194194
* Tests for DR150 - DR165.Richard Smith2013-11-072-12/+126
| | | | llvm-svn: 194192
OpenPOWER on IntegriCloud