summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [Bash-autocompletion] Fixed a bug on bashYuka Takahashi2017-07-151-4/+7
| | | | | | | | Summary: Maybe I mismerged when merging previous commits by hand. Differential Revision: https://reviews.llvm.org/D35448 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308091 91177308-0d34-0410-b5e6-96231b3b80d8
* clang/test/FixIt/format.m: Tweak for i686, where ssize_t is int. (r308067)NAKAMURA Takumi2017-07-151-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308084 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] Revert r307743 which reverted r307720Richard Trieu2017-07-154-52/+167
| | | | | | | | Reapply r307720 to allow processing of constructors and destructors. Reuse the diagnostics for CXXMethodDecl for them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308077 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Fix format test Alexander Shaposhnikov2017-07-151-3/+3
| | | | | | | | | | This diff makes the test FixIt/format.m more robust. The issue was caught by the build bot clang-cmake-thumbv7-a15. Test plan: make check-all git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308073 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to fix modules buildMatthias Braun2017-07-151-0/+1
| | | | | | | | | | | | Module builds somehow report an ambiguity between clang::Diagnostic and clang::Tooling::Diagnostic. It seems as if one of the additional headers brought in by the module brings the clang namespace to the toplevel. I could not find out the reason for that, so for now I go with the simple fix to bring the build back to green. rdar://33321397 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308071 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Fix handling of "%zd" format specifierAlexander Shaposhnikov2017-07-142-3/+15
| | | | | | | | | | | | | | This diff addresses FIXME in lib/Analysis/PrintfFormatString.cpp and makes PrintfSpecifier::getArgType return the correct type. In particular, this change enables Clang to emit a warning on incorrect using of "%zd"/"%zn" format specifiers. Differential revision: https://reviews.llvm.org/D35427 Test plan: make check-all git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308067 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix flag names in @available docs.Nico Weber2017-07-141-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308048 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix link in docs.Nico Weber2017-07-141-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308046 91177308-0d34-0410-b5e6-96231b3b80d8
* do more processing in clang-fuzzer (use EmitAssemblyAction)Kostya Serebryany2017-07-142-3/+11
| | | | | | | | | | | | | | Summary: use EmitAssemblyAction in clang-fuzzer Reviewers: klimek, rsmith Reviewed By: klimek Subscribers: cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D34267 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308045 91177308-0d34-0410-b5e6-96231b3b80d8
* Add documentation for @availableNico Weber2017-07-142-8/+100
| | | | | | | https://reviews.llvm.org/D35379 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308044 91177308-0d34-0410-b5e6-96231b3b80d8
* Prevent ClangTools from generating dependency files.Sterling Augustine2017-07-141-0/+1
| | | | | | | | | | | | | | | | | | | | D34304 created a way for ToolInvocations to conditionally generate dependency files, and updated call sites to preserve the old behavior of not generating them by default. CompilerInvocations... Summary: ...are yet another call-path that needs updating to preserve the old behavior. Reviewers: klimek, echristo Reviewed By: echristo Subscribers: echristo, cfe-commits Differential Revision: https://reviews.llvm.org/D35131 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308043 91177308-0d34-0410-b5e6-96231b3b80d8
* [Dominators] Update Clang's DominatorTree to use the new template argumentJakub Kuderski2017-07-141-3/+3
| | | | | | | | | | | | | | Summary: This patch makes the Clang's DominatorTree use the new IsPostDom template argument for DominatorTreeBase. Reviewers: dberlin, sanjoy, davide, grosser Reviewed By: dberlin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D35316 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308041 91177308-0d34-0410-b5e6-96231b3b80d8
* Unconditionally use .init_array instead of .ctors on Solaris.Aaron Ballman2017-07-144-3/+12
| | | | | | Patch by Fedor Sergeev git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308038 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Add getSignedSizeType methodAlexander Shaposhnikov2017-07-143-0/+24
| | | | | | | | | | | | | | | | | | C11 standard refers to the signed counterpart of the type size_t in the paragraph 7.21.6.1 where it defines d, i, o, u, x, or x conversion specifiers (in printf format string). In Clang there is a FIXME (in lib/Analysis/PrintfFormatString.cpp) for this case (which is not handled correctly at the moment). This diff adds getSignedSizeType method to TargetInfo and exposes it in ASTContext similarly to how it is done for getSizeType. lib/Analysis/PrintfFormatString.cpp will be changed in a separate commit. Differential revision: https://reviews.llvm.org/D35378 Test plan: make check-all git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308037 91177308-0d34-0410-b5e6-96231b3b80d8
* [Hexagon] Add intrinsics for data cache operationsKrzysztof Parzyszek2017-07-142-0/+18
| | | | | | | | | | | | | | This is the clang part, adding support for void __builtin_HEXAGON_Y2_dccleana(void*); void __builtin_HEXAGON_Y2_dccleaninva(void*); void __builtin_HEXAGON_Y2_dcinva(void*); void __builtin_HEXAGON_Y2_dczeroa(void*); void __builtin_HEXAGON_Y4_l2fetch(void*, unsigned); void __builtin_HEXAGON_Y5_l2fetch(void*, unsigned long long); Requires r308032. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308035 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Added a method indexTopLevelDecls to run indexing on a list of Decls.Ilya Biryukov2017-07-142-2/+20
| | | | | | | | | | | | | | | | Summary: We need it in clangd for refactoring that replaces ASTUnit with manual AST management. Reviewers: akyrtzi, benlangmuir, arphaman, klimek Reviewed By: arphaman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D35405 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308016 91177308-0d34-0410-b5e6-96231b3b80d8
* [Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML outputAlexander Kornienko2017-07-143-11/+171
| | | | | | | | | | | | | | | | | | | | | | Summary: To get properly integration Clang-Tidy with CLion IDE, next things were implemented: 1) Preserve `Message`, `FileOffset`, `FilePath` in the clang-tidy output. 2) Export all diagnostics, not just the ones with fixes 3) Test-cases Reviewers: klimek, ilya-biryukov, alexfh Reviewed By: alexfh Subscribers: alexfh, JDevlieghere, mgorny, xazax.hun, cfe-commits, klimek Tags: #clang-tools-extra Patch by Vladimir Plyashkun! Differential Revision: https://reviews.llvm.org/D34404 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308014 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Add annotation for functions taking user-facing stringsErik Verbruggen2017-07-142-10/+78
| | | | | | | | | | | | | | | | | There was already a returns_localized_nsstring annotation to indicate that the return value could be passed to UIKit methods that would display them. However, those UIKit methods were hard-coded, and it was not possible to indicate that other classes/methods in a code-base would do the same. The takes_localized_nsstring annotation can be put on function parameters and selector parameters to indicate that those will also show the string to the user. Differential Revision: https://reviews.llvm.org/D35186 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308012 91177308-0d34-0410-b5e6-96231b3b80d8
* Keep the IdentifierInfo in the Token for alternative operator keywordOlivier Goffart2017-07-147-57/+61
| | | | | | | | | | | | | | | | | | | The goal of this commit is to fix clang-format so it does not merge tokens when using the alternative spelling keywords. (eg: "not foo" should not become "notfoo") The problem is that Preprocessor::HandleIdentifier used to drop the identifier info from the token for these keyword. This means the first condition of TokenAnnotator::spaceRequiredBefore is not met. We could add explicit check for the spelling in that condition, but I think it is better to keep the IdentifierInfo and handle the operator keyword explicitly when needed. That actually leads to simpler code, and probably slightly more efficient as well. Another side effect of this change is that __identifier(and) will now work as one would expect, removing a FIXME from the MicrosoftExtensions.cpp test Differential Revision: https://reviews.llvm.org/D35172 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308008 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Add 'movbe' to btver2 CPU.Craig Topper2017-07-141-0/+1
| | | | | | This probably doesn't change anything because the frotend doesn't do anything with this feature and the backend will infer from the cpu string. So this is just for consistency with other cpus that support movbe. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308002 91177308-0d34-0410-b5e6-96231b3b80d8
* Add release notes for the overloadable attributeGeorge Burgess IV2017-07-141-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307995 91177308-0d34-0410-b5e6-96231b3b80d8
* Use EXPECT_TRUE rather than EXPECT_EQ(true, ...) to clean up the code and ↵Eric Christopher2017-07-141-2/+2
| | | | | | silence a null conversion warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307989 91177308-0d34-0410-b5e6-96231b3b80d8
* Change dyn_casts with unused variables to isa statements to avoid unused ↵Eric Christopher2017-07-142-3/+3
| | | | | | variables. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307988 91177308-0d34-0410-b5e6-96231b3b80d8
* [ODRHash] Avoid taking the types of FunctionDecl'sRichard Trieu2017-07-142-1/+19
| | | | | | | | | FunctionDecl already hashes most of the information in the function's type. Add hashing of the return type, and skip hashing the function's type to avoid redundancy and extra work when computing the hash. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307986 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Respect -target when determining target platform on AppleAkira Hatanaka2017-07-142-19/+61
| | | | | | | | | | | | | | platforms. Set the target OS based on -target if it is present on the command line and -arch is not. With this commit, "-target x86_64-apple-ios8.0" does the same thing as "-arch x86_64 -mios-version-min=8.0". rdar://problem/21012522 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307982 91177308-0d34-0410-b5e6-96231b3b80d8
* [PS4] Disable LTO unit features under ThinLTO, like for Darwin.Paul Robinson2017-07-132-4/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307964 91177308-0d34-0410-b5e6-96231b3b80d8
* Use getNameAsString instead of getName to get method names when dumpingLang Hames2017-07-131-6/+2
| | | | | | | | | | overrides: getName can fail if the decl's name isn't a simple identifier. This is a more general replacement for the fix in r305860. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307959 91177308-0d34-0410-b5e6-96231b3b80d8
* [ubsan] Teach the pointer overflow check that "p - <unsigned> <= p" (PR33430)Vedant Kumar2017-07-134-20/+44
| | | | | | | | | | | | | | | | | | | | | The pointer overflow check gives false negatives when dealing with expressions in which an unsigned value is subtracted from a pointer. This is summarized in PR33430 [1]: ubsan permits the result of the subtraction to be greater than "p", but it should not. To fix the issue, we should track whether or not the pointer expression is a subtraction. If it is, and the indices are unsigned, we know to expect "p - <unsigned> <= p". I've tested this by running check-{llvm,clang} with a stage2 ubsan-enabled build. I've also added some tests to compiler-rt, which are in D34122. [1] https://bugs.llvm.org/show_bug.cgi?id=33430 Differential Revision: https://reviews.llvm.org/D34121 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307955 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Produce the right kind of va_arg for windowsMartin Storsjo2017-07-132-3/+29
| | | | | | | | On windows on arm64, the va_list is a plain pointer. Differential Revision: https://reviews.llvm.org/D35008 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307933 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix spelling mistakes in comments. NFCI.Simon Pilgrim2017-07-131-14/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307932 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix -Wdocumentation warning. NFCISimon Pilgrim2017-07-131-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307931 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend -Wdeprecated-implementations to warn about unavailable methodsAlex Lorenz2017-07-133-2/+22
| | | | | | | rdar://22867595 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307924 91177308-0d34-0410-b5e6-96231b3b80d8
* NFC, Cleanup the code for -Wdeprecated-implementationsAlex Lorenz2017-07-133-29/+35
| | | | | | | | | and void capitalization of the warning message rdar://22867595 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307923 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Add support for handling the +sve target feature.Amara Emerson2017-07-132-4/+16
| | | | | | | | This also adds the appropriate predefine for SVE if enabled. Differential Revision: https://reviews.llvm.org/D35118 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307919 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Fix reduction tests, NFC.Alexey Bataev2017-07-132-10/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307916 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Fix reduction tests, NFC.Alexey Bataev2017-07-132-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307915 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Further reduction test fix, NFC.Alexey Bataev2017-07-132-18/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307914 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Fix reduction tests, NFC.Alexey Bataev2017-07-132-12/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307912 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Fix reduction tests, NFC.Alexey Bataev2017-07-132-8/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307911 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Generalization of codegen for reduction clauses.Alexey Bataev2017-07-135-401/+579
| | | | | | | Reworked codegen for reduction clauses for future support of reductions in task-based directives. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307910 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove another 'using namespace llvm' from theAlex Lorenz2017-07-131-2/+0
| | | | | | | | | | RecursiveSymbolVisitor.h header This should fix the modules build (http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules-2/). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307908 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove 'using namespace llvm' from the USRFinder.h headerAlex Lorenz2017-07-131-2/+0
| | | | | | | | This should fix the modules build (http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules-2/). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307905 91177308-0d34-0410-b5e6-96231b3b80d8
* [ObjC] Pick a 'readwrite' property when synthesizing ambiguousAlex Lorenz2017-07-137-45/+304
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | property and check for incompatible attributes This commit changes the way ambiguous property synthesis (i.e. when synthesizing a property that's declared in multiple protocols) is performed. Previously, Clang synthesized the first property that was found. This lead to problems when the property was synthesized in a class that conformed to two protocols that declared that property and a second protocols had a 'readwrite' declaration - the setter was not synthesized so the class didn't really conform to the second protocol and user's code would crash at runtime when they would try to set the property. This commit ensures that a first readwrite property is selected. This is a semantic change that changes users code in this manner: ``` @protocol P @property(readonly) int p; @end @protocol P2 @property(readwrite) id p; @end @interface I <P2> @end @implementation I @syntesize p; // Users previously got a warning here, and Clang synthesized // readonly 'int p' here. Now Clang synthesizes readwrite 'id' p.. @end ``` To ensure that this change is safe, the warning about incompatible types is promoted to an error when this kind of readonly/readwrite ambiguity is detected in the @implementation. This will ensure that previous code that had this subtle bug and ignored the warning now will fail to compile with an error, and users should not get suprises at runtime once they resolve the error. The commit also extends the ambiguity checker, and now it can detect conflicts among the different property attributes. An error diagnostic is used for conflicting attributes, to ensure that the user won't get "suprises" at runtime. ProtocolPropertyMap is removed in favour of a a set + vector because the map's order of iteration is non-deterministic, so it couldn't be used to select the readwrite property. rdar://31579994 Differential Revision: https://reviews.llvm.org/D35268 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307903 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Objective-C method declarations and message sends withAlex Lorenz2017-07-132-0/+29
| | | | | | | | | an empty first selector piece should store the location of the first ':' rdar://33188656 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307901 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor][rename] Use a single base class for class that findsAlex Lorenz2017-07-135-230/+196
| | | | | | | | | | | | | | | a declaration at location and for class that searches for all occurrences of a specific declaration This commit uses a single RecursiveSymbolVisitor class for both USRLocFindingASTVisitor and NamedDeclOccurrenceFindingVisitor to avoid duplicate traversal code. It also traverses nested name specifier locs in the new class and remove the separate matching step. Differential Revision: https://reviews.llvm.org/D34949 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307898 91177308-0d34-0410-b5e6-96231b3b80d8
* fix typos in comments; NFCHiroshi Inoue2017-07-132-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307886 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Mark a virtual CXXMethodDecl as used if a call to it can beAkira Hatanaka2017-07-1311-114/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | devirtualized. The code to detect devirtualized calls is already in IRGen, so move the code to lib/AST and make it a shared utility between Sema and IRGen. This commit fixes a linkage error I was seeing when compiling the following code: $ cat test1.cpp struct Base { virtual void operator()() {} }; template<class T> struct Derived final : Base { void operator()() override {} }; Derived<int> *d; int main() { if (d) (*d)(); return 0; } rdar://problem/33195657 Differential Revision: https://reviews.llvm.org/D34301 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307883 91177308-0d34-0410-b5e6-96231b3b80d8
* Reland "[Driver] Update Fuchsia driver path handling"Petr Hosek2017-07-124-20/+86
| | | | | | | | | | | | | | | | | Several improvements to the Fuchsia driver: * Search for C++ library headers and libraries in directories that are part of the toolchain distribution rather than sysroot. * Use LLVM support utlities to construct paths to make sure the driver is also usable on Windows for cross-compiling. * Change the driver to inherit directly from ToolChain rather than Generic_GCC since we don't need any of the GCC related multilib logic. Differential Revision: https://reviews.llvm.org/D35328 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307856 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Don't add relation to a NamedDecl with no nameBen Langmuir2017-07-122-5/+22
| | | | | | | | | | | | Unless it's one of the special cases (tag, category) that we can handle. This syncs up the check between handling a decl and handling a relation. This would cause invalid nameless decls to end up in relations despite having no name or USR. rdar://problem/32474406 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307855 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[analyzer] Support generating and reasoning over more symbolic ↵Dominic Chen2017-07-1213-1837/+65
| | | | | | | | | | constraint types" Assertion `Loc::isLocType(SSE->getLHS()->getType())' failed in Analysis/PR3991.m This reverts commit e469ff2759275e67f9072b3d67fac90f647c0fe6. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307853 91177308-0d34-0410-b5e6-96231b3b80d8