summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [libTooling] Add stencil combinators for nodes that may be pointers or values.Yitzhak Mandelbaum2019-11-223-4/+89
| | | | | | | | | | | | | | | | Summary: Adds combinators `maybeDeref` and `maybeAddressOf` to provide a uniform way to handle nodes which may be bound to either a pointer or a value (most often in the context of member expressions). Such polymorphism is already supported by `access`; these combinators extend it to more general uses. Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70554
* [OPENMP]Simplify processing of context selectors, NFC.Alexey Bataev2019-11-222-70/+38
|
* [coroutines] Remove assert on CoroutineParameterMoves in ↵Brian Gesiak2019-11-222-2/+7
| | | | | | | | | | | | | | | | | | | | | | | Sema::buildCoroutineParameterMoves Summary: The assertion of CoroutineParameterMoves happens when build coroutine function with arguments multiple time while fails to build promise type. Fix: use return false instead. Test Plan: check-clang Reviewers: modocache, GorNishanov, rjmccall Reviewed By: modocache Subscribers: rjmccall, EricWF, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69022 Patch by junparser (JunMa)!
* [OPENMP]Fix behaviour of defaultmap for OpenMP 4.5.Alexey Bataev2019-11-222-13/+19
| | | | | | In OpenMP 4.5 pointers also must be considered as scalar types and defaultmap(tofrom:scalar) clause must affect mapping of the pointers too.
* Add support to find out resource dir and add it as compilation argsKousik Kumar2019-11-221-1/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: If -resource-dir is not specified as part of the compilation command, then by default clang-scan-deps picks up a directory relative to its own path as resource-directory. This is probably not the right behavior - since resource directory should be picked relative to the path of the clang-compiler in the compilation command. This patch adds support for it along with a cache to store the resource-dir paths based on compiler paths. Notes: 1. "-resource-dir" is a behavior that's specific to clang, gcc does not have that flag. That's why if I'm not able to find a resource-dir, I quietly ignore it. 2. Should I also use the mtime of the compiler in the cache? I think its not strictly necessary since we assume the filesystem is immutable. 3. From my testing, this does not regress performance. 4. Will try to get this tested on Windows. But basically the problem that this patch is trying to solve is, clients might not always want to specify "-resource-dir" in their compile commands, so scan-deps must auto-infer it correctly. Reviewers: arphaman, Bigcheese, jkorous, dexonsmith, klimek Reviewed By: Bigcheese Subscribers: MaskRay, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69122
* [clangd] Show lambda signature for lambda autocompletionsKirill Bobyrev2019-11-223-8/+48
| | | | | | | | | | | | | | | | | | | | | | | | The original bug report can be found [here](https://github.com/clangd/clangd/issues/85) Given the following code: ```c++ void function() { auto Lambda = [](int a, double &b) {return 1.f;}; La^ } ``` Triggering the completion at `^` would show `(lambda)` before this patch and would show signature `(int a, double &b) const`, build a snippet etc with this patch. Reviewers: sammccall Reviewed by: sammccall Differential revision: https://reviews.llvm.org/D70445
* [CFG] Fix a flaky crash in CFGBlock::getLastCondition().Artem Dergachev2019-11-212-1/+267
| | | | | | | Using an end iterator of an empty CFG block was causing a garbage pointer dereference. Differential Revision: https://reviews.llvm.org/D69962
* [RISCV] Support mutilib in baremetal environmentZakk Chen2019-11-2129-11/+201
| | | | | | | | | | | | 1. Currently only support the set of multilibs same to riscv-gnu-toolchain. 2. Fix testcase typo causes fail on Windows. 3. Fix testcases to set empty sysroot. Reviewers: espindola, asb, kito-cheng, lenary Reviewed By: lenary Differential Revision: https://reviews.llvm.org/D67508
* clang/Modules: Move Serialization/Module.{h,cpp} to ModuleFile, NFCDuncan P. N. Exon Smith2019-11-2112-19/+19
| | | | | | | | | Remove some cognitive load by renaming clang/Serialization/Module.h to clang/Serialization/ModuleFile.h, since it declares the ModuleFile class. This also makes editing a bit easier, since the basename of the file no long conflicts with clang/Basic/Module.h, which declares the Module class. Also move lib/Serialization/Module.cpp to lib/Serialization/ModuleFile.cpp.
* [analyzer] Fix Objective-C accessor body farms after 2073dd2d.Artem Dergachev2019-11-215-66/+181
| | | | | | | | | | Fix a canonicalization problem for the newly added property accessor stubs that was causing a wrong decl to be used for 'self' in the accessor's body farm. Fix a crash when constructing a body farm for accessors of a property that is declared and @synthesize'd in different (but related) interfaces. Differential Revision: https://reviews.llvm.org/D70158
* [analyzer] NFC: Don't clean up range constraints twice.Artem Dergachev2019-11-213-10/+10
| | | | | | Slightly improves static analysis speed. Differential Revision: https://reviews.llvm.org/D70150
* [CFG] Add a test for a flaky crash in CFGBlock::getLastCondition().Artem Dergachev2019-11-211-0/+15
| | | | | | | | | | | | Push the test separately ahead of time in order to find out whether our Memory Sanitizer bots will be able to find the problem. If not, I'll add a much more expensive test that repeats the current test multiple times in order to show up on normal buildbots. I really apologize for the potential temporary inconvenience! I'll commit the fix as soon as I get the signal. Differential Revision: https://reviews.llvm.org/D69962
* [Clang] Enable RISC-V support for FuchsiaPetr Hosek2019-11-217-10/+46
| | | | | | | | We don't have a full sysroot yet, so for now we only include compiler support and compiler-rt builtins, the rest of the runtimes will get enabled later. Differential Revision: https://reviews.llvm.org/D70477
* [OPENMP]Remove unused template parameter, NFC.Alexey Bataev2019-11-213-5/+3
|
* [PowerPC] Add new Future CPU for PowerPCStefan Pintilie2019-11-215-4/+45
| | | | | | | | | | | This patch will add -mcpu=future into clang for PowerPC. A CPU type is required for work that may possibly be enabled for some future Power CPU. The CPU type future will serve that purpose. This patch introduces no new functionality. It is an incremental patch on top of which Power PC work for some future CPU can be done. Differential Revision: https://reviews.llvm.org/D70262
* Debug info: Emit objc_direct methods as members of their containing classAdrian Prantl2019-11-213-24/+50
| | | | | | | | | even in DWARF 4 and earlier. This allows the debugger to recognize them as direct functions as opposed to Objective-C methods. <rdar://problem/57327663> Differential Revision: https://reviews.llvm.org/D70544
* [OPENMP50]Add device/kind context selector support.Alexey Bataev2019-11-2114-74/+905
| | | | | | | | | | | | Summary: Added basic parsing/sema support for device/kind context selector. Reviewers: jdoerfert Subscribers: rampitec, aheejin, fedor.sergeev, simoncook, guansong, s.egerton, hfinkel, kkwli0, caomhin, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70245
* Fix compilation warning. NFC.Michael Liao2019-11-211-1/+1
|
* [OPENMP]Fix datasharing checks for if clause in parallel taskloopAlexey Bataev2019-11-213-3/+27
| | | | | | | | directives. If the default datasharing is set to none, the datasharing attributes for variables in the condition of the if clause for the inner taskloop directive must be verified.
* [OPENMP50]Add if clause in for simd directive.Alexey Bataev2019-11-217-107/+319
| | | | | | According to OpenMP 5.0, if clause can be used in for simd directive. If condition in the if clause if false, the non-vectorized version of the loop must be executed.
* [DeclCXX] Remove unknown external linkage specificationsEhud Katz2019-11-217-42/+7
| | | | | | | | | | | | | | | | Partial revert of r372681 "Support for DWARF-5 C++ language tags". The change introduced new external linkage languages ("C++11" and "C++14") which not supported in C++. It also changed the definition of the existing enum to use the DWARF constants. The problem is that "LinkageSpecDeclBits.Language" (the field that reserves this enum) is actually defined as 3 bits length (bitfield), which cannot contain the new DWARF constants. Defining the enum as integer literals is more appropriate for maintaining valid values. Differential Revision: https://reviews.llvm.org/D69935
* Revert "[RISCV] Support mutilib in baremetal environment"Zakk Chen2019-11-2129-201/+11
| | | | | This reverts commit df876a026981b7a125b31bbb85ba4b1144edb0f9. Clang::riscv32-toolchain.c Clang::riscv64-toolchain.c fails on Windows.
* Fix Wshadow warning against global None variable. NFC.Simon Pilgrim2019-11-211-2/+2
|
* [Driver] Fix a shadowing warning. NFCIlya Biryukov2019-11-211-7/+7
| | | | | Found by the following buildbot: http://lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/30084
* Reland 9f3fdb0d7fab: [Driver] Use VFS to check if sanitizer blacklists existIlya Biryukov2019-11-216-13/+159
| | | | | | | With updates to various LLVM tools that use SpecialCastList. It was tempting to use RealFileSystem as the default, but that makes it too easy to accidentally forget passing VFS in clang code.
* [OpenCL] Fix address space for base method call (PR43145)Sven van Haastregt2019-11-212-2/+35
| | | | | | | | Clang was creating an UncheckedDerivedToBase ImplicitCastExpr that was also casting between address spaces. Insert an ImplicitCastExpr node for doing the address space conversion. Differential Revision: https://reviews.llvm.org/D69810
* Atomics: support min/max orthogonallyTim Northover2019-11-219-31/+193
| | | | | | | | | | | | We seem to have been gradually growing support for atomic min/max operations (exposing longstanding IR atomicrmw instructions). But until now there have been gaps in the expected intrinsics. This adds support for the C11-style intrinsics (i.e. taking _Atomic, rather than individually blessed by C11 standard), and the variants that return the new value instead of the original one. That way, people won't be misled by trying one form and it not working, and the front-end is more friendly to people using _Atomic types, as we recommend.
* Revert "[Driver] Use VFS to check if sanitizer blacklists exist"Ilya Biryukov2019-11-216-159/+13
| | | | | This reverts commit ba6f906854263375cff3257d22d241a8a259cf77. Commit caused compilation errors on llvm tests. Will fix and re-land.
* [Driver] Use VFS to check if sanitizer blacklists existIlya Biryukov2019-11-216-13/+159
| | | | | | | | | | | | | | | | | | | Summary: This is a follow-up to 590f279c456bbde632eca8ef89a85c478f15a249, which moved some of the callers to use VFS. It turned out more code in Driver calls into real filesystem APIs and also needs an update. Reviewers: gribozavr2, kadircet Reviewed By: kadircet Subscribers: ormris, mgorny, hiraditya, llvm-commits, jkorous, cfe-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D70440
* [RISCV] Support mutilib in baremetal environmentZakk Chen2019-11-2129-11/+201
| | | | | | | | | | | 1. Currently only support the set of multilibs same to riscv-gnu-toolchain. 2. Fix testcase typo causes fail on Windows Reviewers: espindola, asb, kito-cheng, lenary Reviewed By: lenary Differential Revision: https://reviews.llvm.org/D67508
* [clang][IFS][test] GreenDragon and Fuchsia Darwin bot fix: BindArchClass Nest.Puyan Lotfi2019-11-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | On Darwin the clang driver does not invoke Driver::BuildActions directly due to the need to handle Universal apps. Because of this there is a difference in code path where Driver::BuildUniversalActions is called instead of Driver::BuildActions. BuildUniversalActions ends up calling Driver::BuildAction but what it does differently is it takes the driver actions returned and wraps them each into a BindArchAction. In Driver::BuildJobs there is a check for '-o' to determine that multiple files are not specified when passing -o, except for Clang Interface Stub this need to be an exception as we actually want to write out multiple files: for every libfoo.so we have a libfoo.ifso sidecar ifso file, etc. To allow this to happen there is a check for IfsMergeAction, which is permitted to write out a secondary file. Except on Darwin, the IfsMergeAction gets wrapped in the BindArchAction by Driver::BuildUniversalActions so the check fails. This patch is to look inside a BindArchAction in Driver::BuildJobs to determine if there is in fact an IfsMergeAction, and if-so (pun intended) allow the secondary sidecard ifs/ifso file to be written out.
* [Sema] Add a 'Semantic' parameter to Expr::isKnownToHaveBooleanValueErik Pilkington2019-11-204-16/+30
| | | | | | | | | Some clients of this function want to know about any expression that is known to produce a 0/1 value, and others care about expressions that are semantically boolean. This fixes a -Wswitch-bool regression I introduced in 8bfb353bb33c, pointed out by Chris Hamilton!
* [clang][IFS] Driver Pipeline: generate stubs after standard pipeline (3)Puyan Lotfi2019-11-207-33/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | Third Landing Attempt (dropping any linker invocation from clang driver): Up until now, clang interface stubs has replaced the standard PP -> C -> BE -> ASM -> LNK pipeline. With this change, it will happen in conjunction with it. So what when you build your code you will get an a.out or lib.so as well as an interface stub file. Example: clang -shared -o libfoo.so -emit-interface-stubs ... will generate both a libfoo.so and a libfoo.ifso. The .so file will contain the code from the standard compilation pipeline and the .ifso file will contain the ELF stub library. Note: For driver-test.c I've added -S in order to prevent any bot failures on bots that don't have the proper linker for their native triple. You could always specify a triple like x86_64-unknown-linux-gnu and on bots like x86_64-scei-ps4 the clang driver would invoke regular ld instead of getting the error 'Executable "orbis-ld" doesn't exist!' but on bots like ppc64be and s390x you'd get an error "/usr/bin/ld: unrecognised emulation mode: elf_x86_64" Differential Revision: https://reviews.llvm.org/D70274
* [CMake] Fix the path to CrossWinToARMLinux.cmake CMake cache.Vladimir Vereschaka2019-11-201-1/+1
| | | | | | | | The comment was slightly misleading. Behalf: broadwaylamb (Sergej Jaskiewicz) Differential Revision: https://reviews.llvm.org/D70499
* Fix parser bug that permitted 'private' as a (no-op) decl-specifier even ↵Richard Smith2019-11-202-1/+8
| | | | outside OpenCL.
* ARM-NEON: make type modifiers orthogonal and allow multiple modifiers.Tim Northover2019-11-207-1139/+1170
| | | | | | | | | | | | | | The modifier system used to mutate types on NEON intrinsic definitions had a separate letter for all kinds of transformations that might be needed, and we were quite quickly running out of letters to use. This patch converts to a much smaller set of orthogonal modifiers that can be applied together to achieve the desired effect. When merging with downstream it is likely to cause a conflict with any local modifications to the .td files. There is a new script in utils/convert_arm_neon.py that was used to convert all .td definitions and I would suggest running it on the last downstream version of those files before this commit rather than resolving conflicts manually.
* NeonEmitter: remove special case on casting polymorphic builtins.Tim Northover2019-11-202-5/+7
| | | | | | | For some reason we were not casting a fairly obscure class of builtin calls we expected to be polymorphic to vectors of char. It worked because the only affected intrinsics weren't actually polymorphic after all, but is unnecessarily complicated.
* ARM-NEON: separate soon-to-be conflicting f16 patterns. NFC.Tim Northover2019-11-201-2/+6
| | | | | | | | This separates some intrinsic definitions into multiple instantiations because they use a modifier that forces the float size to a given value. That modifier won't work in the new NeonEmitter modifier scheme and committing this separately allows the Python script to be run on the .td files to perform the conversion automatically.
* Update tests after change to llvm-cxxfilt's underscore stripping behaviour.Tim Northover2019-11-206-14/+14
|
* Reland "[clang] Remove the DIFlagArgumentNotModified debug info flag"Djordje Todorovic2019-11-203-71/+0
| | | | | | | | | | It turns out that the ExprMutationAnalyzer can be very slow when AST gets huge in some cases. The idea is to move this analysis to the LLVM back-end level (more precisely, in the LiveDebugValues pass). The new approach will remove the performance regression, simplify the implementation and give us front-end independent implementation. Differential Revision: https://reviews.llvm.org/D68206
* Revert "[clang][IFS] Driver Pipeline: generate stubs after standard pipeline ↵Puyan Lotfi2019-11-197-136/+39
| | | | | | (2)" This reverts commit ea8e02822341e2421b94167d828d3f224e767424.
* Revert "[clang][IFS] Fixing failing bots that do not have PPC target or ↵Puyan Lotfi2019-11-192-4/+0
| | | | | | "orbis-ld"" This reverts commit 377d70cdea733e36107e99d9148864d24797d51c.
* Revert "[clang][IFS] Attempting to fix missing 'orbis-ld' on scei-ps4-ubuntu ↵Puyan Lotfi2019-11-191-3/+1
| | | | | | bot." This reverts commit 29fd1e1f4a372f3870e054da24b57a4f45861808.
* Revert "[clang][IFS] Fixing unsupported emulation mode on ↵Puyan Lotfi2019-11-191-1/+0
| | | | | | clang-ppc64be-linux bot." This reverts commit 1b387484b9b38a4a1e98a9d22a9a26065b0d184e.
* Revert "[clang][IFS][test] Removing driver-test.c. Test is still too brittle."Puyan Lotfi2019-11-191-0/+15
| | | | This reverts commit f37356d6f60ae5db978611621d3a375ed87ec0f0.
* [clang][IFS][test] Removing driver-test.c. Test is still too brittle.Puyan Lotfi2019-11-191-15/+0
| | | | | | | Removing this test because if I add a triple then there are link falures on targets like ppc and s390x. If I don't add a triple then on PS4 targets the clang driver tries to invoke orbis-ld which ends up being not found.
* clang/Modules: Early return in CompilerInstance::createModuleManager, NFCDuncan P. N. Exon Smith2019-11-191-43/+44
| | | | Reduce nesting with an early `return`.
* [clang][IFS] Fixing unsupported emulation mode on clang-ppc64be-linux bot.Puyan Lotfi2019-11-191-0/+1
| | | | | | I am in another pickle here where if I specify a triple, I get the wrong elf target arch on the PPC bot (error from the PPC elf Linker). To avoid this I am going to turn this test off on the PPC bots for now.
* clang/Modules: Sink ASTReadResult in ReadControlBlock, NFCDuncan P. N. Exon Smith2019-11-191-5/+5
| | | | | | | | Simplify the code by avoiding some state that wasn't being used. The function-level `Result` was only assigned a value other than `Success` in the handler for `OPTIONS_BLOCK_ID`, but in that case it also hits an early return. Remove it at the function-level to make it obvious that the normal case always returns `Success`.
* [clang][IFS] Attempting to fix missing 'orbis-ld' on scei-ps4-ubuntu bot.Puyan Lotfi2019-11-191-1/+3
| | | | | | I want this test to run end to end, but I am still having trouble with missing linkers on the scei-ps4 bot. Will remove this test if it continues to be a source of brittle failures. Sorry for the noise.
OpenPOWER on IntegriCloud