summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Provide a fixit hint for changing '->' to '.' if there is no operator->Kaelyn Uhrain2013-07-112-4/+23
| | | | | | defined for a class. llvm-svn: 186128
* Make CXXBaseSpecifier::getType return unqual type.Eli Friedman2013-07-112-1/+13
| | | | | | | | | | | Various pieces of code, like base initialization in Sema and RTTI IRGen, don't properly ignore qualifiers on base classes. Instead of auditing the whole codebase, just strip them off in the getter. (The type as written is still available in the TypeSourceInfo for code that cares.) Fixes PR16596. llvm-svn: 186125
* clang-format: Fix bug concerning the alignment of "}".Daniel Jasper2013-07-112-1/+8
| | | | | | | | | | | | | | | | 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-112-2/+12
| | | | | | | | | | | | | | (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-113-10/+48
| | | | | | | | | | | | | | | | | 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-112-3/+3
| | | | | | | 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-113-9/+8
| | | | llvm-svn: 186106
* ObjectiveC arc[qoi]: When due to change of certain methods'Fariborz Jahanian2013-07-115-7/+60
| | | | | | | | result type, a diagnostic being issued, issue a 'note' mentioning reason behind the unexpected warning. // rdar://14121570. llvm-svn: 186105
* Improve detection of trailing return types.Daniel Jasper2013-07-112-1/+5
| | | | | | | | | | | | Trailing return types can only occur in declaration contexts. Before: void f() { auto a = b -> c(); } After: void f() { auto a = b->c(); } llvm-svn: 186087
* Fix indentation problem for comments in call chainsDaniel Jasper2013-07-112-1/+5
| | | | | | | | | | | | | | Before: SomeObject // Calling someFunction on SomeObject .someFunction(); After: SomeObject // Calling someFunction on SomeObject .someFunction(); llvm-svn: 186085
* Keep trailing annotations close to their argument.Daniel Jasper2013-07-112-0/+6
| | | | | | | | | | | | Before: bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa GUARDED_BY( aaaaaaaaaaaa); After: bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa GUARDED_BY(aaaaaaaaaaaa); llvm-svn: 186077
* PR5066: If a declarator cannot have an identifier, and cannot possibly beRichard Smith2013-07-117-1/+59
| | | | | | | | | followed by an identifier, then diagnose an identifier as being a bogus part of the declarator instead of tripping over it. Improves diagnostics for cases like std::vector<const int *p> my_vec; llvm-svn: 186061
* Documentation fixes - the rest of DeclCXX.h:James Dennett2013-07-111-114/+130
| | | | | | | | | * More \brief additions/fixes; * Fix some misleading comments about C++11's explicit conversion operators; * Mark up some \code examples; * Add \file documentation. llvm-svn: 186059
* Documentation cleanup for DeclCXX.h:James Dennett2013-07-111-179/+197
| | | | | | | | | * Fixing up \brief summaries (adding some, making some briefer); * Standardizing on \commands, not @commands; * Update C++0x references to C++11; * Fix typos and Doxygen warnings. llvm-svn: 186056
* clang/test/CodeGen/c11atomics.c: Fix testcase for -Asserts since r186054.NAKAMURA Takumi2013-07-111-1/+1
| | | | llvm-svn: 186055
* Fix build.Eli Friedman2013-07-111-2/+2
| | | | | | Sorry about that. llvm-svn: 186054
* Add a __builtin_addressof that performs the same functionality as the built-inRichard Smith2013-07-117-2/+71
| | | | | | | | | | | & operator (ignoring any overloaded operator& for the type). The purpose of this builtin is for use in std::addressof, to allow it to be made constexpr; the existing implementation technique (reinterpret_cast to some reference type, take address, reinterpert_cast back) does not permit this because reinterpret_cast between reference types is not permitted in a constant expression in C++11 onwards. llvm-svn: 186053
* Make CheckAddressOfOperand a member of Sema so it can be reused byRichard Smith2013-07-112-35/+36
| | | | | | __builtin_addressof. llvm-svn: 186052
* Simplify atomic load/store IRGen.Eli Friedman2013-07-116-149/+71
| | | | | | Also fixes a couple minor bugs along the way; see testcases. llvm-svn: 186049
* Fix some grammar errors.Richard Smith2013-07-111-4/+4
| | | | llvm-svn: 186048
* Fix documentation:Richard Smith2013-07-111-5/+11
| | | | | | | | | | | | | | #if defined(__has_foo("X")) && __has_foo("X") is not a correct way to portably use __has_foo, because it is expanded to #if 0 && 0("X") ... which is ill-formed. Also add a missing ')'. llvm-svn: 186047
* If we friend a declaration twice, that should not make it visible to nameRichard Smith2013-07-108-28/+66
| | | | | | | | | 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: 186040
* ObjC migrator: Improve on hueristics.Fariborz Jahanian2013-07-105-13/+57
| | | | | | | | | | | | migrate to 'copy attribute if Object class implements NSCopying otherwise assume implied 'strong'. Remove lifetime qualifier on property as it has moved to property's attribute. Added TODO comment for future work by poking into setter implementation. llvm-svn: 186037
* Use a LexicalScope here since it is one and it will encapsulateEric Christopher2013-07-101-12/+2
| | | | | | the two sets of debug scope and cleanup scope. llvm-svn: 186030
* [analyzer] Remove bogus assert: in C++11, 'new' can do list-initialization.Jordan Rose2013-07-102-2/+10
| | | | | | | | | | | | | | Previously, we asserted that whenever 'new' did not include a constructor call, the type must be a non-record type. In C++11, however, uniform initialization syntax (braces) allow 'new' to construct records with list-initialization: "new Point{1, 2}". Removing this assertion should be perfectly safe; the code here matches what VisitDeclStmt does for regions allocated on the stack. <rdar://problem/14403437> llvm-svn: 186028
* Add a hook RecursiveASTVisitor::TraverseLambdaBody, to enable visitors toJames Dennett2013-07-102-2/+42
| | | | | | | | | | | | | | | | use/maintain additional state from the LambdaExpr while visiting the body of a LambdaExpr. One use for this arises because Clang's AST currently holds lambda bodies in a form prior to their adjustment to refer to captured copies of local variables, and so some clients will need access to the lambda's closure type in order to query how to map VarDecl*s to the FieldDecls of their by-copy captures. This hook is sufficient for at least one such client; to do this without such a hook would require the client to re-implement the whole of TraverseLambdaExpr, which is non-trivial and would likely be more brittle. llvm-svn: 186024
* Offer typo suggestions for 'using' declarations.Kaelyn Uhrain2013-07-103-4/+152
| | | | | | Patch courtesy of Luke Zarko <zarko@google.com> llvm-svn: 186019
* Add experimental flag for adaptive parameter bin-packing.Daniel Jasper2013-07-105-12/+100
| | | | | | | | | | | | | | | | | | | | | | | | | This is not activated for any style, might change or go away completely. For those that want to play around with it, set ExperimentalAutoDetectBinPacking to true. clang-format will then: Look at whether function calls/declarations/definitions are currently formatted with one parameter per line (on a case-by-case basis). If so, clang-format will avoid bin-packing the parameters. If all parameters are on one line (thus that line is "inconclusive"), clang-format will make the choice dependent on whether there are other bin-packed calls/declarations in the same file. The reason for this change is that bin-packing in some situations can be really bad and an author might opt to put one parameter on each line. If the author does that, he might want clang-format not to mess with that. If the author is unhappy with the one-per-line formatting, clang-format can easily be convinced to bin-pack by putting any two parameters on the same line. llvm-svn: 186003
* Fixed comment of Sema::FindInstantiatedDecl.Serge Pavlov2013-07-101-5/+5
| | | | llvm-svn: 185997
* Finish off mangling locals in block literals.Eli Friedman2013-07-102-8/+26
| | | | | | | Specifically, handle the case where the block is in a default argument in a class method. The mangling here follows what we do for lambdas. llvm-svn: 185991
* Get rid of dead/useless code for block mangling.Eli Friedman2013-07-104-40/+8
| | | | llvm-svn: 185989
* More local mangling fixes.Eli Friedman2013-07-1011-79/+176
| | | | | | | | | | | | Compute mangling numbers for externally visible local variables and tags. Change the mangler to consistently use discriminators where necessary. Tweak the scheme we use to number decls which are not externally visible to avoid unnecessary discriminators in common cases now that we request them more consistently. Fixes <rdar://problem/14204721>. llvm-svn: 185986
* objc migrator: More refinment of propertyFariborz Jahanian2013-07-102-14/+14
| | | | | | | attributes in migration. Specialli use of 'copy' attribute for retainable object types. llvm-svn: 185985
* Apply BlackList -> SpecialCaseList rename in Clang.Peter Collingbourne2013-07-091-3/+3
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1095 llvm-svn: 185979
* Objective-C: merge objc_requires_super attribute ofFariborz Jahanian2013-07-092-4/+36
| | | | | | | | | method declaration into its implementation to prevent a bogus warning about mismatched attributes. then make sure the warning about missing call to super comes out of the method implementation. // rdar://14251387 llvm-svn: 185974
* Reapply an improved version of r180816/180817.Adrian Prantl2013-07-092-18/+1
| | | | | | | | | | | Do not generate VLAs as complex variables any more, as they are now correctly represented as breg+0 locations in the backend. (Paired commit with LLVM: r185966) rdar://problem/13658587 llvm-svn: 185967
* ObjC migrator: Add -objcmt-migrate-property to do propertyFariborz Jahanian2013-07-099-14/+33
| | | | | | | migration. Also, fixes an old bug where older migration flags were not being checked for properly. llvm-svn: 185948
* Initial support for formatting trailing return types.Daniel Jasper2013-07-094-3/+23
| | | | | | | | | | | | This fixes llvm.org/PR15170. For now, the basic formatting rules are (based on the C++11 standard): * Surround the "->" with spaces. * Break before "->". Also fix typo. llvm-svn: 185938
* ArrayRef'ize Sema::FinalizeDeclaratorGroup, Sema::BuildDeclaratorGroup andRafael Espindola2013-07-098-43/+37
| | | | | | | | Sema::ActOnDocumentableDecls. Patch by Robert Wilhelm. llvm-svn: 185931
* Avoid confusing indentations for chained function calls.Daniel Jasper2013-07-092-5/+28
| | | | | | | | | | | | | | | | | | | Basically treat a function with a trailing call similar to a function with multiple parameters. Before: aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaa)) .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(); After: aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaa)) .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(); Also fix typo. llvm-svn: 185930
* c-index-test/CMakeLists.txt: Suggest -isystem to include libxml2 with ↵NAKAMURA Takumi2013-07-091-1/+1
| | | | | | include_directories(SYSTEM). llvm-svn: 185928
* c-index-test/Makefile: Use -isystem instead of -I on $(LIBXML2_INC) with ↵NAKAMURA Takumi2013-07-091-0/+8
| | | | | | | | | -Wdocumentation. -Wdocumentation won't seek -isystem. LIBXML2's headers in a certain distro might be incompatible to -Wdocumentation. FIXME: Could autoconf detect clang or availability of -isystem? llvm-svn: 185927
* Fix alignment of closing brace in braced initializers.Daniel Jasper2013-07-095-33/+43
| | | | | | | | | | | | | | | | | | | | | | Before: someFunction(OtherParam, BracedList{ // comment 1 (Forcing intersting break) param1, param2, // comment 2 param3, param4 }); After: someFunction(OtherParam, BracedList{ // comment 1 (Forcing intersting break) param1, param2, // comment 2 param3, param4 }); To do so, the UnwrappedLineParser now stores the information about the kind of brace in the FormatToken. llvm-svn: 185914
* Format overloaded operators like other functions.Daniel Jasper2013-07-093-5/+15
| | | | | | | | | | | | | | This fixes llvm.org/PR16328 (at least partially). Before: SomeLoooooooooooooooooooooooooooooogType operator<<( const SomeLooooooooogType &a, const SomeLooooooooogType &b); After: SomeLoooooooooooooooooooooooooooooogType operator<<(const SomeLooooooooogType &a, const SomeLooooooooogType &b); llvm-svn: 185908
* [analyzer] Fixup for r185609: actually do suppress warnings coming out of ↵Anna Zaks2013-07-092-5/+11
| | | | | | | | | | | std::list. list is the name of a class, not a namespace. Change the test as well - the previous version did not test properly. Fixes radar://14317928. llvm-svn: 185898
* Fix recovery for missing * in objc property.Eli Friedman2013-07-092-2/+18
| | | | | | <rdar://problem/14354144> llvm-svn: 185897
* Don't give # and ## special treatment when in -traditional-cpp mode. Patch byRichard Smith2013-07-092-0/+29
| | | | | | Austin Seipp! llvm-svn: 185896
* Generalize hack allowing 'const' in __has_attribute (etc) to allow any tokenRichard Smith2013-07-092-3/+5
| | | | | | | with identifier info. This covers most identifier-like entities (other than the ISO646 keywords). llvm-svn: 185895
* Fix crash typo-correcting dependent member func.Eli Friedman2013-07-082-1/+5
| | | | | | PR16561. llvm-svn: 185887
* ObjC migration: more test for migration toFariborz Jahanian2013-07-082-0/+38
| | | | | | properties. llvm-svn: 185884
OpenPOWER on IntegriCloud