summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix alignment of class derived from empty class.Eli Friedman2013-07-161-3/+4
| | | | | | | | | The record layout code didn't properly take into account that an empty class at offset 0 can have an alignment greater than 1. Patch by Andrea Di Biagio. llvm-svn: 186370
* ObjC migrator: build conforming interfaceFariborz Jahanian2013-07-162-1/+48
| | | | | | declaration (not yet used). wip. llvm-svn: 186369
* Fix member refs with using decl + anonymous union.Eli Friedman2013-07-161-10/+14
| | | | | | | | | | Make sure we call BuildFieldReferenceExpr with the appropriate decl when a member of an anonymous union is made public with a using decl. Also, fix a crash on invalid field access into an anonymous union. Fixes PR16630. llvm-svn: 186367
* ObjC migrator: finding conforming protocolFariborz Jahanian2013-07-152-2/+76
| | | | | | candidates for each class. wip. llvm-svn: 186349
* Move the "->" to "." fixit from r186128 into a separate note sinceKaelyn Uhrain2013-07-151-5/+3
| | | | | | | | recovery is not attempted with the fixit. Also move the associated test case from FixIt/fixit.cpp to SemaCXX/member-expr.cpp since the fixit is no longer automatically applied. llvm-svn: 186342
* Add support for type traversal matchers.Samuel Benzaquen2013-07-152-30/+20
| | | | | | | | | | | | | | | Summary: Fixup the type traversal macros/matchers to specify the supported types. Make the marshallers a little more generic to support any variadic function. Update the doc script. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1023 llvm-svn: 186340
* Re-revert r86040, which was un-reverted in r186199.Chandler Carruth2013-07-154-21/+25
| | | | | | | | | | | | | | | This breaks the build of basic patterns with repeated friend declarations. See the added test case in SemaCXX/friend.cpp or the test case reported to the original commit log. Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. llvm-svn: 186331
* clang-format: Improve c-style cast detection.Daniel Jasper2013-07-151-2/+3
| | | | | | | | | | | Before: #define x ((int) - 1) #define p(q) ((int *) & q) After: #define x ((int)-1) #define p(q) ((int *)&q) llvm-svn: 186324
* Improvement of change r186320.Daniel Jasper2013-07-152-8/+8
| | | | | | | | | | | | | | | | Fixed a test that by now passed for the wrong reason. Before: llvm::outs() << "aaaaaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaa); After: llvm::outs() << "aaaaaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaa); Also reformatted Format.cpp with the latest changes (1 formatting fix and 1 layout change of a <<-chain). llvm-svn: 186322
* Improve formatting of operator<< chains.Daniel Jasper2013-07-152-2/+2
| | | | | | | | | | | | | Before: llvm::outs() << "aaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaaaaa << "aaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaaaaa << "aaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaaaaa; After: llvm::outs() << "aaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaaaaa << "aaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaaaaa << "aaaaaaaaaaaaaaaa: " << aaaaaaaaaaaaaaaa; llvm-svn: 186320
* Replacing an empty switch with its moral equivalent. No functional changes ↵Aaron Ballman2013-07-151-7/+3
| | | | | | intended. llvm-svn: 186318
* Add 'static' and 'const' qualifiers to some arrays of strings.Craig Topper2013-07-154-7/+7
| | | | llvm-svn: 186314
* Fix to PR12262 - assertion when substituting explicit template argumentsSerge Pavlov2013-07-152-0/+13
| | | | | | | | does not substitute a sizeof-pack expression. The solution is proposed by Richard Smith. Differential Revision: http://llvm-reviews.chandlerc.com/D869 llvm-svn: 186306
* Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).Craig Topper2013-07-158-14/+16
| | | | llvm-svn: 186300
* Reformat line.Eric Christopher2013-07-141-2/+1
| | | | llvm-svn: 186294
* Move BlockLiteralGeneric earlier in CGDebugInfo and removeEric Christopher2013-07-142-8/+4
| | | | | | | BlockLiteralGenericSet and replace with a call to isType() on the BlockLiteralGeneric. llvm-svn: 186293
* Update a few comments and reformat a decl for clarity.Eric Christopher2013-07-141-3/+4
| | | | llvm-svn: 186292
* Replace C++0x in a comment with C++11Craig Topper2013-07-141-1/+1
| | | | llvm-svn: 186287
* Change cxx0x to cxx11 in diagnostic name.Craig Topper2013-07-141-1/+1
| | | | llvm-svn: 186286
* Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector ↵Craig Topper2013-07-142-3/+3
| | | | | | size. llvm-svn: 186284
* Add missing include guards into headers in lib/Headers. While it may appearRichard Smith2013-07-144-0/+19
| | | | | | | | | | | | | | | | that these headers should not be included more than once, they are in fact included twice when building our builtins module (in order for it to generate submodules for them), and without this, any modular build enabling AVX and including any builtin header fails. Testing this is tricky because including any of these headers in a modular build is liable to fail, due to unrelated builtin headers in the same module including headers which might not be available on the system running the tests. Suggestion on that front are welcome (but we're getting close to being able to run a buildbot that has modules enabled for all tests, which would nicely solve the testing problem). llvm-svn: 186275
* If an unimported submodule of an imported module contains a declaration of aRichard Smith2013-07-141-1/+5
| | | | | | | global allocation or deallocation function, that should not cause that global allocation or deallocation function to become unavailable. llvm-svn: 186270
* Serialization support for TagDecl::IsCompleteDefinitionRequiredDavid Blaikie2013-07-142-0/+4
| | | | | | Requested by Richard Smith in post-commit review of r186262 llvm-svn: 186266
* PR16214, PR14467: DebugInfo: use "RequireCompleteType" to decide when to ↵David Blaikie2013-07-137-35/+28
| | | | | | | | | | | | | | | emit the full definition of a type in -flimit-debug-info This simplifies the core benefit of -flimit-debug-info by taking a more systematic approach to avoid emitting debug info definitions for types that only require declarations. The previous ad-hoc approach (3 cases removed in this patch) had many holes. The general approach (adding a bit to TagDecl and callback through ASTConsumer) has been discussed with Richard Smith - though always open to revision. llvm-svn: 186262
* Correctly classify pack expansions as NON_CANONICAL_UNLESS_DEPENDENTDavid Blaikie2013-07-132-0/+2
| | | | | | | | | | | Test coverage for non-dependent pack expansions doesn't demonstrate a failure prior to this patch (a follow-up commit improving debug info will cover this commit specifically) but covers a related hole in our test coverage. Reviewed by Richard Smith & Eli Friedman. llvm-svn: 186261
* Simplify getTypeInfoImpl handling of 'non-canonical unless dependent' types.David Blaikie2013-07-131-26/+4
| | | | | | | | | These types are not dependent in this context, so just look through the sugar. Review by Richard Smith & Eli Friedman. llvm-svn: 186260
* Fixes a typo caught by Arthur O'DwyerFariborz Jahanian2013-07-131-2/+2
| | | | llvm-svn: 186249
* C++ modules: Don't call DeclContext::lookup when half-way through deserializingRichard Smith2013-07-132-18/+58
| | | | | | | decls. That can reenter deserialization and explode horribly by trying to merge a declaration that we've not got very far through deserializing yet. llvm-svn: 186236
* [ms-cxxabi] Don't consider function templates for name backrefsReid Kleckner2013-07-131-1/+10
| | | | | | | | | | | | | | They don't seem to be used for back references, presumably because a function template is unlikely to reoccur, while a class template name may reoccur as a type. This fixes a mangling issue for llvm::hash_combine() in Hashing.h. Reviewers: timurrrr Differential Revision: http://llvm-reviews.chandlerc.com/D1078 llvm-svn: 186233
* ObjC migrator: More knobs for migratingFariborz Jahanian2013-07-131-3/+19
| | | | | | conforming protocols to each class. wip. llvm-svn: 186231
* ObjC migrator: early work for migrating implicitly conformingFariborz Jahanian2013-07-121-1/+30
| | | | | | protocols to classes. This is wip. llvm-svn: 186220
* Changes so that a few tests do not fail when running under guarded malloc.Argyrios Kyrtzidis2013-07-122-7/+7
| | | | | | | Guarded malloc emits some messages at the beginning in stderr when enabled. These messages caused a few tests to fail. llvm-svn: 186219
* Use function attributes to pass along the stack protector buffer size ↵Bill Wendling2013-07-122-1/+2
| | | | | | instead of making it a target option. llvm-svn: 186218
* Compute 'this' correctly for block in lambda.Eli Friedman2013-07-121-8/+3
| | | | | | | | | Using CurFuncDecl is both correct and simple compared to crawling the DeclContexts of the block. Fixes <rdar://problem/14415072>. llvm-svn: 186210
* Provide a better diagnostic and a fixit for a '.' or '->' before the left parenKaelyn Uhrain2013-07-121-1/+13
| | | | | | | | of a function call. This fixes PR5898 and means we now have a better diagnostic here than GCC. llvm-svn: 186208
* Unrevert r186040, reverted in r186185, with fix for PR16597.Richard Smith2013-07-124-25/+21
| | | | | | | | | | | Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. llvm-svn: 186199
* Revert r186040 to fix PR16597 while Richard investigates what the bestChandler Carruth2013-07-124-21/+25
| | | | | | | | | | | | | fix is. Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. llvm-svn: 186185
* fixes a typo caught by Jordan.Fariborz Jahanian2013-07-121-1/+1
| | | | llvm-svn: 186171
* Objective-C: Produce gcc compatible encoding ofFariborz Jahanian2013-07-121-0/+14
| | | | | | | ivar type in meta-data while preventing recursive encoding in a corner case. // rdar://14408244 llvm-svn: 186169
* clang-format: Improve <<-formatting.Daniel Jasper2013-07-121-0/+5
| | | | | | | | | | | | | | | | This fixes a regression caused by r186115. Before: Diag(aaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbb) << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; After: Diag(aaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbb) << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; llvm-svn: 186164
* clang-format: Fix string literal breaking.Daniel Jasper2013-07-121-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | Before this patch, it did not cooperate with Style::AlwaysBreakBeforeMultilineStrings. Thus, it would turn aaaaaaaaaaaa(aaaaaaaaaaaaa, "aaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa"); into: aaaaaaaaaaaa(aaaaaaaaaaaaa, "aaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa " "aaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa"); and only a second format step would lead to the desired (with that option): aaaaaaaaaaaa(aaaaaaaaaaaaa, "aaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa " "aaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa"); This could even lead to clang-format breaking the string at a different character and thus leading to a completely different end result. llvm-svn: 186154
* clang-format: Break before/between array subscript expressions.Daniel Jasper2013-07-122-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | clang-format used to treat array subscript expressions much like function call (just replacing () with []). However, this is not really appropriate especially for expressions with multiple subscripts. Although it might seem counter-intuitive, the most consistent solution seems to be to always (if necessary) break before a square bracket, never after it. Also, multiple subscripts of the same expression should be aligned if they are on subsequent lines. Before: aaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaaaa][ bbbbbbbbbbbbbbbbbbbbbbbbb] = c; aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa][ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb] = ccccccccccc; After: aaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaaaa] [bbbbbbbbbbbbbbbbbbbbbbbbb] = c; aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] [bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb] = ccccccccccc; llvm-svn: 186153
* [analyzer] Add support for __builtin_addressof.Jordan Rose2013-07-121-1/+4
| | | | | | ...so we don't regress on std::addressof. llvm-svn: 186140
* Fix crash on zero-argument assignment operator.Eli Friedman2013-07-112-3/+6
| | | | | | | Make sure we don't crash when checking whether an assignment operator without any arguments is a special member. <rdar://problem/14397774>. llvm-svn: 186137
* Provide a fixit hint for changing '->' to '.' if there is no operator->Kaelyn Uhrain2013-07-111-4/+11
| | | | | | defined for a class. llvm-svn: 186128
* clang-format: Fix bug concerning the alignment of "}".Daniel Jasper2013-07-111-1/+1
| | | | | | | | | | | | | | | | Before: int i; // indented 2 space more than clang-format would use. SomeReturnType // clang-format invoked on this line. SomeFunctionMakingLBraceEndInColumn80() { } // This is the indent clang-format would prefer. After: int i; // indented 2 space more than clang-format would use. SomeReturnType // clang-format invoked on this line. SomeFunctionMakingLBraceEndInColumn80() { } llvm-svn: 186120
* clang-format: Break before trailing annotations.Daniel Jasper2013-07-111-2/+4
| | | | | | | | | | | | | | (if they are not function-like). Before: SomeFunction(aaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaa) OVERRIDE; After: SomeFunction(aaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaa) OVERRIDE; llvm-svn: 186117
* clang-format: Avoid line breaks before the first <<.Daniel Jasper2013-07-111-9/+27
| | | | | | | | | | | | | | | | | This puts a slight penalty on the linebreak before the first "<<", so that clang-format generally tries to keep things on the first line. User feedback has shown that this is generally desirable. Before: llvm::outs() << "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =" << aaaaaaaaaaaaaaaaaaaaaaaaaaa; After: llvm::outs() << "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =" << aaaaaaaaaaaaaaaaaaaaaaaaaaa; llvm-svn: 186115
* Restore warning to its original text whenFariborz Jahanian2013-07-111-1/+1
| | | | | | | certain familiy of methods have the wrong type. // rdar://14408244 llvm-svn: 186111
* Simplify GetBuiltinNames by hoising the NoBuiltins argument out of it.Eli Bendersky2013-07-112-6/+6
| | | | llvm-svn: 186106
OpenPOWER on IntegriCloud