- Mar 14, 2017
-
-
Vedant Kumar authored
Teach UBSan to detect when a value with the _Nonnull type annotation assumes a null value. Call expressions, initializers, assignments, and return statements are all checked. Because _Nonnull does not affect IRGen, the new checks are disabled by default. The new driver flags are: -fsanitize=nullability-arg (_Nonnull violation in call) -fsanitize=nullability-assign (_Nonnull violation in assignment) -fsanitize=nullability-return (_Nonnull violation in return stmt) -fsanitize=nullability (all of the above) This patch builds on top of UBSan's existing support for detecting violations of the nonnull attributes ('nonnull' and 'returns_nonnull'), and relies on the compiler-rt support for those checks. Eventually we will need to update the diagnostic messages in compiler-rt (there are FIXME's for this, which will be addressed in a follow-up). One point of note is that the nullability-return check is only allowed to kick in if all arguments to the function satisfy their nullability preconditions. This makes it necessary to emit some null checks in the function body itself. Testing: check-clang and check-ubsan. I also built some Apple ObjC frameworks with an asserts-enabled compiler, and verified that we get valid reports. Differential Revision: https://reviews.llvm.org/D30762 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297700 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
This prevents unwanted fallout from r296664. Specifically in proto formatting, this changed: optional Aaaaaaaa aaaaaaaa = 12 [ (aaa) = aaaa, (bbbbbbbbbbbbbbbbbbbbbbbbbb) = { aaaaaaaaaaaaaaaaa: true, aaaaaaaaaaaaaaaa: true } ]; Into: optional Aaaaaaaa aaaaaaaa = 12 [ (aaa) = aaaa, (bbbbbbbbbbbbbbbbbbbbbbbbbb) = {aaaaaaaaaaaaaaaaa: true, aaaaaaaaaaaaaaaa: true} ]; Which is considered less readable. Generally, it seems preferable to format such dict literals as blocks rather than contract them to one line. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297696 91177308-0d34-0410-b5e6-96231b3b80d8
-
Eli Friedman authored
An indirect call has no associated function declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297694 91177308-0d34-0410-b5e6-96231b3b80d8
-
Juergen Ributzka authored
Modified the tests to accept any iteration order, to run only on Unix, and added additional error reporting to investigate SystemZ bot issue. The VFS directory iterator and recursive directory iterator behave differently from the LLVM counterparts. Once the VFS iterators hit a broken symlink they immediately abort. The LLVM counterparts don't stat entries unless they have to descend into the next directory, which allows to recover from this issue by clearing the error code and skipping to the next entry. This change adds similar behavior to the VFS iterators. There should be no change in current behavior in the current CLANG source base, because all clients have loop exit conditions that also check the error code. This fixes rdar://problem/30934619. Differential Revision: https://reviews.llvm.org/D30768 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297693 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 13, 2017
-
-
Reid Kleckner authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297681 91177308-0d34-0410-b5e6-96231b3b80d8
-
Reid Kleckner authored
All of these were found by a new warning that I am prototyping, -Wbitfield-enum-conversion. Stmt::ExprBits::ObjectKind - This was not wide enough to represent OK_ObjSubscript, so this was a real, true positive bug. ObjCDeclSpec::objCDeclQualifier - On Windows, setting DQ_CSNullability would cause the bitfield to become negative because enum types are always implicitly 'int' there. This would probably never be noticed because this is a flag-style enum, so we only ever test one bit at a time. Switching to 'unsigned' also makes this type pack smaller on Windows. FunctionDecl::SClass - Technically, we only need two bits for all valid function storage classes. Functions can never have automatic or register storage class. This seems a bit too clever, and we have a bit to spare, so widening the bitfield seems like the best way to pacify the warning. You could classify this as a false positive, but widening the bitfield defends us from invalid ASTs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297680 91177308-0d34-0410-b5e6-96231b3b80d8
-
Matt Arsenault authored
We can't actually pretend that 0 is valid for address space 0. r295877 added a workaround to stop allocating user objects there, so we can use 0 as the invalid pointer. Some of the tests seemed to be using private as the non-0 null test address space, so add copies using local to make sure this is still stressed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297659 91177308-0d34-0410-b5e6-96231b3b80d8
-
Duncan P. N. Exon Smith authored
Change ASTFileSignature from a random 32-bit number to the hash of the PCM content. - Move definition ASTFileSignature to Basic/Module.h so Module and ASTSourceDescriptor can use it. - Change the signature from uint64_t to std::array<uint32_t,5>. - Stop using (saving/reading) the size and modification time of PCM files when there is a valid SIGNATURE. - Add UNHASHED_CONTROL_BLOCK, and use it to store the SIGNATURE record and other records that shouldn't affect the hash. Because implicit modules reuses the same file for multiple levels of -Werror, this includes DIAGNOSTIC_OPTIONS and DIAG_PRAGMA_MAPPINGS. This helps to solve a PCH + implicit Modules dependency issue: PCH files are handled by the external build system, whereas implicit modules are handled by internal compiler build system. This prevents invalidating a PCH when the compiler overwrites a PCM file with the same content (modulo the diagnostic differences). Design and original patch by Manman Ren! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297655 91177308-0d34-0410-b5e6-96231b3b80d8
-
Reid Kleckner authored
Added a static_assert to catch this issue at compile time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297654 91177308-0d34-0410-b5e6-96231b3b80d8
-
Jonas Devlieghere authored
Differential Revision: https://reviews.llvm.org/D30738 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297649 91177308-0d34-0410-b5e6-96231b3b80d8
-
Craig Topper authored
The only valid values for scale immediate of scatter/gather builtins are 1, 2, 4, or 8. This patch enforces this in the frontend otherwise we generate invalid instruction encodings in the backend. Differential Revision: https://reviews.llvm.org/D30875 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297642 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alex Lorenz authored
setters using the block type information that's obtained from the property rdar://12604235 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297628 91177308-0d34-0410-b5e6-96231b3b80d8
-
Gabor Horvath authored
Patch by Zoltan Gera! Differential Revision: https://reviews.llvm.org/D30831 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297627 91177308-0d34-0410-b5e6-96231b3b80d8
-
Sylvestre Ledru authored
Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D30860 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297623 91177308-0d34-0410-b5e6-96231b3b80d8
-
Roger Ferrer Ibanez authored
Given that we have already explicitly stated in the qualifier that the expression is __unaligned, it makes little sense to diagnose that the address of the packed member may not be aligned. Differential Revision: https://reviews.llvm.org/D30884 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297620 91177308-0d34-0410-b5e6-96231b3b80d8
-
Gabor Horvath authored
It looks like on some host-triples the result of a valist related expr can be a LazyCompoundVal. Handle that case in the check. Patch by Abramo Bagnara! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297619 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alex Lorenz authored
This commit adds support for a new -iframeworkwithsysroot compiler option which allows the user to specify a framework path that can be prefixed with the sysroot. This option is similar to the -iwithsysroot option that exists to supplement -isystem. rdar://21316352 Differential Revision: https://reviews.llvm.org/D30183 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297614 91177308-0d34-0410-b5e6-96231b3b80d8
-
Martin Probst authored
Summary: @see is special among JSDoc tags in that it is commonly followed by URLs. The JSDoc spec suggests that users should wrap URLs in an additional {@link url...} tag (@see http://usejsdoc.org/tags-see.html), but this is very commonly violated, with @see being followed by a "naked" URL. This change special cases all JSDoc lines that contain an @see not to be wrapped to account for that. Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D30883 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297607 91177308-0d34-0410-b5e6-96231b3b80d8
-
Martin Probst authored
Summary: Previously clang-format would not break after any !. However in TypeScript, ! can be used as a post fix operator for non-nullability: x.foo()!.bar()!; With this change, clang-format will wrap after the ! if it is likely a post-fix non null operator. Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D30705 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297606 91177308-0d34-0410-b5e6-96231b3b80d8
-
Martin Probst authored
Summary: `interface` and `type` are pseudo keywords and cause automatic semicolon insertion when followed by a line break: interface // gets parsed as a long variable access to "interface" VeryLongInterfaceName { } With this change, clang-format not longer wraps after `interface` or `type`. Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D30874 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297605 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 12, 2017
-
-
Aaron Ballman authored
Allow the nonnull attribute to be inherited as a parameter in the redefinition of a function. Fixes PR30828. Patch by Matt Bettinson. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297592 91177308-0d34-0410-b5e6-96231b3b80d8
-
Craig Topper authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297590 91177308-0d34-0410-b5e6-96231b3b80d8
-
Sanjay Patel authored
x86 has undef SSE/AVX intrinsics that should represent a bogus register operand. This is not the same as LLVM's undef value which can take on multiple bit patterns. There are better solutions / follow-ups to this discussed here: https://bugs.llvm.org/show_bug.cgi?id=32176 ...but this should prevent miscompiles with a one-line code change. Differential Revision: https://reviews.llvm.org/D30834 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297588 91177308-0d34-0410-b5e6-96231b3b80d8
-
Craig Topper authored
[AVX-512] Fix avx512vl gather builtins to require the scale argument to be an ICE like the rest of the gather builtins. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297584 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 11, 2017
-
-
Eric Fiselier authored
Summary: Some coroutine diagnostics need to point to the location of the first coroutine keyword in the function, like when diagnosing a `return` inside a coroutine. Previously we did this by storing each *valid* coroutine statement in a list and select the first one to use in diagnostics. However if every coroutine statement is invalid we would have no location to point to. This patch fixes the storage of the first coroutine statement location, ensuring that it gets stored even when the resulting AST node would be invalid. This patch also removes the `CoroutineStmts` list in `FunctionScopeInfo` because it was unused. Reviewers: rsmith, GorNishanov, aaron.ballman Reviewed By: GorNishanov Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D30776 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297547 91177308-0d34-0410-b5e6-96231b3b80d8
-
Gor Nishanov authored
Summary: Create only one OpaqueValue for await_ready/await_suspend/await_resume. Store OpaqueValue used in the CoroutineSuspendExpr node, so that CodeGen does not have to hunt looking for it. Reviewers: rsmith, EricWF, aaron.ballman Reviewed By: EricWF Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D30775 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297541 91177308-0d34-0410-b5e6-96231b3b80d8
-
Juergen Ributzka authored
Still broken on Windows and SystemZ bot ... sorry for the noise. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297533 91177308-0d34-0410-b5e6-96231b3b80d8
-
Juergen Ributzka authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297531 91177308-0d34-0410-b5e6-96231b3b80d8
-
NAKAMURA Takumi authored
clang/test/SemaOpenCL/overload_addrspace_resolution.cl: Appease MS mangler to specify triple=x86_64-unknown. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297530 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 10, 2017
-
-
Juergen Ributzka authored
Modified the tests to accept any iteration order. The VFS directory iterator and recursive directory iterator behave differently from the LLVM counterparts. Once the VFS iterators hit a broken symlink they immediately abort. The LLVM counterparts allow to recover from this issue by clearing the error code and skipping to the next entry. This change adds the same functionality to the VFS iterators. There should be no change in current behavior in the current CLANG source base, because all clients have loop exit conditions that also check the error code. This fixes rdar://problem/30934619. Differential Revision: https://reviews.llvm.org/D30768 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297528 91177308-0d34-0410-b5e6-96231b3b80d8
-
Juergen Ributzka authored
The tests are failing on one of the bots. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297517 91177308-0d34-0410-b5e6-96231b3b80d8
-
Juergen Ributzka authored
This variable is set, but never used. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297511 91177308-0d34-0410-b5e6-96231b3b80d8
-
Juergen Ributzka authored
The VFS directory iterator and recursive directory iterator behave differently from the LLVM counterparts. Once the VFS iterators hit a broken symlink they immediately abort. The LLVM counterparts allow to recover from this issue by clearing the error code and skipping to the next entry. This change adds the same functionality to the VFS iterators. There should be no change in current behavior in the current CLANG source base, because all clients have loop exit conditions that also check the error code. This fixes rdar://problem/30934619. Differential Revision: https://reviews.llvm.org/D30768 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297510 91177308-0d34-0410-b5e6-96231b3b80d8
-
Galina Kistanova authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297497 91177308-0d34-0410-b5e6-96231b3b80d8
-
Petar Jovanovic authored
Removes immediate range checks for these instructions, since they have GPR rt as their input operand. Patch by Stefan Maksimovic. Differential Revision: https://reviews.llvm.org/D30693 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297485 91177308-0d34-0410-b5e6-96231b3b80d8
-
Anastasia Stulova authored
1. Reimplemented conditional operator so that it checks compatibility of unqualified pointees of the 2nd and the 3rd operands (C99, OpenCL v2.0 6.5.15). Define QualTypes compatibility for OpenCL as following: - corresponding types are compatible (C99 6.7.3) - CVR-qualifiers are equal (C99 6.7.3) - address spaces are equal (implementation defined) 2. Added generic address space to Itanium mangling. Review: D30037 Patch by Dmitry Borisenkov! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297468 91177308-0d34-0410-b5e6-96231b3b80d8
-
Andi-Bogdan Postelnicu authored
Differential Revision: https://reviews.llvm.org/D30487 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297467 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alex Lorenz authored
Printing typedefs or type aliases using clang_getTypeSpelling() is missing the namespace they are defined in. This is in contrast to other types that always yield the full typename including namespaces. Patch by Michael Reiher! Differential Revision: https://reviews.llvm.org/D29944 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297465 91177308-0d34-0410-b5e6-96231b3b80d8
-
Gabor Horvath authored
Patch by Zoltan Daniel Torok! Differential Revision: https://reviews.llvm.org/D29567 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297461 91177308-0d34-0410-b5e6-96231b3b80d8
-
Krasimir Georgiev authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297455 91177308-0d34-0410-b5e6-96231b3b80d8
-