- Jun 22, 2015
-
-
Alexander Kornienko authored
The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240270 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 20, 2015
-
-
Douglas Gregor authored
These usually apply to the return type. At one point this was necessary to get some of them to apply to the entire block, but it appears that's working anyway (see block-return.c). rdar://problem/20468034 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240189 91177308-0d34-0410-b5e6-96231b3b80d8
-
Douglas Gregor authored
...instead of as a special case in ParseObjCTypeName with lots of duplicated logic. Besides being a nice refactoring, this also allows "- (instancetype __nonnull)self" in addition to "- (nonnull instancetype)self". rdar://problem/19924646 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240188 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 19, 2015
-
-
Douglas Gregor authored
Adds a new warning (under -Wnullability-completeness) that complains about pointer, block pointer, or member pointer declarations that have not been annotated with nullability information (directly or inferred) within a header that contains some nullability annotations. This is intended to be used to help maintain the completeness of nullability information within a header that has already been audited. Note that, for performance reasons, this warning will underrepresent the number of non-annotated pointers in the case where more than one pointer is seen before the first nullability type specifier, because we're only tracking one piece of information per header. Part of rdar://problem/18868820. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240158 91177308-0d34-0410-b5e6-96231b3b80d8
-
Douglas Gregor authored
Introduce the clang pragmas "assume_nonnull begin" and "assume_nonnull end" in which we make default assumptions about the nullability of many unannotated pointers: - Single-level pointers are inferred to __nonnull - NSError** in a (function or method) parameter list is inferred to NSError * __nullable * __nullable. - CFErrorRef * in a (function or method) parameter list is inferred to CFErrorRef __nullable * __nullable. - Other multi-level pointers are never inferred to anything. Implements rdar://problem/19191042. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240156 91177308-0d34-0410-b5e6-96231b3b80d8
-
Douglas Gregor authored
'null_resettable' properties are those whose getters return nonnull but whose setters take nil, to "reset" the property to some default. Implements rdar://problem/19051334. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240155 91177308-0d34-0410-b5e6-96231b3b80d8
-
Douglas Gregor authored
Introduce context-sensitive, non-underscored nullability specifiers (nonnull, nullable, null_unspecified) for Objective-C method return types, method parameter types, and properties. Introduce Objective-C-specific semantics, including computation of the nullability of the result of a message send, merging of nullability information from the @interface of a class into its @implementation, etc . This is the Objective-C part of rdar://problem/18868820. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240154 91177308-0d34-0410-b5e6-96231b3b80d8
-
Douglas Gregor authored
Introduces the type specifiers __nonnull, __nullable, and __null_unspecified that describe the nullability of the pointer type to which the specifier appertains. Nullability type specifiers improve on the existing nonnull attributes in a few ways: - They apply to types, so one can represent a pointer to a non-null pointer, use them in function pointer types, etc. - As type specifiers, they are syntactically more lightweight than __attribute__s or [[attribute]]s. - They can express both the notion of 'should never be null' and also 'it makes sense for this to be null', and therefore can more easily catch errors of omission where one forgot to annotate the nullability of a particular pointer (this will come in a subsequent patch). Nullability type specifiers are maintained as type sugar, and therefore have no effect on mangling, encoding, overloading, etc. Nonetheless, they will be used for warnings about, e.g., passing 'null' to a method that does not accept it. This is the C/C++ part of rdar://problem/18868820. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240146 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 18, 2015
-
-
Alexey Bataev authored
Added parsing, sema analysis and codegen for '#pragma omp taskgroup' directive (OpenMP 4.0). The code for directive is generated the following way: #pragma omp taskgroup <body> void __kmpc_taskgroup(<loc>, thread_id); <body> void __kmpc_end_taskgroup(<loc>, thread_id); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240011 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Marjamaki authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240008 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 16, 2015
-
-
Saleem Abdulrasool authored
MS attributes do not permit empty attribute blocks. Correctly diagnose those. We continue to parse to ensure that we recover correctly. Because the block is empty, we do not need to skip any tokens. Bonus: tweak the comment that I updated but forgot to remove the function name in a previous commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239846 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Sanders authored
Summary: This affects other tools so the previous C++ API has been retained as a deprecated function for the moment. Clang has been updated with a trivial patch (not covered by the pre-commit review) to avoid breaking -Werror builds. Other in-tree tools will be fixed with similar patches. This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. The first time this was committed it accidentally fixed an inconsistency in triples in llvm-mc and this caused a failure. This inconsistency was fixed in r239808. Reviewers: rengolin Reviewed By: rengolin Subscribers: llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10366 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239812 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 15, 2015
-
-
Saleem Abdulrasool authored
Switch to using BalancedDelimiterTracker to get better diagnostics for unbalanced delimiters. This still does not handle any of the attributes, simply improves the parsing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239758 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Sanders authored
It appears to cause sparc-little-endian.s to assert on Windows and Darwin. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239724 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Sanders authored
Summary: This affects other tools so the previous C++ API has been retained as a deprecated function for the moment. Clang has been updated with a trivial patch (not covered by the pre-commit review) to avoid breaking -Werror builds. Other in-tree tools will be fixed with similar trivial patches. This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. Reviewers: rengolin Reviewed By: rengolin Subscribers: llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10366 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239721 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 12, 2015
-
-
Tyler Nowicki authored
Specifying #pragma clang loop vectorize(assume_safety) on a loop adds the mem.parallel_loop_access metadata to each load/store operation in the loop. This metadata tells loop access analysis (LAA) to skip memory dependency checking. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239572 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
[modules] Fix assert/crash when parsing and merging a definition of a class with a base-specifier inside a namespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239569 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 09, 2015
-
-
Tyler Nowicki authored
When pragma clang loop unroll() is specified without an argument the diagnostic message should inform that user that 'full' and 'disable' are valid arguments (not 'enable'). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239363 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 26, 2015
-
-
Aaron Ballman authored
__declspec is not a core Clang language extension. Instead, require -fms-extensions or -fborland to enable the language extension. Note: __declspec is also temporarily enabled when compiling for a CUDA target because there are implementation details relying on __declspec(property) support currently. When those details change, __declspec should be disabled for CUDA targets. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238238 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 20, 2015
-
-
Aaron Ballman authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237835 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 18, 2015
-
-
Richard Smith authored
[modules] Support for merging a parsed class template specialization definition into an imported but hidden definition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237612 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 17, 2015
-
-
Nico Weber authored
In -fdelayed-template-parsing mode, templates that aren't used are not parsed at all. For some diagnostic plugins, this is a problem since they want to analyse the contents of the template function body. What has been suggested on cfe-dev [1] is to explicitly parse interesting templates in HandleTranslationUnit(); IWYU does this for example [2]. This is workable, but since the delayed parsing doesn't run below a call to ParseTopLevelDecl(), no DestroyTemplateIdAnnotationsRAIIObj object is on the stack to clean up TemplateIds that are created during parsing. To fix this, let ~Parser() clean them up in delayed template parsing mode instead of leaking (or asserting in +Assert builds). (r219810, relanded in r220400, fixed the same problem in incremental processing mode; the review thread of r219810 has a good discussion of the problem.) To test this, give the PrintFunctionNames plugin a flag to force parsing of a template and add a test that uses it in -fdelayed-template-parsing mode. Without the Parser.cpp change, that test asserts. 1: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-August/038415.html 2: https://code.google.com/p/include-what-you-use/source/detail?r=566 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237531 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 15, 2015
-
-
Richard Smith authored
With this change, enabling -fmodules-local-submodule-visibility results in name visibility rules being applied to submodules of the current module in addition to imported modules (that is, names no longer "leak" between submodules of the same top-level module). This also makes it much safer to textually include a non-modular library into a module: each submodule that textually includes that library will get its own "copy" of that library, and so the library becomes visible no matter which including submodule you import. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237473 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 12, 2015
-
-
Richard Trieu authored
Previously, if a semi-colon is unexpectedly added before a closing ')', ']' or '}', two errors and one note would emitted, and the parsing would get confused to which scope it was in. This change consumes the semi-colon, recovers parsing better, and emits only one error with a fix-it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237192 91177308-0d34-0410-b5e6-96231b3b80d8
-
Steven Wu authored
Empty assembly string will not introduce assembly code in the output binary and it is often used as a trick in the header to disable optimizations. It doesn't conflict with the purpose of the option so it is allowed with -fno-gnu-inline-asm flag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237073 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
PR20625: Instantiate static constexpr member function of a local struct in a function template earlier. This is necessary in order to allow the use of a constexpr member function, or a member function with deduced return type, of a local class within a surrounding instantiated function template specialization. Patch by Michael Park! This re-commits r236063, which was reverted in r236134, along with a fix for a delayed template parsing bug that was exposed by this change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237064 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 11, 2015
-
-
Steven Wu authored
Summary: AsmLabel is heavily used in system level and firmware to redirect function and access platform specific labels. They are also extensively used in system headers which makes this option unusable for many users. Since AsmLabel doesn't introduce any assembly code into the output binary, it shouldn't be considered as inline-asm. Reviewers: bob.wilson, rnk Reviewed By: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D9679 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237048 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 08, 2015
-
-
Alexey Bataev authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236821 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 07, 2015
-
-
Richard Smith authored
[modules] Suport for merging a parsed enum definition into an existing imported but not visible definition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236690 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 05, 2015
-
-
Kaelyn Takata authored
This is needed to prevent a TypoExpr from being corrected to a variable when the TypoExpr is a subexpression of that variable's initializer. Also exclude more keywords from the correction candidate pool when the subsequent token is .* or ->* since keywords like "new" or "return" aren't valid on the left side of those operators. Fixes PR23140. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236519 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alexey Bataev authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236493 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 02, 2015
-
-
Kaelyn Takata authored
unmatched l_paren before setting the LHS to ExprError(). Fixes PR23285. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236371 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 01, 2015
-
-
Kaelyn Takata authored
The LHS was already being corrected before being set to ExprError when the RHS is invalid, but when it was present the middle of a ternary expression would be dropped in the error paths. Fixes PR23350. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236347 91177308-0d34-0410-b5e6-96231b3b80d8
-
Kaelyn Takata authored
This is needed to ensure the type casts are parsed properly. Fixes PR23101. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236337 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 30, 2015
-
-
Jordan Rose authored
That way we can take any trailing availability attributes into account. rdar://problem/20713550 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236241 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alexey Bataev authored
For proper codegen we need to capture variable in the OpenMP region. In loop-based directives loop control variables are private by default and they must be captured in this region. There was a problem with capturing of globals, used as lcv, as they was not marked as private by default. Differential Revision: http://reviews.llvm.org/D9336 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236201 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 29, 2015
-
-
Steven Wu authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236051 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 28, 2015
-
-
Steven Wu authored
Summary: FileScopeAsm should be treated the same as funcion level inline asm. -fno-gnu-inline-asm should trigger an error if file scope asm is used. I missed this case from r226340. This should not affect ms-extension because it is not allowed in the file scope. Reviewers: bob.wilson, rnk Reviewed By: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D9328 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236044 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 20, 2015
-
-
Reid Kleckner authored
We already check that statement expressions are in a function or block, but we didn't do anything with that information. Now we use that DeclContext for the duration of the statement expression. Otherwise, we'd treat statement expression locals as static data members and go into the weeds. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235335 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 19, 2015
-
-
Argyrios Kyrtzidis authored
in the context of the container itself. Otherwise we will emit 'unavailable' errors when referencing an unavailable super class even though the subclass is also marked 'unavailable'. rdar://20598702 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235276 91177308-0d34-0410-b5e6-96231b3b80d8
-