- 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
-
Saleem Abdulrasool authored
The same pattern was repeated a few times. Create a trivial helper method to map the Type Specifier to an ID for the diagnostic. Flip the selection order on one of the diagnostic messages to get the same ordering across all of the messages. This makes the emission of the diagnostic slightly more legible by changing the cascading ternary into a switch in a function. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240251 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 21, 2015
-
-
Nico Weber authored
Move /Qvec flags from the "// Non-aliases:" section up to the "// Aliases:" section since the flags are just aliases. For the same reason, move the /vm flags the other way. Also reflow a few lines to 80 columns. No behavior change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240248 91177308-0d34-0410-b5e6-96231b3b80d8
-
Justin Bogner authored
This is a better approach to fixing the undefined behaviour I tried to fix in r240228. This data doesn't necessarily have suitable alignment for uint64_t, so use unaligned_uint64_t instead. This fixes 225 test failures when clang is built with ubsan. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240247 91177308-0d34-0410-b5e6-96231b3b80d8
-
Justin Bogner authored
We can do this better by changing the type to unaligned_uint64_t and paying the cost on use instead of up front. This reverts r240228 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240246 91177308-0d34-0410-b5e6-96231b3b80d8
-
Justin Bogner authored
We interpret Blob as an array of uint64_t here, but there's no reason to think that it has suitable alignment. Instead, read the data in in an alignment-safe way and store it in a std::vector. This fixes 225 test failures when clang is built with ubsan. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240228 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 20, 2015
-
-
Adrian Prantl authored
A PCHContainerOperations abstract interface provides operations for creating and unwrapping containers for serialized ASTs (precompiled headers and clang modules). The default implementation is RawPCHContainerOperations, which uses a flat file for the output. The main application for this interface will be an ObjectFilePCHContainerOperations implementation that uses LLVM to wrap the module in an ELF/Mach-O/COFF container to store debug info alongside the AST. rdar://problem/20091852 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240225 91177308-0d34-0410-b5e6-96231b3b80d8
-
NAKAMURA Takumi authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240211 91177308-0d34-0410-b5e6-96231b3b80d8
-
Nico Weber authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240199 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
-
Douglas Gregor authored
Includes a simple static analyzer check and not much else, but we'll also be able to take advantage of this in Swift. This feature can be tested for using __has_feature(cf_returns_on_parameters). This commit also contains two fixes: - Look through non-typedef sugar when deciding whether something is a CF type. - When (cf|ns)_returns(_not)?_retained is applied to invalid properties, refer to "property" instead of "method" in the error message. rdar://problem/18742441 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240185 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 19, 2015
-
-
Alexey Samsonov authored
Introduce ToolChain::getSupportedSanitizers() that would return the set of sanitizers available on given toolchain. By default, these are sanitizers which don't necessarily require runtime support and are not toolchain- or architecture-dependent. Sanitizers (ASan, DFSan, TSan, MSan etc.) which cannot function without runtime library are marked as supported only on platforms for which we actually build these runtimes. This would allow more fine-grained checks in the future: for instance, we have to restrict availability of -fsanitize=vptr to Mac OS 10.9+ (PR23539). Update test cases accrodingly: add tests for certain unsupported configurations, remove test cases for -fsanitize=vptr + PS4 integration, as we don't build the runtime for PS4 at the moment. This change was first submitted as r239953 and reverted in r239958. The problem was and still is in Darwin toolchains, which get the knowledge about target platform too late after initializaition, while now we require this information when ToolChain::getSanitizerArgs() is called. r240170 works around this issue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240179 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alexey Samsonov authored
Summary: This is unfortunate, but would let us land http://reviews.llvm.org/D10467, that makes ToolChains responsible for computing the set of sanitizers they support. Unfortunately, Darwin ToolChains doesn't know about actual OS they target until ToolChain::TranslateArgs() is called. In particular, it means we won't be able to construct SanitizerArgs for these ToolChains before that. This change removes SanitizerArgs::needsLTO() method, so that now ToolChain::IsUsingLTO(), which is called very early, doesn't need SanitizerArgs to implement this method. Docs and test cases are updated accordingly. See https://llvm.org/bugs/show_bug.cgi?id=23539, which describes why we start all these. Test Plan: regression test suite Reviewers: pcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D10560 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240170 91177308-0d34-0410-b5e6-96231b3b80d8
-
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
This generalizes the checking of null arguments to also work with values of pointer-to-function, reference-to-function, and block pointer type, using the nullability information within the underling function prototype to extend non-null checking, and diagnoses returns of 'nil' within a function with a __nonnull return type. Note that we don't warn about nil returns from Objective-C methods, because it's common for Objective-C methods to mimic the nil-swallowing behavior of the receiver by checking ostensibly non-null parameters and returning nil from otherwise non-null methods in that case. It also diagnoses (via a separate flag) conversions from nullable to nonnull pointers. It's a separate flag because this warning can be noisy. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240153 91177308-0d34-0410-b5e6-96231b3b80d8
-
Eric Christopher authored
intrinsic _mm_prefetch into a builtin rather than by textual inclusion via the intrinsic headers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240152 91177308-0d34-0410-b5e6-96231b3b80d8
-
Matt Arsenault authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240150 91177308-0d34-0410-b5e6-96231b3b80d8
-
Matt Arsenault authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240148 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
-
Douglas Katzman authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240135 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alexander Potapenko authored
This patch adds initial support for the -fsanitize=kernel-address flag to Clang. Right now it's quite restricted: only out-of-line instrumentation is supported, globals are not instrumented, some GCC kasan flags are not supported. Using this patch I am able to build and boot the KASan tree with LLVMLinux patches from github.com/ramosian-glider/kasan/tree/kasan_llvmlinux. To disable KASan instrumentation for a certain function attribute((no_sanitize("kernel-address"))) can be used. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240131 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alexey Bataev authored
Base type of attribute((mode)) can actually be a vector type. The patch is to distinguish between base type and base element type. This fixes http://llvm.org/PR17453. Differential Revision: http://reviews.llvm.org/D10058 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240125 91177308-0d34-0410-b5e6-96231b3b80d8
-
Eric Christopher authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240110 91177308-0d34-0410-b5e6-96231b3b80d8
-
Peter Collingbourne authored
This flag controls whether a given sanitizer traps upon detecting an error. It currently only supports UBSan. The existing flag -fsanitize-undefined-trap-on-error has been made an alias of -fsanitize-trap=undefined. This change also cleans up some awkward behavior around the combination of -fsanitize-trap=undefined and -fsanitize=undefined. Previously we would reject command lines containing the combination of these two flags, as -fsanitize=vptr is not compatible with trapping. This required the creation of -fsanitize=undefined-trap, which excluded -fsanitize=vptr (and -fsanitize=function, but this seems like an oversight). Now, -fsanitize=undefined is an alias for -fsanitize=undefined-trap, and if -fsanitize-trap=undefined is specified, we treat -fsanitize=vptr as an "unsupported" flag, which means that we error out if the flag is specified explicitly, but implicitly disable it if the flag was implied by -fsanitize=undefined. Differential Revision: http://reviews.llvm.org/D10464 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240105 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 18, 2015
-
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240057 91177308-0d34-0410-b5e6-96231b3b80d8
-
Nico Weber authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240056 91177308-0d34-0410-b5e6-96231b3b80d8
-
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
-
Alexey Bataev authored
Codegen for this directive is a combined codegen for 'omp parallel' region with 'omp for simd' region inside. Clauses are supported. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240006 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
In essence this is meant to consistently indent multiline strings by a fixed amount of spaces from the start of the line. Don't do this in cases where it wouldn't help anyway. Before: someFunction(aaaaa, "aaaaa" "bbbbb"); After: someFunction(aaaaa, "aaaaa" "bbbbb"); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240004 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alexey Samsonov authored
This reverts commit r239953, while I'm investigating assertion failure from http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/9994/ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239958 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alexey Samsonov authored
Summary: Introduce ToolChain::getSupportedSanitizers() that would return the set of sanitizers available on given toolchain. By default, these are sanitizers which don't necessarily require runtime support (i.e. set from -fsanitize=undefined-trap). Sanitizers (ASan, DFSan, TSan, MSan etc.) which cannot function without runtime library are marked as supported only on platforms for which we actually build these runtimes. This would allow more fine-grained checks in the future: for instance, we have to restrict availability of -fsanitize=vptr to Mac OS 10.9+ (PR23539) Update test cases accrodingly: add tests for certain unsupported configurations, remove test cases for -fsanitize=vptr + PS4 integration, as we don't build the runtime for PS4 at the moment. Test Plan: regression test suite Reviewers: pcc Subscribers: cfe-commits, filcab, eugenis, thakis, kubabrecka, emaste, rsmith Differential Revision: http://reviews.llvm.org/D10467 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239953 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 17, 2015
-
-
Richard Smith authored
argument is not visible. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239934 91177308-0d34-0410-b5e6-96231b3b80d8
-
Reid Kleckner authored
Fixes one instance of PR17960. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239920 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alexander Kornienko authored
Summary: Qualify all types used in AST matcher macros. This makes it possible to put AST matchers in user code into a namespace other than clang::ast_matchers and this way prevent ODR violations that could happen when a matcher with the same name is defined in multiple translation units. Updated comments accordingly. Reviewers: djasper, klimek Reviewed By: djasper, klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D10501 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239902 91177308-0d34-0410-b5e6-96231b3b80d8
-
Saleem Abdulrasool authored
Address post-commit commit about the wording of the warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239879 91177308-0d34-0410-b5e6-96231b3b80d8
-
Saleem Abdulrasool authored
Separate two class definitions that had been merged into a single line. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239878 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
-