summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Recognize GNU attributes after 'enum class'. Fixes the libc++ build.John McCall2012-06-231-1/+8
| | | | llvm-svn: 159089
* objective-c: issue deprecation/unavailability warnings for methods called on Fariborz Jahanian2012-06-231-0/+3
| | | | | | id <Protocol>. // rdar://11618852 llvm-svn: 159084
* Support the tls_model attribute (PR9788)Hans Wennborg2012-06-235-7/+71
| | | | | | | | | | | | | | This adds support for the tls_model attribute. This allows the user to choose a TLS model that is better than what LLVM would select by default. For example, a variable might be declared as: __thread int x __attribute__((tls_model("initial-exec"))); if it will not be used in a shared library that is dlopen'ed. This depends on LLVM r159077. llvm-svn: 159078
* Clean up a large number of C++11 attribute parse issues, including parsingAlexis Hunt2012-06-237-37/+119
| | | | | | | | | | | | | | | | | | attributes in more places where we didn't and catching a lot more issues. This implements nearly every aspect of C++11 attribute parsing, except for: - Attributes are permitted on explicit instantiations inside the declarator (but not preceding the decl-spec) - Attributes are permitted on friend declarations of functions. - Multiple instances of the same attribute in an attribute-list (e.g. [[noreturn, noreturn]], not [[noreturn]] [[noreturn]] which is conforming) are allowed. The first two are marked as expected-FIXME in the test file and the latter is probably a defect and is currently untested. Thanks to Richard Smith for providing the lion's share of the testcases. llvm-svn: 159072
* Support L__FUNCTION__ in microsoft mode, PR11789Nico Weber2012-06-236-7/+106
| | | | | | | | | | Heavily based on a patch from Aaron Wishnick <aaron.s.wishnick@gmail.com>. I'll clean up the duplicated function in CodeGen as a follow-up, later today or tomorrow. llvm-svn: 159060
* [Windows] Fix mangling of repeated types in the presence of bool and ↵Timur Iskhodzhanov2012-06-231-22/+34
| | | | | | function pointers PR13176,PR13177 llvm-svn: 159059
* MicrosoftMangle: Fix mangling of integral constant non-type template ↵Charles Davis2012-06-231-1/+10
| | | | | | arguments in a class specialization. llvm-svn: 159056
* Minor improvements to some C99 variadic-macro-related diagnostics.Richard Smith2012-06-222-6/+8
| | | | llvm-svn: 159054
* Implement initial static analysis inlining support for C++ methods.Ted Kremenek2012-06-225-50/+68
| | | | llvm-svn: 159047
* Perform typo correction for base class specifiers.Kaelyn Uhrain2012-06-222-6/+10
| | | | llvm-svn: 159046
* [analyzer] Teach malloc checker that initWith[Bytes|Characters}NoCopy Anna Zaks2012-06-221-1/+3
| | | | | | relinquish memory. llvm-svn: 159043
* [analyzer] Remove a statistic - it's too expensive.Anna Zaks2012-06-221-6/+0
| | | | | | (Committed in r159038 by mistake.) llvm-svn: 159040
* [analyzer]scan-build: report the total number of steps analyzer performsAnna Zaks2012-06-221-0/+7
| | | | | | This would be useful to investigate performance issues. llvm-svn: 159038
* [analyzer] Fixup to r158958.Anna Zaks2012-06-221-2/+2
| | | | llvm-svn: 159037
* [analyzer] Report the cumulative number of steps the analyzer performs.Anna Zaks2012-06-221-0/+4
| | | | llvm-svn: 159036
* revert CodeGen support for the alloc_size attribute until we finish the ↵Nuno Lopes2012-06-221-19/+0
| | | | | | design of a more generic metadata node llvm-svn: 159016
* [analyzer] Check for +raise:format: on subclasses of NSException as well.Jordan Rose2012-06-221-36/+47
| | | | | | | | | | | We don't handle exceptions yet, so we treat them as sinks. ExprEngine hardcodes messages that are known to raise Objective-C exceptions like -raise, but it was only checking for +raise:format: and +raise:format:arguments: on NSException itself, not subclasses. <rdar://problem/11724201> llvm-svn: 159010
* Thread safety analysis: fixes a bug in which locksets are not handledDeLesley Hutchins2012-06-221-44/+50
| | | | | | | | properly if there is a join point in the control flow graph that involves a trylock. Also changes the source locations of some warnings to be more consistent. llvm-svn: 159008
* Show fixit for unqualified calls to methods of dependent basesNico Weber2012-06-221-28/+32
| | | | | | | | when the calling site is a member function template. Effectively reverts r111675. llvm-svn: 159004
* Add a warning about almost-Doxygen trailing comments: //< and /*< ... */Dmitri Gribenko2012-06-221-0/+18
| | | | llvm-svn: 159001
* Documentation cleanup: making \param and \returns docs match the code.James Dennett2012-06-222-9/+6
| | | | llvm-svn: 158985
* Documentation cleanup: making \param docs match the code.James Dennett2012-06-224-19/+8
| | | | llvm-svn: 158982
* Diagnostics cleanup: Fixing \params to match the code.James Dennett2012-06-223-30/+7
| | | | llvm-svn: 158981
* Documentation cleanup:James Dennett2012-06-224-15/+11
| | | | | | | | | | | | | | | * Primarily fixed \param commands with names not matching any actual parameters of the documented functions. In many cases this consists just of fixing up the parameter name in the \param to match the code, in some it means deleting obsolete documentation and occasionally it means documenting the parameter that has replaced the older one that was documented, which sometimes means some simple reverse-engineering of the docs from the implementation; * Fixed \param ParamName [out] to the correct format with [out] before the parameter name; * Fixed some \brief summaries. llvm-svn: 158980
* Documentation cleanup:James Dennett2012-06-221-49/+56
| | | | | | | | | * Add \brief summaries; * Escape # characters in Doxygen comments; * Add \code...\endcode markup for code examples; * Add \verbatim...\endverbatim markup for grammar productions. llvm-svn: 158976
* Documentation cleanup: Escape @objc* in Doxygen comments.James Dennett2012-06-221-24/+24
| | | | llvm-svn: 158974
* Documentation cleanup:James Dennett2012-06-221-2/+2
| | | | | | | * Use \p param for a parameter reference, not the (erroneous) form \arg param; * Escape # characters in Doxygen comments as needed. llvm-svn: 158971
* Documentation cleanup: escape # characters in Doxygen comments as needed.James Dennett2012-06-221-1/+1
| | | | llvm-svn: 158970
* Documentation cleanup: escape \ characters in Doxygen comments as needed.James Dennett2012-06-221-2/+2
| | | | llvm-svn: 158968
* Documentation cleanup: turn "//" into "///" for a Doxygen comment.James Dennett2012-06-221-3/+5
| | | | llvm-svn: 158965
* [analyzer] Malloc: Warn about use-after-free when memory ownership wasAnna Zaks2012-06-221-11/+73
| | | | | | transfered with dataWithBytesNoCopy. llvm-svn: 158958
* Revert r158887. This fixes pr13168.Rafael Espindola2012-06-214-378/+205
| | | | | | | | Revert "If an object (such as a std::string) with an appropriate c_str() member function" This reverts commit 7d96f6106bfbd85b1af06f34fdbf2834aad0e47e. llvm-svn: 158949
* Handle include directive with comments. It turns out that in this case ↵Dmitri Gribenko2012-06-211-7/+9
| | | | | | comments are not coming in source order. Instead of trying to std::sort() comments (which can be costly), just remove comments that are not in order. llvm-svn: 158940
* objective-c: If an ivar is (1) the first ivar in a root class and (2) named ↵Fariborz Jahanian2012-06-211-1/+14
| | | | | | | | `isa`, then it should get the same warnings that id->isa gets. // rdar://11702488 llvm-svn: 158938
* VC9 does not like heterogenous compare function objects.Dmitri Gribenko2012-06-212-2/+2
| | | | llvm-svn: 158936
* PR13165: False positive when initializing member data pointers with NULL.David Blaikie2012-06-211-2/+1
| | | | | | | | | This now correctly covers, I believe, all the pointer types: * 'any' pointers (both function and data normal pointers and ObjC object pointers) * member pointers (both function and data) * block pointers llvm-svn: 158931
* objective-c: deprecated C-like parameters in Objective-C Fariborz Jahanian2012-06-211-2/+5
| | | | | | | method declarations. // rdar://11578353. llvm-svn: 158929
* Adjust this code so that it strictly honorsJohn McCall2012-06-211-4/+6
| | | | | | | | TargetSimulatroVersionFromDefines if present; this also makes it easier to chain things correctly. Noted by an internal review. llvm-svn: 158926
* Improve support for -g options accepted by Clang:Alexey Samsonov2012-06-211-7/+5
| | | | | | | | 1. Accept flags -g[0-3], -ggdb[0-3], -gdwarf-[2-4] and collapse them to simple -g (except -g0/-ggdb0). 2. Produce driver error on unsupported formats (-gcoff, -gstabs, -gvms) and options (-gtoggle). 3. Recognize and ignore flags -g[no-]strict-dwarf, -g[no-]record-gcc-switches. llvm-svn: 158906
* Pretend that enum constants have enum type when inferring a block return type.Jordan Rose2012-06-211-3/+25
| | | | | | | | | | | | In C, enum constants have the type of the enum's underlying integer type, rather than the type of the enum. (This is not true in C++.) This leads to odd warnings when returning enum constants directly in blocks with inferred return types. The easiest way out of this is to pretend that, like C++, enum constants have enum type when being returned from a block. <rdar://problem/11662489> llvm-svn: 158899
* Don't warn for -Wstatic-in-inline if the used function is also inline.Jordan Rose2012-06-211-7/+15
| | | | | | | | | | | | | | | | | | Also, don't warn if the used function is __attribute__((const)), in which case it's not supposed to use global variables anyway. The inline-in-inline thing is a heuristic, and one that's possibly incorrect fairly often because the function being inlined could definitely use global variables. However, even some C standard library functions are written using other (trivial) static-inline functions in the headers, and we definitely don't want to be warning on that (or on anything that /uses/ these trivial inline functions). So we're using "inlined" as a marker for "fairly trivial". (Note that __attribute__((pure)) does /not/ guarantee safety like ((const), because ((const)) does not guarantee that global variables are not being used, and the warning is about globals not being shared across TUs.) llvm-svn: 158898
* MS: Mangle rvalue references and nullptr_t, and produce back-references whenRichard Smith2012-06-211-15/+48
| | | | | | appropriate. Patch by João Matos! llvm-svn: 158895
* Remove a goofy CMake hack and use the standard CMake facilities toChandler Carruth2012-06-2118-88/+194
| | | | | | | | | express library-level dependencies within Clang. This is no more verbose really, and plays nicer with the rest of the CMake facilities. It should also have no change in functionality. llvm-svn: 158888
* If an object (such as a std::string) with an appropriate c_str() member functionRichard Smith2012-06-214-205/+378
| | | | | | | | | | | | | | | is passed to a variadic function in a position where a format string indicates that c_str()'s return type is desired, provide a note suggesting that the user may have intended to call the c_str() member. Factor the non-POD-vararg checking out of DefaultVariadicArgumentPromotion and move it to SemaChecking in order to facilitate this. Factor the call checking out of function call checking and block call checking, and extend it to cover constructor calls too. Patch by Sam Panzer! llvm-svn: 158887
* Do not complain about junk on the end of a #endif in a skipped block. Such junkRichard Smith2012-06-211-1/+3
| | | | | | is permitted by all relevant language standards. Patch by Andy Gibbs! llvm-svn: 158883
* RawCommentList::addComment: fix the assertion so it actually checks that new ↵Dmitri Gribenko2012-06-211-1/+3
| | | | | | comment is after the last one (change Comments[0] to Comments.back()), and handle the case of two consecutive comments, e.g. /** *//* */. There is already a testcase for that (but it didn't trigger the assert because the assert itself was wrong). llvm-svn: 158882
* [analyzer] Malloc leak false positive: Allow xpc context to escape.Anna Zaks2012-06-201-0/+6
| | | | llvm-svn: 158875
* objc: tweak my last patch to warn if class extensionFariborz Jahanian2012-06-201-1/+1
| | | | | | has not overridden the property. // rdar://11656982 llvm-svn: 158871
* objective-c: Normally, a property cannot be both 'readonly' and having a Fariborz Jahanian2012-06-201-6/+80
| | | | | | | | | | "write" attribute (copy/retain/etc.). But, property declaration in primary class and protcols are tentative as they may be overridden into a 'readwrite' property in class extensions. Postpone diagnosing such warnings until the class implementation is seen. // rdar://11656982 llvm-svn: 158869
* Introduce ObjCRuntime::hasWeakClassImport() and use it in the appropriateJohn McCall2012-06-203-4/+5
| | | | | | | | | places. I've turned this off for the GNU runtimes --- I don't know if they support weak class import, but it's easy enough for them to opt in. Also tweak a comment per review by Jordan. llvm-svn: 158860
OpenPOWER on IntegriCloud