- Mar 15, 2017
-
-
Aaron Ballman authored
Add AST matchers for ObjCProtocolDecl, ObjCCategoryDecl, ObjCMethodDecl, ObjCIvarDecl, and ObjCPropertyDecl. Patch by Dave Lee. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297882 91177308-0d34-0410-b5e6-96231b3b80d8
-
Zachary Turner authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297881 91177308-0d34-0410-b5e6-96231b3b80d8
-
Akira Hatanaka authored
-m(i|tv|watch)os-simulator-version-min is on the command line. Previously the driver would treat -m(i|tv|watch)os-simulator-version-min as an alias of -m(i|tv|watch)os-version-min. This no longer works since we now need to distinguish between the two options (the latter is used for iOS running in a VM, for example). This commit stops making the simulator options the aliases of the OS options and defines a macro to differentiate between the two groups of options. rdar://problem/28872911 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297866 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alex Lorenz authored
instance of a qualified Class object when that instance method comes from a protocol that's implemented by NSObject Instance methods from a root class like NSObject are also class methods because the metaclass of root class derives from that root class. Therefore, we can avoid the warning for instances of qualified Class objects that point to classes that derive from NSObject. Note that we actually don't know if a Class instance points to a class that derives from NSObject at compile-time, so we have to make a reasonable assumption that the majority of instances will do so. rdar://22812517 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297862 91177308-0d34-0410-b5e6-96231b3b80d8
-
Zachary Turner authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297861 91177308-0d34-0410-b5e6-96231b3b80d8
-
Zachary Turner authored
When this test runs on bots that are configured to default to MSVC, but MSVC isn't actually installed, we can emit a warning that MSVC is not found. Since MSVC isn't actually needed for this test to succeed, just disable this warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297858 91177308-0d34-0410-b5e6-96231b3b80d8
-
Zachary Turner authored
2017 changes the way you find an installed copy of Visual Studio as well as its internal directory layout. As a result, clang-cl was unable to find VS2017 even when you had run vcvarsall to set up a toolchain environment. This patch updates everything for 2017 and cleans up the way we handle a tiered search a la environment -> installation -> PATH for which copy of Visual Studio to bind to. Patch originally by Hamza Sood, with some fixups for landing. Differential Revision: https://reviews.llvm.org/D30758 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297851 91177308-0d34-0410-b5e6-96231b3b80d8
-
John Brawn authored
The way -ffast-math and the various related options to tweak floating-point handling are handled is inflexible and rather confusing. This patch restructures things so that we go through the options adjusting our idea of what's enabled as we go, instead of trying to figure each individual thing out by working backwards from the end, as this makes the behaviour of each individual option more clear. Doing it this way also means we get gcc-compatible behaviour for when the __FAST_MATH__ and __FINITE_MATH_ONLY__ macros are defined, as they should depend on the final set of features that are enabled and not just on -ffast-math and -ffinite-math-only specifically. Differential Revision: http://reviews.llvm.org/D30582 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297837 91177308-0d34-0410-b5e6-96231b3b80d8
-
Douglas Yung authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297799 91177308-0d34-0410-b5e6-96231b3b80d8
-
Adrian Prantl authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297791 91177308-0d34-0410-b5e6-96231b3b80d8
-
Adrian Prantl authored
This fixes lookup mismatches that could happen when the module cache path contained a '/./' component. <rdar://problem/30413458> Differential Revision: https://reviews.llvm.org/D30915 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297790 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 14, 2017
-
-
Simon Pilgrim authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297784 91177308-0d34-0410-b5e6-96231b3b80d8
-
Krzysztof Parzyszek authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297778 91177308-0d34-0410-b5e6-96231b3b80d8
-
Duncan P. N. Exon Smith authored
Since bitcode uses VBR encoding, large numbers are more expensive than small ones. Instead of emitting a UINT_MAX sentinel after each sequence of state-change pairs, emit the size of the sequence as a prefix. This should have no functionality change besides saving bits from the encoding. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297770 91177308-0d34-0410-b5e6-96231b3b80d8
-
Reid Kleckner authored
This is pretty horrible, but I forget if we have any better ways to handle these backslashing issues. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297764 91177308-0d34-0410-b5e6-96231b3b80d8
-
Reid Kleckner authored
This adds -Wbitfield-enum-conversion, which warns on implicit conversions that happen on bitfield assignment that change the value of some enumerators. Values of enum type typically take on a very small range of values, so they are frequently stored in bitfields. Unfortunately, there is no convenient way to calculate the minimum number of bits necessary to store all possible values at compile time, so users usually hard code a bitwidth that works today and widen it as necessary to pass basic testing and validation. This is very error-prone, and leads to stale widths as enums grow. This warning aims to catch such bugs. This would have found two real bugs in clang and two instances of questionable code. See r297680 and r297654 for the full description of the issues. This warning is currently disabled by default while we investigate its usefulness outside of LLVM. The major cause of false positives with this warning is this kind of enum: enum E { W, X, Y, Z, SENTINEL_LAST }; The last enumerator is an invalid value used to validate inputs or size an array. Depending on the prevalance of this style of enum across a codebase, this warning may be more or less feasible to deploy. It also has trouble on sentinel values such as ~0U. Reviewers: rsmith, rtrieu, thakis Reviewed By: thakis Subscribers: hfinkel, voskresensky.vladimir, sashab, cfe-commits Differential Revision: https://reviews.llvm.org/D30923 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297761 91177308-0d34-0410-b5e6-96231b3b80d8
-
Juergen Ributzka authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297759 91177308-0d34-0410-b5e6-96231b3b80d8
-
Jonathan Roelofs authored
https://reviews.llvm.org/D30945 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297756 91177308-0d34-0410-b5e6-96231b3b80d8
-
Pirama Arumuga Nainar authored
Summary: Fix the test by adding missing -target flags with a 'linux' triple. Reviewers: rnk, srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30947 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297754 91177308-0d34-0410-b5e6-96231b3b80d8
-
Pirama Arumuga Nainar authored
Summary: This patch adds -f[no-]rtlib-add-rpath, which if enabled, embeds the arch-specific subdirectory in resource directory using -rpath (instead of doing so only during native compilation). This patch also re-enables test arch-specific-libdir.c which was silently unsupported because of the REQUIRES tag 'linux'. Reviewers: bkramer, rnk, mgorny Subscribers: srhines, cfe-commits Differential Revision: https://reviews.llvm.org/D30700 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297751 91177308-0d34-0410-b5e6-96231b3b80d8
-
Vedant Kumar authored
This is a follow-up to r297700 (Add a nullability sanitizer). It addresses some FIXME's re: using nullability-specific diagnostic handlers from compiler-rt, now that the necessary handlers exist. check-ubsan test updates to follow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297750 91177308-0d34-0410-b5e6-96231b3b80d8
-
Krasimir Georgiev authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297730 91177308-0d34-0410-b5e6-96231b3b80d8
-
Sylvestre Ledru authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297721 91177308-0d34-0410-b5e6-96231b3b80d8
-
Akira Hatanaka authored
correctly. This fixes PR30413. Patch by David Lobron. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297702 91177308-0d34-0410-b5e6-96231b3b80d8
-
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
-