summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* ContentCache: Drop getBuffer's dependency on SourceManagerDuncan P. N. Exon Smith2019-08-264-33/+31
| | | | | | | | | | | | | Refactor ContentCache::IsSystemFile to IsFileVolatile, checking SourceManager::userFilesAreVolatile at construction time. This is a step toward lowering ContentCache down from SourceManager to FileManager. No functionality change intended. https://reviews.llvm.org/D66713 llvm-svn: 369958
* Reword the C11 extension diagnostic.Aaron Ballman2019-08-263-30/+30
| | | | | | This makes it more consistent with other language extension diagnostics. llvm-svn: 369957
* Fix gen-cdb-fragment test for WindowsAlex Lorenz2019-08-261-2/+2
| | | | | | Windows bots didn't seem to like the empty argument, so I rewrote the test. llvm-svn: 369956
* [Clang][Bundler] Use llvm-objcopy for creating fat object filesSergey Dmitriev2019-08-264-125/+29
| | | | | | | | clang-offload-bundler currently uses partial linking for creating fat object files, but such technique cannot be used on Windows due to the absence of partial linking support in the linker. This patch changes implementation to use llvm-objcopy for merging device and host objects instead of doing partial linking. This is one step forward towards enabling OpenMP offload on Windows. Differential Revision: https://reviews.llvm.org/D66485 llvm-svn: 369955
* Diagnose use of _Thread_local as an extension when not in C11 mode.Aaron Ballman2019-08-266-38/+55
| | | | llvm-svn: 369954
* [OPENMP][NVPTX]Fix critical region codegen.Alexey Bataev2019-08-262-3/+26
| | | | | | | | | | | | | | | | | Summary: Previously critical regions were emitted with the barrier making it a worksharing construct though it is not. Also, it leads to incorrect behavior in Cuda9+. Patch fixes this problem. Reviewers: ABataev, jdoerfert Subscribers: jholewinski, guansong, cfe-commits, grokos Tags: #clang Differential Revision: https://reviews.llvm.org/D66673 llvm-svn: 369946
* [msvc] Add necessary #include to make compiler intrinsics available.Richard Smith2019-08-261-0/+4
| | | | llvm-svn: 369944
* FileManager: Use llvm::Expected in new getFileRef APIDuncan P. N. Exon Smith2019-08-265-28/+36
| | | | | | | | | | | | | | | | | | | | | `FileManager::getFileRef` is a modern API which we expect to convert to over time. We should modernize the error handling as well, using `llvm::Expected` instead of `llvm::ErrorOr`, to help clients that care about errors to ensure nothing is missed. However, not all clients care. I've also added another path for those that don't: - `FileEntryRef` is now copy- and move-assignable (using a pointer instead of a reference). - `FileManager::getOptionalFileRef` returns an `llvm::Optional` instead of `llvm::Expected`. - Added an `llvm::expectedToOptional` utility in case this is useful elsewhere. https://reviews.llvm.org/D66705 llvm-svn: 369943
* Fix file header.Richard Smith2019-08-261-1/+1
| | | | llvm-svn: 369941
* Improve behavior in the case of stack exhaustion.Richard Smith2019-08-2621-123/+348
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Clang performs various recursive operations (such as template instantiation), and may use non-trivial amounts of stack space in each recursive step (for instance, due to recursive AST walks). While we try to keep the stack space used by such steps to a minimum and we have explicit limits on the number of such steps we perform, it's impractical to guarantee that we won't blow out the stack on deeply recursive template instantiations on complex ASTs, even with only a moderately high instantiation depth limit. The user experience in these cases is generally terrible: we crash with no hint of what went wrong. Under this patch, we attempt to do better: * Detect when the stack is nearly exhausted, and produce a warning with a nice template instantiation backtrace, telling the user that we might run slowly or crash. * For cases where we're forced to trigger recursive template instantiation in arbitrarily-deeply-nested contexts, check whether we're nearly out of stack space and allocate a new stack (by spawning a new thread) after producing the warning. Reviewers: rnk, aaron.ballman Subscribers: mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66361 llvm-svn: 369940
* [driver] add a new option `-gen-cdb-fragment-path` to emitAlex Lorenz2019-08-264-4/+89
| | | | | | | | | | | | | | a fragment of a compilation database for each compilation This patch adds a new option called -gen-cdb-fragment-path to the driver, which can be used to specify a directory path to which clang can emit a fragment of a CDB for each compilation it needs to invoke. This option emits the same CDB contents as -MJ, and will be ignored if -MJ is specified. Differential Revision: https://reviews.llvm.org/D66555 llvm-svn: 369938
* Fix use of invalidated iterator introduced by r369680.Richard Smith2019-08-261-4/+4
| | | | llvm-svn: 369932
* [libclang][index][NFCi] Refactor machinery for skipping function bodiesJan Korous2019-08-261-41/+65
| | | | | | | | | | | Refactor machinery for skipping inline function bodies that have already been parsed in other frontend actions. Preparations for moving this code to libIndex. Differential Revision: https://reviews.llvm.org/D66694 llvm-svn: 369931
* [NFC] Add comments to some bool arguments for better readabilityGabor Horvath2019-08-261-4/+8
| | | | llvm-svn: 369928
* Fix -dA flag, it is not a preprocessor flag.Erich Keane2019-08-263-6/+3
| | | | | | | | | -dA was in the d_group, which is a preprocessor state dumping group. However -dA is a debug flag to cause a verbose asm. It was already implemented to do the same thing as -fverbose-asm, so make it just be an alias. llvm-svn: 369926
* clang-format: [JS] handle `as const`.Martin Probst2019-08-262-0/+7
| | | | | | | | | | | | | | | | | | | | Summary: TypeScript 3.4 supports casting into a const type using `as const`: const x = {x: 1} as const; Previously, clang-format would insert a space after the `const`. With this patch, no space is inserted after the sequence `as const`. Reviewers: krasimir Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66736 llvm-svn: 369916
* [Wdocumentation] improve wording of a warning messageDmitri Gribenko2019-08-252-7/+7
| | | | | | | | | | | Based on @davezarzycki remarks in D64696 improved the wording of the warning message. Differential Revision: https://reviews.llvm.org/D66700 Patch by Mark de Wever. llvm-svn: 369873
* FileManager: Factor duplicated code in getBufferForFile, NFCDuncan P. N. Exon Smith2019-08-252-12/+14
| | | | | | | Incidentally, this also unifies the two versions (removing an unnecessary call to `SmallString::c_str`). llvm-svn: 369861
* [OpenCL] Microoptimize OCL2Qual a bitBenjamin Kramer2019-08-242-20/+21
| | | | | | Still not optimal, but makes clang 25k smaller. llvm-svn: 369846
* [analyzer] Analysis: Fix checker silencingCsaba Dabis2019-08-242-29/+35
| | | | llvm-svn: 369845
* [Testing] Unbreak r369830David Zarzycki2019-08-241-0/+1
| | | | llvm-svn: 369843
* PR42513: Enter the proper DeclContext before substituting into anRichard Smith2019-08-243-3/+24
| | | | | | | | | | | | default template argument expression. We already did this for type template parameters and template template parameters, but apparently forgot to do so for non-type template parameters. This causes the substituted default argument expression to be substituted in the proper context, and in particular to properly mark its subexpressions as odr-used. llvm-svn: 369834
* Re-enable DependencyScannerTest on windows with the right fixesAlex Lorenz2019-08-241-13/+16
| | | | | | It should now pass. llvm-svn: 369832
* NFC: Rename some sanitizer related lifetime checksVitaly Buka2019-08-243-47/+55
| | | | llvm-svn: 369830
* PR40674: fix assertion failure if a structured binding declaration has aRichard Smith2019-08-242-2/+9
| | | | | | | tuple-like decomposition that produces value-dependent reference bindings. llvm-svn: 369829
* [libclang][index][NFC] Fix test for skipping already parsed function bodiesJan Korous2019-08-231-1/+1
| | | | llvm-svn: 369822
* Fix a test to test what the name suggest.Gabor Horvath2019-08-231-1/+1
| | | | llvm-svn: 369820
* [LifetimeAnalysis] Make it possible to disable the new warningsGabor Horvath2019-08-234-40/+97
| | | | llvm-svn: 369817
* Do a sweep of symbol internalization. NFC.Benjamin Kramer2019-08-234-7/+10
| | | | llvm-svn: 369803
* [OPENMP5]Use nonmonotonic modifier by default for non-static andAlexey Bataev2019-08-232-13/+33
| | | | | | | | | | non-ordered loops. According to OpenMP 5.0, 2.9.2 Worksharing-Loop Construct, Desription, If the static schedule kind is specified or if the ordered clause is specified, and if the nonmonotonic modifier is not specified, the effect is as if the monotonic modifier is specified. Otherwise, unless the monotonic modifier is specified, the effect is as if the nonmonotonic modifier is specified. The first part of this requirement is implemented in runtime. Patch adds support for the second, nonmonotonic, part of this requirement. llvm-svn: 369801
* [Sema] Don't warn on printf('%hd', [char]) (PR41467)Nathan Huckleberry2019-08-236-11/+25
| | | | | | | | | | | | | | | | Summary: Link: https://bugs.llvm.org/show_bug.cgi?id=41467 Reviewers: rsmith, nickdesaulniers, aaron.ballman, lebedev.ri Reviewed By: nickdesaulniers, aaron.ballman, lebedev.ri Subscribers: lebedev.ri, nickdesaulniers, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66186 llvm-svn: 369791
* [OpenCL] Renamed value of std flag in C++ mode.Anastasia Stulova2019-08-232-2/+2
| | | | | | | | Clang should accept -std=clc++ (not -std=c++!) for OpenCL. This was forgotten in r367008. llvm-svn: 369779
* Fixed a typo.Artem Belevich2019-08-231-1/+1
| | | | llvm-svn: 369777
* [OPENMP5.0]Add support for device_type clause in declare targetAlexey Bataev2019-08-2325-97/+647
| | | | | | | | | | construct. OpenMP 5.0 introduced new clause for declare target directive, device_type clause, which may accept values host, nohost, and any. Host means that the function must be emitted only for the host, nohost - only for the device, and any - for both, device and the host. llvm-svn: 369775
* [NFC] Move some variable declarations into their 'if' conditions.Erich Keane2019-08-231-9/+7
| | | | | | | | A couple of variables are being declared outside of the 'if' condition that is their only actual use. Additionally, switch a few 'const TYPE *' to 'const auto *' for consistency. llvm-svn: 369773
* [analyzer] Avoid unnecessary enum range check on LValueToRValue castsKristof Umann2019-08-233-1/+59
| | | | | | | | | | | | | | | | Summary: EnumCastOutOfRangeChecker should not perform enum range checks on LValueToRValue casts, since this type of cast does not actually change the underlying type. Performing the unnecessary check actually triggered an assertion failure deeper in EnumCastOutOfRange for certain input (which is captured in the accompanying test code). Reviewers: #clang, Szelethus, gamesh411, NoQ Reviewed By: Szelethus, gamesh411, NoQ Subscribers: NoQ, gamesh411, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, Charusso, bjope, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66014 llvm-svn: 369760
* clang-format: Disable across-block include reordering.Nico Weber2019-08-231-0/+21
| | | | | | Differential Revision: https://reviews.llvm.org/D66650 llvm-svn: 369759
* [Docs][OpenCL] Several corrections to C++ for OpenCLAnastasia Stulova2019-08-232-63/+74
| | | | | | Differential Revision:https://reviews.llvm.org/D64418 llvm-svn: 369749
* [clang-format] Recognize ECMAScript module .mjs as JavaScriptFangrui Song2019-08-231-2/+3
| | | | | | | | | | | | | | PR43085. Recognize .mjs files as JavaScript. .mjs is the extension for ECMAScript modules. A specific extension (and associated content type javascript/esm) is introduced to differentiate it from CommonJS modules and solve some interoperability problems. Differential Revision: https://reviews.llvm.org/D66584 Patch by Fergal Daly llvm-svn: 369732
* [analyzer] CastValueChecker: Correctly model results of based-to-derived casts.Artem Dergachev2019-08-233-12/+39
| | | | | | | | | | Our SVal hierarchy doesn't allow modeling pointer casts as no-op. The pointer type is instead encoded into the pointer object. Defer to our usual pointer casting facility, SValBuilder::evalBinOp(). Fixes a crash. llvm-svn: 369729
* [analyzer] CastValueChecker: Provide DynamicTypeMap with pointer types only.Artem Dergachev2019-08-235-31/+37
| | | | | | | | | The idea to drop this requirement is good, but for now every other user of DynamicTypeInfo expects pointer types. Fixes a crash. llvm-svn: 369728
* [analyzer] CastValueChecker: Avoid modeling casts between objects.Artem Dergachev2019-08-235-10/+27
| | | | | | | | | Our method only works correctly when casting a pointer to a pointer or a reference to a reference. Fixes a crash. llvm-svn: 369727
* [analyzer] DynamicTypeInfo: Avoid putting null regions into dynamic typemap.Artem Dergachev2019-08-232-0/+8
| | | | | | Fixes a crash. llvm-svn: 369726
* Revert "PR42587: diagnose unexpanded uses of a pack parameter of a generic" ↵Richard Smith2019-08-233-18/+3
| | | | | | | | due to buildbot breakage. This reverts commit r369722. llvm-svn: 369725
* PR42587: diagnose unexpanded uses of a pack parameter of a genericRichard Smith2019-08-233-3/+18
| | | | | | lambda from within the lambda-declarator. llvm-svn: 369722
* [clang][ifs] Dropping older experimental interface stub formats.Puyan Lotfi2019-08-2217-227/+104
| | | | | | | | | | | | I've been working on a new tool, llvm-ifs, for merging interface stub files generated by clang and I've iterated on my derivative format of TBE to a newer format. llvm-ifs will only support the new format, so I am going to drop the older experimental interface stubs formats in this commit to make things simpler. Differential Revision: https://reviews.llvm.org/D66573 llvm-svn: 369719
* [clang][ifs] New interface stubs format (llvm triple based).Puyan Lotfi2019-08-226-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | After posting llvm-ifs on phabricator, I made some progress in hardening up how I think the format for Interface Stubs should look. There are a number of things I think the TBE format was missing (no endianness, no info about the Object Format because it assumes ELF), so I have added those and broken off from being as similar to the TBE schema. In a subsequent commit I can drop the other formats. An example of how The format will look is as follows: --- !experimental-ifs-v1 IfsVersion: 1.0 Triple: x86_64-unknown-linux-gnu ObjectFileFormat: ELF Symbols: _Z9nothiddenv: { Type: Func } _Z10cmdVisiblev: { Type: Func } ... The format is still marked experimental. Differential Revision: https://reviews.llvm.org/D66446 llvm-svn: 369715
* [libclang][NFC] Remove debug commentJan Korous2019-08-221-3/+1
| | | | llvm-svn: 369714
* [Bugfix] fix r369705 unit testNick Desaulniers2019-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: Aliases aren't supported on OSX. Add a GNU target triple. Reported-by: leonardchan Reported-by: erik.pilkington Reviewers: leonardchan, erik.pilkington Reviewed By: leonardchan, erik.pilkington Subscribers: dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66622 llvm-svn: 369713
* [Clang][CodeGen] set alias linkage on QualTypeNick Desaulniers2019-08-222-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: It seems that CodeGen was always using ExternalLinkage when emitting a GlobalDecl with __attribute__((alias)). This leads to symbol redefinitions (ODR) that cause failures at link time for static aliases. This is readily attempting to link an ARM (32b) allyesconfig Linux kernel built with Clang. Reported-by: nathanchance Suggested-by: ihalip Link: https://bugs.llvm.org/show_bug.cgi?id=42377 Link: https://github.com/ClangBuiltLinux/linux/issues/631 Reviewers: rsmith, aaron.ballman, erichkeane Reviewed By: aaron.ballman Subscribers: javed.absar, kristof.beyls, cfe-commits, srhines, ihalip, nathanchance Tags: #clang Differential Revision: https://reviews.llvm.org/D66492 llvm-svn: 369705
OpenPOWER on IntegriCloud