summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [clang-cl] Fix PR38934: failing to dllexport class template member w/ ↵Hans Wennborg2018-09-142-0/+20
| | | | | | | | | | | | explicit instantiation and PCH The code in ASTContext::DeclMustBeEmitted was supposed to handle this, but didn't take into account that synthesized members such as operator= might not get marked as template specializations, because they're synthesized on the instantiation directly when handling the class-level dllexport attribute. llvm-svn: 342240
* [clang] Make sure attributes on member classes are applied properlyLouis Dionne2018-09-142-0/+18
| | | | | | | | | | | | | | | | | | | | | | | Summary: Attributes on member classes of class templates and member class templates of class templates are not currently instantiated. This was discovered by Richard Smith here: http://lists.llvm.org/pipermail/cfe-dev/2018-September/059291.html This commit makes sure that attributes are instantiated properly. This commit does not fix the broken behavior for member partial and explicit specializations of class templates. PR38913 Reviewers: rsmith Subscribers: dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D51997 llvm-svn: 342238
* [VFS] vfs::directory_iterator yields path and file type instead of full StatusSam McCall2018-09-1410-108/+116
| | | | | | | | | | | | | | | | | | | | | | | Summary: Most callers I can find are using only `getName()`. Type is used by the recursive iterator. Now we don't have to call stat() on every listed file (on most platforms). Exceptions are e.g. Solaris where readdir() doesn't include type information. On those platforms we'll still stat() - see D51918. The result is significantly faster (stat() can be slow). My motivation: this may allow us to improve clang IO on large TUs with long include search paths. Caching readdir() results may allow us to skip many stat() and open() operations on nonexistent files. Reviewers: bkramer Subscribers: fedor.sergeev, cfe-commits Differential Revision: https://reviews.llvm.org/D51921 llvm-svn: 342232
* [Driver] Fix missing MultiArch include dir on powerpcspeKristina Brooks2018-09-141-1/+2
| | | | | | | | | | | | On powerpc-linux-gnuspe, the header files are located in their own include directory named /usr/lib/powerpc-linux-gnuspe, so add this directory to PPCMultiarchIncludeDirs. Patch by glaubitz (John Paul Adrian Glaubitz) Differential Revision: https://reviews.llvm.org/D52066 llvm-svn: 342231
* [Tooling] JSONCompilationDatabasePlugin infers compile commands for missing ↵Sam McCall2018-09-142-4/+11
| | | | | | | | | | | | | | | | files Summary: See the existing InterpolatingCompilationDatabase for details on how this works. We've been using this in clangd for a while, the heuristics seem to work well. Reviewers: bkramer Subscribers: ilya-biryukov, ioeric, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D51729 llvm-svn: 342228
* [analyzer] Restore final on NeedsCastLocField. NFCIlya Biryukov2018-09-141-1/+1
| | | | | | To fix compiler warning about non-virtual dtor introduced in r342221. llvm-svn: 342225
* [analyzer] Attempt to make a windows buildbot happy.Kristof Umann2018-09-141-1/+1
| | | | | | | Got an error that a cast is happening from a pointer type to long, which is smaller. llvm-svn: 342223
* [analyzer][UninitializedObjectChecker] Support for nonloc::LocAsIntegerKristof Umann2018-09-143-14/+41
| | | | | | Differential Revision: https://reviews.llvm.org/D49437 llvm-svn: 342221
* [analyzer][UninitializedObjectChecker] New flag to ignore records based on ↵Kristof Umann2018-09-144-5/+182
| | | | | | | | | | | | | | | | | it's fields Based on a suggestion from @george.karpenkov. In some cases, structs are used as unions with a help of a tag/kind field. This patch adds a new string flag (a pattern), that is matched against the fields of a record, and should a match be found, the entire record is ignored. For more info refer to http://lists.llvm.org/pipermail/cfe-dev/2018-August/058906.html and to the responses to that, especially http://lists.llvm.org/pipermail/cfe-dev/2018-August/059215.html. Differential Revision: https://reviews.llvm.org/D51680 llvm-svn: 342220
* [analyzer][UninitializedObjectChecker] Refactored checker optionsKristof Umann2018-09-143-59/+63
| | | | | | | | | | | | | Since I plan to add a number of new flags, it made sense to encapsulate them in a new struct, in order not to pollute FindUninitializedFields's constructor with new boolean options with super long names. This revision practically reverts D50508, since FindUninitializedFields now accesses the pedantic flag anyways. Differential Revision: https://reviews.llvm.org/D51679 llvm-svn: 342219
* [analyzer][UninitializedObjectChecker] Correct dynamic type is acquired for ↵Kristof Umann2018-09-142-11/+51
| | | | | | | | record pointees Differential Revision: https://reviews.llvm.org/D50892 llvm-svn: 342217
* Use Chrome and Firefox as example of success for clangSylvestre Ledru2018-09-141-5/+5
| | | | llvm-svn: 342216
* [analyzer][UninitializedObjectChecker] Updated commentsKristof Umann2018-09-143-74/+67
| | | | | | | | | | | | | Some of the comments are incorrect, imprecise, or simply nonexistent. Since I have a better grasp on how the analyzer works, it makes sense to update most of them in a single swoop. I tried not to flood the code with comments too much, this amount feels just right to me. Differential Revision: https://reviews.llvm.org/D51417 llvm-svn: 342215
* remove 11 years old videos from the homepage. if you have a suggestion, ↵Sylvestre Ledru2018-09-141-10/+0
| | | | | | please drop me an email llvm-svn: 342214
* [analyzer][UninitializedObjectChecker] Fixed dereferencingKristof Umann2018-09-146-91/+207
| | | | | | | | | | iThis patch aims to fix derefencing, which has been debated for months now. Instead of working with SVals, the function now relies on TypedValueRegion. Differential Revision: https://reviews.llvm.org/D51057 llvm-svn: 342213
* update the doc to compare with gcc 4.9 instead of 4.2Sylvestre Ledru2018-09-141-2/+5
| | | | llvm-svn: 342212
* gcc is now returning the same output on this example, removing this exampleSylvestre Ledru2018-09-141-6/+0
| | | | llvm-svn: 342211
* [XRay][clang] Emit "never-instrument" attributeDean Michael Berris2018-09-144-22/+55
| | | | | | | | | | | | | | | | | | | | | | | Summary: Before this change, we only emit the XRay attributes in LLVM IR when the -fxray-instrument flag is provided. This may cause issues with thinlto when the final binary is being built/linked with -fxray-instrument, and the constitutent LLVM IR gets re-lowered with xray instrumentation. With this change, we can honour the "never-instrument "attributes provided in the source code and preserve those in the IR. This way, even in thinlto builds, we retain the attributes which say whether functions should never be XRay instrumented. This change addresses llvm.org/PR38922. Reviewers: mboerger, eizan Subscribers: mehdi_amini, dexonsmith, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D52015 llvm-svn: 342200
* [ODRHash] Fix early exit that skipped code.Richard Trieu2018-09-143-3/+13
| | | | | | | | | | There is a bit of code at the end of AddDeclaration that should be run on every exit of the function. However, there was an early exit beforehand that could be triggered, which causes a small amount of data to skip the hashing, leading to false positive mismatch. Use a separate function so that this code is always run. llvm-svn: 342199
* Relax alignment assumptions in a test after r342194Vedant Kumar2018-09-141-2/+2
| | | | | | | | | Don't hardcode align 8. Fixes a bot failure: http://lab.llvm.org:8011/builders/clang-cmake-armv8-full/builds/6373 llvm-svn: 342196
* [Sema] Remove location from implicit capture init exprVedant Kumar2018-09-136-17/+36
| | | | | | | | | | | | | | | | | | A lambda's closure is initialized when the lambda is declared. For implicit captures, the initialization code emitted from EmitLambdaExpr references source locations *within the lambda body* in the function containing the lambda. This results in a poor debugging experience: we step to the line containing the lambda, then into lambda, out again, over and over, until every capture's field is initialized. To improve stepping behavior, assign the starting location of the lambda to expressions which initialize an implicit capture within it. rdar://39807527 Differential Revision: https://reviews.llvm.org/D50927 llvm-svn: 342194
* Fix crash on call to __builtin_memcpy with a null pointer to anRichard Smith2018-09-135-9/+52
| | | | | | | | incomplete type. Also improve the diagnostics for similar situations. llvm-svn: 342192
* Diagnose likely typos in #include directives.Richard Smith2018-09-134-2/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When someone writes #include "<some_file>" or #include " some_file " the compiler returns "file not fuond..." with fonts and quotes that may make it hard to see there are excess quotes or surprising bytes in the filename. Assuming that files are usually logically named and start and end with an alphanumeric character, we can check for the file's existence by stripping the non-alphanumeric leading or trailing characters. If the file is found, emit a non-fatal error with a FixItHint. Patch by Christy Lee! Reviewers: aaron.ballman, erikjv, rsmith Reviewed By: rsmith Subscribers: lebedev.ri, xbolva00, sammccall, modocache, erikjv, aaron.ballman, cfe-commits Differential Revision: https://reviews.llvm.org/D51333 llvm-svn: 342177
* Support -fno-omit-frame-pointer with -pg.Stephen Hines2018-09-132-1/+7
| | | | | | | | | | | | | | | | | | Summary: Previously, any instance of -fomit-frame-pointer would make it such that -pg was an invalid flag combination. If -fno-omit-frame-pointer is passed later on the command line (such that it actually takes effect), -pg should be allowed. Reviewers: nickdesaulniers Reviewed By: nickdesaulniers Subscribers: manojgupta, nickdesaulniers, cfe-commits, kongyi, chh, pirama Differential Revision: https://reviews.llvm.org/D51713 llvm-svn: 342165
* [NFC]Refactor MultiVersion Resolver Emission to combine typesErich Keane2018-09-134-93/+108
| | | | | | | | | Previously, both types (plus the future target-clones) of multiversioning had a separate ResolverOption structure and emission function. This patch combines the two, at the expense of a slightly more expensive sorting function. llvm-svn: 342152
* [OPENMP] Fix PR38903: Crash on instantiation of the non-dependentAlexey Bataev2018-09-139-67/+144
| | | | | | | | | | | declare reduction. If the declare reduction construct with the non-dependent type is defined in the template construct, the compiler might crash on the template instantition. Reworked the whole instantiation scheme for the declare reduction constructs to fix this problem correctly. llvm-svn: 342151
* Print correctly dependency paths on WindowsDavid Bolvansky2018-09-134-18/+22
| | | | | | | | | | | | | | | | | | | Summary: Before: main.o: main.c ../include/lib\test.h After: main.o: main.c ../include/lib/test.h Fixes PR38877 Reviewers: zturner Subscribers: xbolva00, cfe-commits Differential Revision: https://reviews.llvm.org/D51847 llvm-svn: 342139
* [AArch64] Enable return address signing for static ctorsOliver Stannard2018-09-132-0/+27
| | | | | | | | | | | Functions generated by clang and included in the .init_array section (such as static constructors) do not follow the usual code path for adding target-specific function attributes, so we have to add the return address signing attribute here too, as is currently done for the sanitisers. Differential revision: https://reviews.llvm.org/D51418 llvm-svn: 342126
* Fix MSVC "illegal conversion; more than one user-defined conversion has been ↵Simon Pilgrim2018-09-131-1/+1
| | | | | | implicitly applied" warning. NFCI. llvm-svn: 342125
* [clang-format] Wrapped block after case label should not be merged into one lineOwen Pan2018-09-132-0/+30
| | | | | | | | PR38854 Differential Revision: http://reviews.llvm.org/D51719 llvm-svn: 342116
* [AArch64] Support reserving x1-7 registers.Tri Vo2018-09-126-12/+123
| | | | | | | | | | | | | | Summary: Reserving registers x1-7 is used to support CONFIG_ARM64_LSE_ATOMICS in Linux kernel. This change adds support for reserving registers x1 through x7. Reviewers: javed.absar, efriedma, nickdesaulniers, srhines, phosek Reviewed By: nickdesaulniers Subscribers: manojgupta, jfb, cfe-commits, kristof.beyls Differential Revision: https://reviews.llvm.org/D48581 llvm-svn: 342100
* Remove dead code made unnecessary by r342018.Richard Smith2018-09-121-7/+0
| | | | llvm-svn: 342098
* Track definition merging on the canonical declaration even when localRichard Smith2018-09-125-28/+46
| | | | | | | | | | | | | | submodule visibility is disabled. Attempting to pick a specific declaration to make visible when the module containing the merged declaration becomes visible is error-prone, as we don't yet know which declaration we'll choose to be the definition when we are informed of the merging. This reinstates r342019, reverted in r342020. The regression previously observed after this commit was fixed in r342096. llvm-svn: 342097
* When we leave a module header, make that header visible in itsRichard Smith2018-09-126-6/+37
| | | | | | includer's context, even if its overall module is unavailable. llvm-svn: 342096
* [Hexagon] Remove fp-contract=fast setting for at O3Brendon Cahoon2018-09-122-6/+1
| | | | | | | | | Change Hexagon so that the setting for fp-contract is the default setting. This makes Hexagon consistent with all other targets. Differential Revision: https://reviews.llvm.org/D49999 llvm-svn: 342078
* [Diagnostic] Fix a warning typo. NFC.Matt Davis2018-09-124-6/+6
| | | | | | s/aligment/alignment/ llvm-svn: 342068
* [OPENMP] Fix PR38902: support ADL for declare reduction constructs.Alexey Bataev2018-09-122-1/+120
| | | | | | | Added support for argument-dependent lookup when trying to find the required declare reduction decl. llvm-svn: 342062
* [RISCV] Explicitly set an empty --sysroot in the testRoger Ferrer Ibanez2018-09-121-0/+2
| | | | | | | | | | | | | | | | | In rL341655 we added additional behaviour to the Driver for riscv32-unknown-elf when the sysroot is empty. The new tests that check the new behaviour expect that the absence of --sysroot in the command-line implies that the sysroot empty. This doesn't hold if clang is built with a non-empty DEFAULT_SYSROOT in cmake. When this is the case, this test fails. Since the new behaviour is triggered when the sysroot is empty, pass an empty --sysroot to avoid using the default (if any). Differential Revision: https://reviews.llvm.org/D51972 llvm-svn: 342060
* [CodeGen] Align rtti and vtable dataDavid Green2018-09-129-36/+50
| | | | | | | | | | Previously the alignment on the newly created rtti/typeinfo data was largely not set, meaning that DataLayout::getPreferredAlignment was free to overalign it to 16 bytes. This causes unnecessary code bloat. Differential Revision: https://reviews.llvm.org/D51416 llvm-svn: 342053
* [CodeGen][ARM] Coerce FP16 vectors to integer vectors when neededMikhail Maltsev2018-09-123-153/+252
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: On targets that do not support FP16 natively LLVM currently legalizes vectors of FP16 values by scalarizing them and promoting to FP32. This causes problems for the following code: void foo(int, ...); typedef __attribute__((neon_vector_type(4))) __fp16 float16x4_t; void bar(float16x4_t x) { foo(42, x); } According to the AAPCS (appendix A.2) float16x4_t is a containerized vector fundamental type, so 'foo' expects that the 4 16-bit FP values are packed into 2 32-bit registers, but instead bar promotes them to 4 single precision values. Since we already handle scalar FP16 values in the frontend by bitcasting them to/from integers, this patch adds similar handling for vector types and homogeneous FP16 vector aggregates. One existing test required some adjustments because we now generate more bitcasts (so the patch changes the test to target a machine with native FP16 support). Reviewers: eli.friedman, olista01, SjoerdMeijer, javed.absar, efriedma Reviewed By: javed.absar, efriedma Subscribers: efriedma, kristof.beyls, cfe-commits, chrib Differential Revision: https://reviews.llvm.org/D50507 llvm-svn: 342034
* Fix Check test to avoid output string mismatchChristian Bruel2018-09-121-8/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D51354 llvm-svn: 342031
* [Tooling] Wait for all threads to finish before resetting CWD.Eric Liu2018-09-121-0/+2
| | | | llvm-svn: 342028
* [Driver] Search LibraryPaths when handling -print-file-namePetr Hosek2018-09-122-18/+29
| | | | | | | | This is necessary to handle the multiarch runtime directories. Differential Revision: https://reviews.llvm.org/D51573 llvm-svn: 342021
* Revert r342019, "Track definition merging on the canonical declarationRichard Smith2018-09-125-46/+28
| | | | | | | | | even when [...]" Further testing has revealed that this causes build breaks during explicit module compilations. llvm-svn: 342020
* Track definition merging on the canonical declaration even when localRichard Smith2018-09-125-28/+46
| | | | | | | | | | | submodule visibility is disabled. Attempting to pick a specific declaration to make visible when the module containing the merged declaration becomes visible is error-prone, as we don't yet know which declaration we'll choose to be the definition when we are informed of the merging. llvm-svn: 342019
* Consistently create a new declaration when merging a pre-existing butRichard Smith2018-09-129-78/+126
| | | | | | | | | | | | | | | | hidden definition with a would-be-parsed redefinition. This permits a bunch of cleanups. In particular, we no longer need to take merged definitions into account when checking declaration visibility, only when checking definition visibility, which makes certain visibility checks take linear instead of quadratic time. We could also now remove the UPD_DECL_EXPORTED update record and track on each declaration whether it was demoted from a definition (as we already do for variables), but I'm not doing that in this patch to keep the changes here simpler. llvm-svn: 342018
* Fix tracking of merged definitions when the merge target is also mergedRichard Smith2018-09-123-3/+38
| | | | | | into something else. llvm-svn: 342017
* [NFC] Fix build breakage caused by D51948Shuai Wang2018-09-111-0/+1
| | | | llvm-svn: 342005
* [analyzer] Add ExprMutationAnalyzerShuai Wang2018-09-115-0/+1305
| | | | | | | | | | | | | | | | | | Summary: This is 1/2 of moving ExprMutationAnalyzer from clangtidy to clang/Analysis. This diff along simply copies the ExprMutationAnalyzer over with trivial modifications (e.g. include path, namespace) 2/2 will migrate existing usage of ExprMutationAnalyzer and remove the original copy inside clangtidy. Reviewers: george.karpenkov Subscribers: mgorny, xazax.hun, szepet, a.sidorin, mikhail.ramalho, Szelethus, cfe-commits, JonasToth Differential Revision: https://reviews.llvm.org/D51948 llvm-svn: 341994
* Introduce the VTable interleaving scheme to the CFI design documentationPeter Collingbourne2018-09-111-0/+148
| | | | | | | | | | | | | | Dimitar et. al. in [1] proposed a novel VTable layout scheme that enables efficient implementation of virtual call CFI. This patch adds an introduction of this scheme to the CFI design documentation. [1] Protecting C++ Dynamic Dispatch Through VTable Interleaving. Dimitar Bounov, Rami Gökhan Kıcı, Sorin Lerner. https://cseweb.ucsd.edu/~lerner/papers/ivtbl-ndss16.pdf Patch by Zhaomo Yang! Differential Revision: https://reviews.llvm.org/D50372 llvm-svn: 341989
OpenPOWER on IntegriCloud