summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [CStringSyntaxChecker] Reduces space around error message for strlcat.David Carlier2018-08-152-2/+2
| | | | llvm-svn: 339808
* Refactor Darwin driver to refer to runtimes by componentChris Bieneman2018-08-152-64/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In r335809, Petr Hosek lays out support for what he calls the multiarch runtimes layout. This new way of laying out the directories for runtime libraries is workable for all platforms. Petr did some of the common infrastructure and made it work for Linux and Fuscia. This patch is a cleanup to the Darwin and MachO drivers to serve as a step toward supporting it in Darwin. This patch does primarily two things: (1) Changes the APIs for how the Darwin driver refers to compiler-rt libraries to use the component names, similar to how Linux and Fuscia do (2) Removes some legacy functionality for supporting macOS versions before 10.6. This functionality is effectively dead code because in r339277, the support was removed from compiler-rt for generating the 10.4 runtime support library, and Xcode 10 (currently in beta) removes libgcc_s.10.4 and libgcc_s.10.5 from the macOS SDK. With this patch landed a subsequent patch can modify MachO::AddLinkRuntimeLib to support the multiarch runtimes layout. Worth noting: None of the removed functionality was actually covered in the test suite. So no test case updates are required. Reviewers: phosek, bruno, arphaman Reviewed By: phosek, arphaman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50618 llvm-svn: 339807
* [OPENMP] FIx processing of declare target variables.Alexey Bataev2018-08-159-32/+76
| | | | | | | | The compiler may produce unexpected error messages/crashes when declare target variables were used. Patch fixes problems with the declarations marked as declare target to or link. llvm-svn: 339805
* clang-format: Change Google style wrt. the formatting of empty messages.Daniel Jasper2018-08-152-9/+5
| | | | | | | | | | | Before: message Empty { } After: message Empty {} llvm-svn: 339803
* [AST] Pack the unsigned of PackExpansionType into TypeBruno Ricci2018-08-151-13/+28
| | | | | | | | | | | The bit-fields of `Type` have enough space for the `unsigned NumExpansions` of `PackExpansionType` Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D50711 llvm-svn: 339789
* [AST] Pack the bits of TemplateSpecializationType into TypeBruno Ricci2018-08-152-13/+32
| | | | | | | | | | | Type has enough space for two members of TemplateSpecializationType. Mechanical patch. Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D50643 llvm-svn: 339787
* Use .cpp extension for certain tests instead of .ccMomchil Velikov2018-08-152-0/+0
| | | | | | | | | | | | The tests `CodeGen/aapcs[64]-align.cc` are not run since files with a `.cc` suffix aren't recognisze as tests. This patch renames the above two files to `.cpp`. Differential Revision: https://reviews.llvm.org/D46013 Comitting as obvious. llvm-svn: 339766
* Fix ASTMatchersTraversalTest testcase compile on older compilersDavid Green2018-08-151-3/+3
| | | | | | | | Some versions of gcc, especially when invoked through ccache (-E), can have trouble with raw string literals inside macros. This moves the string out of the macro. llvm-svn: 339759
* Silence "unused variable" warning.Richard Smith2018-08-151-0/+1
| | | | llvm-svn: 339747
* [analyzer] Add support for constructors of arguments.Artem Dergachev2018-08-1511-55/+485
| | | | | | | | | | | | | | | | | | | | | Once CFG-side support for argument construction contexts landed in r338436, the analyzer could make use of them to evaluate argument constructors properly. When evaluated as calls, constructors of arguments now use the variable region of the parameter as their target. The corresponding stack frame does not yet exist when the parameter is constructed, and this stack frame is created eagerly. Construction of functions whose body is unavailable and of virtual functions is not yet supported. Part of the reason is the analyzer doesn't consistently use canonical declarations o identify the function in these cases, and every re-declaration or potential override comes with its own set of parameter declarations. Also it is less important because if the function is not inlined, there's usually no benefit in inlining the argument constructor. Differential Revision: https://reviews.llvm.org/D49443 llvm-svn: 339745
* Remove obsolete commentStephen Kelly2018-08-141-1/+0
| | | | | | | This related to the code as first checked in in r266292 ([ASTImporter] Implement some expression-related AST node import., 2016-04-14). llvm-svn: 339731
* Fix Stmt::ignoreImplicitStephen Kelly2018-08-142-8/+53
| | | | | | | | | | | | | | | | Summary: A CXXBindTemporaryExpr can appear inside an ImplicitCastExpr, and was not ignored previously. Fixes the case reported in PR37327. Reviewers: rsmith, dblaikie, klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50666 llvm-svn: 339730
* Fix lit fatal errors about requiring a USE_Z3_SOLVER paramReid Kleckner2018-08-141-2/+1
| | | | llvm-svn: 339728
* [CFG] [analyzer] Find argument constructors in CXXTemporaryObjectExprs.Artem Dergachev2018-08-142-0/+38
| | | | | | | | | | | CXXTemporaryObjectExpr is a sub-class of CXXConstructExpr. If it has arguments that are structures passed by value, their respective constructors need to be handled by providing a ConstructionContext, like for regular function calls and for regular constructors. Differential Revision: https://reviews.llvm.org/D50487 llvm-svn: 339727
* [analyzer] Add a test forgotten in r339088.Artem Dergachev2018-08-141-0/+17
| | | | | | Differential Revision: https://reviews.llvm.org/D50363 llvm-svn: 339726
* [InlineAsm] Update the min-legal-vector-width function attribute based on ↵Craig Topper2018-08-142-0/+59
| | | | | | | | | | | | | | | | | | | | | inputs and outputs to inline assembly Summary: Another piece of my ongoing to work for prefer-vector-width. min-legal-vector-width will eventually be used by the X86 backend to know whether it needs to make 512 bits type legal when prefer-vector-width=256. If the user used inline assembly that passed in/out a 512-bit register, we need to make sure 512 bits are considered legal. Otherwise we'll get an assert failure when we try to wire up the inline assembly to the rest of the code. This patch just checks the LLVM IR types to see if they are vectors and then updates the attribute based on their total width. I'm not sure if this is the best way to do this or if there's any subtlety I might have missed. So if anyone has other opinions on how to do this I'm open to suggestions. Reviewers: chandlerc, rsmith, rnk Reviewed By: rnk Subscribers: eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D50678 llvm-svn: 339721
* SafeStack: Disable Darwin supportVlad Tsyrklevich2018-08-141-10/+0
| | | | | | | | | | | | | | | | Summary: Darwin support does not appear to be used as evidenced by the fact that the runtime has never supported non-trivial programs. Reviewers: pcc, kubamracek Reviewed By: pcc Subscribers: cfe-commits, kcc Differential Revision: https://reviews.llvm.org/D50724 llvm-svn: 339720
* [analyzer] Fix bots by removing new check-clang-analyzer commands from CHECK-ALLGeorge Karpenkov2018-08-141-0/+4
| | | | llvm-svn: 339709
* [OPENMP] Fix processing of declare target construct.Alexey Bataev2018-08-147-72/+59
| | | | | | | The attribute marked as inheritable since OpenMP 5.0 supports it + additional fixes to support new functionality. llvm-svn: 339704
* We have in place support for parsing #pragma FENV_ACCESS, but that Kevin P. Neal2018-08-149-7/+109
| | | | | | | | | | | | | information is then discarded with a warning to the user that we don't support it. This patch gets us one step closer by getting the info down into the AST in most cases. Reviewed by: rsmith Differential Revision: https://reviews.llvm.org/D49865 llvm-svn: 339693
* Revert test commitKevin P. Neal2018-08-141-1/+0
| | | | llvm-svn: 339691
* Test commitKevin P. Neal2018-08-141-0/+1
| | | | llvm-svn: 339690
* [OpenCL] Add test for constant sampler argumentSven van Haastregt2018-08-141-0/+2
| | | | llvm-svn: 339678
* [gnu-objc] Make selector order deterministic.David Chisnall2018-08-142-3/+23
| | | | | | | | | | | | | | | | | | | Summary: This probably fixes PR35277, though there may be other sources of nondeterminism (this was the only case of iterating over a DenseMap). It's difficult to provide a test case for this, because it shows up only on systems with ASLR enabled. Reviewers: rjmccall Reviewed By: rjmccall Subscribers: bmwiedemann, mgrang, cfe-commits Differential Revision: https://reviews.llvm.org/D50559 llvm-svn: 339668
* Add a stub mangling for ObjC selectors in the Microsoft ABI.David Chisnall2018-08-141-2/+8
| | | | | | | | | | | | | | This mangling is used only for outlined SEH finally blocks, which have internal linkage. This fixes the failure of CodeGenObjC/2007-04-03-ObjcEH.m on builds with expensive checks enabled, on Windows. This test should probably be specifying a triple: it currently picks up whatever the host environment is using. Unfortunately, I have no idea what it is trying to test, because it contains no comments and predates Clang having working Objective-C IR generation. llvm-svn: 339667
* [XRay][clang] Add more test cases of -fxray-modes= (NFC)Dean Michael Berris2018-08-141-0/+14
| | | | | | | | | | This confirms expectations for multiple values provided through the driver when selecting specific modes and the order of appearance of individual values for the `-fxray-modes=` flag. This change just adds more test cases to an existing test file. llvm-svn: 339662
* [analyzer] Made a buildbot happy.Kristof Umann2018-08-141-2/+4
| | | | llvm-svn: 339655
* [analyzer][UninitializedObjectChecker] Void pointers are casted back to ↵Kristof Umann2018-08-142-8/+46
| | | | | | | | their dynamic type in note message Differential Revision: https://reviews.llvm.org/D49228 llvm-svn: 339653
* [X86] Lowering addus/subus intrinsics to native IRTomasz Krupa2018-08-145-52/+214
| | | | | | | | | | | | | | Summary: This is the patch that lowers x86 intrinsics to native IR in order to enable optimizations. Reviewers: craig.topper, spatel, RKSimon Reviewed By: craig.topper Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D46892 llvm-svn: 339651
* [CStringSyntaxChecker] Check strlcat sizeof checkDavid Carlier2018-08-142-4/+67
| | | | | | | | | | | | | - Assuming strlcat is used with strlcpy we check as we can if the last argument does not equal os not larger than the buffer. - Advising the proper usual pattern. Reviewers: NoQ, george.karpenkov Reviewed By: george.karpenkov Differential Revision: https://reviews.llvm.org/D49722 llvm-svn: 339641
* Revert r339623 "Model type attributes as regular Attrs."Reid Kleckner2018-08-1425-581/+736
| | | | | | | | This breaks compiling atlwin.h in Chromium. I'm sure the code is invalid in some way, but we put a lot of work into accepting it, and I'm sure rejecting it was not an intended consequence of this refactoring. :) llvm-svn: 339638
* Move test inputs into Inputs directory.Richard Smith2018-08-1461-28/+28
| | | | | | | We don't need a new ExpectedOutputs/ convention. Expected outputs are just another form of test input. llvm-svn: 339634
* [CodeGen] Before returning a copy/dispose helper function, bitcast it toAkira Hatanaka2018-08-143-16/+17
| | | | | | | | a void pointer type. This fixes a bug introduced in r339438. llvm-svn: 339633
* Fix check strings in test/CodeGenObjC/arc-blocks.m in preperation forAkira Hatanaka2018-08-141-14/+14
| | | | | | | | fixing a bug introduced in r339438. Check the descriptor global variables in the IR at both -O0 and -O2. llvm-svn: 339632
* [analyzer] Fix UninitializedObjectChecker to not crash on uninitialized "id" ↵George Karpenkov2018-08-133-2/+12
| | | | | | | | fields Differential Revision: https://reviews.llvm.org/D50673 llvm-svn: 339631
* [analyzer] [NFC] Introduce separate targets for testing the analyzer: ↵George Karpenkov2018-08-134-2/+34
| | | | | | | | | | | | | | | | | | | | | | | | check-clang-analyzer and check-clang-analyzer-z3 Current testing setup for analyzer tests with Z3 is rather inconvenient: There's no way to run the analyzer tests separately (I use LIT_FILTER=Analysis ninja check-clang, but a direct target is nicer). When Clang is built with Z3 support, there's no way to *not* run tests with Z3 solver, and this is often desired, as tests with Z3 solver take a very long time. This patch introduces two extra targets: - check-clang-analyzer - check-clang-analyzer-z3 which solve those problems. Differential Revision: https://reviews.llvm.org/D50594 llvm-svn: 339629
* Fix Clang warnings and bad #include filenames in r339595 and r339599.Richard Smith2018-08-133-5/+7
| | | | llvm-svn: 339624
* Model type attributes as regular Attrs.Richard Smith2018-08-1325-736/+581
| | | | | | | | | | Specifically, AttributedType now tracks a regular attr::Kind rather than having its own parallel Kind enumeration, and AttributedTypeLoc now holds an Attr* instead of holding an ad-hoc collection of Attr fields. Differential Revision: https://reviews.llvm.org/D50526 llvm-svn: 339623
* Convert if/else to a switch. NFC.Akira Hatanaka2018-08-131-42/+50
| | | | llvm-svn: 339613
* [OPENMP] Fix emission of the loop doacross constructs.Alexey Bataev2018-08-1311-218/+571
| | | | | | | The number of loops associated with the OpenMP loop constructs should not be considered as the number loops to collapse. llvm-svn: 339603
* [analyzer][UninitializedObjectChecker] Refactoring p5.: Handle pedantic mode ↵Kristof Umann2018-08-132-14/+19
| | | | | | | | in the checker class only Differential Revision: https://reviews.llvm.org/D50508 llvm-svn: 339601
* [analyzer][UninitializedObjectChecker] Refactoring p4.: Wrap FieldRegions ↵Kristof Umann2018-08-135-118/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and reduce weight on FieldChainInfo Before this patch, FieldChainInfo used a spaghetti: it took care of way too many cases, even though it was always meant as a lightweight wrapper around ImmutableList<const FieldRegion *>. This problem is solved by introducing a lightweight polymorphic wrapper around const FieldRegion *, FieldNode. It is an interface that abstracts away special cases like pointers/references, objects that need to be casted to another type for a proper note messages. Changes to FieldChainInfo: * Now wraps ImmutableList<const FieldNode &>. * Any pointer/reference related fields and methods were removed * Got a new add method. This replaces it's former constructors as a way to create a new FieldChainInfo objects with a new element. Changes to FindUninitializedField: * In order not to deal with dynamic memory management, when an uninitialized field is found, the note message for it is constructed and is stored instead of a FieldChainInfo object. (see doc around addFieldToUninits). Some of the test files are changed too, from now on uninitialized pointees of references always print "uninitialized pointee" instead of "uninitialized field" (which should've really been like this from the beginning). I also updated every comment according to these changes. Differential Revision: https://reviews.llvm.org/D50506 llvm-svn: 339599
* Enforce instantiation of template multiversion functionsErich Keane2018-08-134-8/+26
| | | | | | | | | Multiversioned member functions inside of a template type were not properly being emitted. The solution to this is to simply ensure that their bodies are correctly evaluated/assigned during template instantiation. llvm-svn: 339597
* [analyzer][UninitializedObjectChecker] Refactoring p3.: printTail moved out ↵Kristof Umann2018-08-133-16/+17
| | | | | | | | | | from FieldChainInfo This is a standalone part of the effort to reduce FieldChainInfos inteerface. Differential Revision: https://reviews.llvm.org/D50505 llvm-svn: 339596
* [analyzer][UninitializedObjectChecker] Refactoring p2.: Moving pointer ↵Kristof Umann2018-08-134-297/+376
| | | | | | | | | | | | | | | | | | | | chasing to a separate file In this patch, the following classes and functions have been moved to a header file: FieldChainInfo FindUninitializedFields isPrimitiveType This also meant that they moved from anonymous namespace to clang::ento. Code related to pointer chasing now relies in its own file. There's absolutely no functional change in this patch -- its literally just copy pasting. Differential Revision: https://reviews.llvm.org/D50504 llvm-svn: 339595
* [Sema] fix -Wfloat-conversion test case.Nick Desaulniers2018-08-131-1/+1
| | | | | | | | | | | | | | | | | | Summary: Fixes r339581 ("[SEMA] add more -Wfloat-conversion to compound assigment analysis"). This test case was caught in postsubmit testing. Reviewers: aaron.ballman, gkistanova Reviewed By: aaron.ballman Subscribers: cfe-commits, srhines Differential Revision: https://reviews.llvm.org/D50647 llvm-svn: 339593
* [analyzer][UninitializedObjectChecker] Refactoring p1.: ImmutableList ↵Kristof Umann2018-08-131-7/+8
| | | | | | | | | | | | | | | | factory is no longer static This patch is the first part of a series of patches to refactor UninitializedObjectChecker. The goal of this effort is to Separate pointer chasing from the rest of the checker, Increase readability and reliability, Don't impact performance (too bad). In this one, ImmutableList's factory is moved to FindUninitializedFields. Differential Revision: https://reviews.llvm.org/D50503 llvm-svn: 339591
* [AST] Update/correct the static_asserts for the bit-fields in TypeBruno Ricci2018-08-131-2/+21
| | | | | | | | | | | | | | | | The current static_assert only checks that ObjCObjectTypeBitfields fits into an unsigned. However it turns out that FunctionTypeBitfields do not currently fits into an unsigned. Therefore the anonymous union containing the bit-fields always use 8 bytes instead of 4. This patch removes the lone misguided static_assert and systematically checks the size of each bit-field. Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D50630 llvm-svn: 339582
* [SEMA] add more -Wfloat-conversion to compound assigment analysisNick Desaulniers2018-08-132-27/+59
| | | | | | | | | | | | | | Summary: Fixes Bug: https://bugs.llvm.org/show_bug.cgi?id=27061 Reviewers: aaron.ballman, acoomans Reviewed By: aaron.ballman, acoomans Subscribers: acoomans, cfe-commits, srhines, pirama Differential Revision: https://reviews.llvm.org/D50467 llvm-svn: 339581
* Revert "[OPENMP] Fix emission of the loop doacross constructs."Alexey Bataev2018-08-1311-540/+216
| | | | | | This reverts commit r339568 because of the problems with the buildbots. llvm-svn: 339574
OpenPOWER on IntegriCloud