summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [OpenCL] Add integer builtin functionsSven van Haastregt2019-11-071-6/+62
| | | | | | | | | This patch adds the integer builtin functions from the OpenCL C specification. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D69901
* CodeGen: set correct result for atomic compound expressionsTim Northover2019-11-071-9/+20
| | | | | | | | Atomic compound expressions try to use atomicrmw if possible, but this path doesn't set the Result variable, leaving it to crash in later code if anything ever tries to use the result of the expression. This fixes that issue by recalculating the new value based on the old one atomically loaded.
* [OpenCL] Add math and common builtin functionsSven van Haastregt2019-11-071-18/+153
| | | | | | | | | Add the remaining math and common builtin functions from the OpenCL C specification. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D69883
* [mips] Set macros for Octeon+ CPUSimon Atanasyan2019-11-071-2/+5
|
* [mips] Add `octeon+` to the list of CPUs accepted by the driverSimon Atanasyan2019-11-073-2/+6
|
* [clang-rename] Respect the traversal scope when traversing the entire AST.Haojian Wu2019-11-071-1/+1
| | | | | | | | | | | | | | | Summary: This should be NFC to clang-rename, by default the traversal scope is TUDecl. Traversing the TUDecl in clangd is a performance cliff, we should avoid it. Reviewers: ilya-biryukov Subscribers: kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69892
* Revert a5c8ec4 "[CGDebugInfo] Emit subprograms for decls when AT_tail_call ↵Hans Wennborg2019-11-071-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is understood" This caused Chromium builds to fail with "inlinable function call in a function with debug info must have a !dbg location" errors. See https://bugs.chromium.org/p/chromium/issues/detail?id=1022296#c1 for a reproducer. > Currently, clang emits subprograms for declared functions when the > target debugger or DWARF standard is known to support entry values > (DW_OP_entry_value & the GNU equivalent). > > Treat DW_AT_tail_call the same way to allow debuggers to follow cross-TU > tail calls. > > Pre-patch debug session with a cross-TU tail call: > > ``` > * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt] > frame #1: 0x0000000100000f99 main`main at a.c:8:10 [opt] > ``` > > Post-patch (note that the tail-calling frame, "helper", is visible): > > ``` > * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt] > frame #1: 0x0000000100000f80 main`helper [opt] [artificial] > frame #2: 0x0000000100000f99 main`main at a.c:8:10 [opt] > ``` > > rdar://46577651 > > Differential Revision: https://reviews.llvm.org/D69743
* [clang-format] Make '.clang-format' variants finding a loop (NFC)Anders Waldenborg2019-11-071-31/+27
| | | | | | | This simplifies logic making it trivial to add searching for other files later. Differential revision: https://reviews.llvm.org/D68568
* [Syntax] Silence "unused function" warning in no-assert builds. NFCIlya Biryukov2019-11-071-0/+2
| | | | A helper `isImpicitExpr` is only used inside assert.
* [Clang] Add ENABLE_LINKER_BUILD_ID to Hurd driver.kristina2019-11-071-0/+4
| | | | | | | | | This was added for Linux toolchains in rC271692, this patch extends this to the Hurd toolchain. Patch by sthibaul (Samuel Thibault) Differential Revision: https://reviews.llvm.org/D69754
* [X86] Add 'fxsr' feature to -march=pentium2 to match X86.td and gcc.Craig Topper2019-11-061-1/+2
|
* [X86] Add 'mmx' to all CPUs that have a version of 'sse' and weren't already ↵Craig Topper2019-11-061-7/+11
| | | | | | | | | | | | | | enabling '3dnow' All SSE capable CPUs have MMX. 3dnow implicitly enables MMX. We have code that detects if sse is enabled and implicitly enables MMX unless -mno-mmx is passed. So in most cases we were already enabling MMX if march passed a CPU that supported SSE. The exception to this is if you pass -march for a cpu supports SSE and also pass -mno-sse. We should still enable MMX since its part of the CPU capability.
* [libTooling] Fix breakage from change #84922Yitzhak Mandelbaum2019-11-061-1/+1
|
* [libTooling] Simplify type structure of `Stencil`s.Yitzhak Mandelbaum2019-11-061-56/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently, stencils are defined as a sequence of `StencilParts`. This differentiation adds an unneeded layer of complexity to the definition of Stencils. This change significantly simplifies the type structure: a stencil is now conceptually any object implementing `StencilInterface` and `Stencil` is just a thin wrapper for pointers to this interface. To account for the sequencing that was supported by the old `Stencil` type, we introduce a sequencing class that implements `StencilInterface`. That is, sequences are just another kind of Stencil and no longer have any special status. Corresponding to this change in the type structure, we change the way `cat` is used (and defined). `cat` bundles multiple features: it builds a stencil from a sequence of subcomponents and admits multiple different types for its arguments, while coercing them into the right type. Previously, `cat` was also used to coerce a single `StencilPart` into a `Stencil`. With that distinction gone, many uses of `cat` (e.g. in the tests) are unnecessary and have, therefore, been removed. Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69613
* [Syntax] Add nodes for most common statementsIlya Biryukov2019-11-063-15/+391
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Most of the statements mirror the ones provided by clang AST. Major differences are: - expressions are wrapped into 'ExpressionStatement' instead of being a subclass of statement, - semicolons are always consumed by the leaf expressions (return, expression satement, etc), - some clang statements are not handled yet, we wrap those into an UnknownStatement class, which is not present in clang. We also define an 'Expression' and 'UnknownExpression' classes in order to produce 'ExpressionStatement' where needed. The actual implementation of expressions is not yet ready, it will follow later. Reviewers: sammccall Reviewed By: sammccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63835
* [clang-format] [PR35518] C++17 deduction guides are wrongly formattedpaulhoad2019-11-061-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: see https://bugs.llvm.org/show_bug.cgi?id=35518 clang-format removes spaces around deduction guides but not trailing return types, make the consistent ``` template <typename T> S(T)->S<T>; auto f(int, int) -> double; ``` becomes ``` template <typename T> S(T) -> S<T>; auto f(int, int) -> double; ``` Reviewers: klimek, mitchell-stellar, owenpan, sammccall, lichray, curdeius, KyrBoh Reviewed By: curdeius Subscribers: merge_guards_bot, hans, lichray, cfe-commits Tags: #clang-format, #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D69577
* [OPENMP50]Simplify processing of context selector scores.Alexey Bataev2019-11-053-46/+5
| | | | | | If the context selector score was not specified, its value must be set to 0. Simplify the processing of unspecified scores + save memory in attribute representation.
* [Sema] Fixes templated friend member assertionMark de Wever2019-11-051-0/+3
| | | | | | Fixes PR41792: Clang assertion failure on templated friend member function Differential Revision: https://reviews.llvm.org/D69481
* [HIP] Fix visibility for 'extern' device variables.Michael Liao2019-11-051-3/+3
| | | | | | | | | | | | | | Summary: - Fix a bug which misses the change for a variable to be set with target-specific attributes. Reviewers: yaxunl Subscribers: jvesely, nhaehnle, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63020
* [hip] Enable pointer argument lowering through coercing type.Michael Liao2019-11-052-3/+56
| | | | | | | | | | Reviewers: tra, rjmccall, yaxunl Subscribers: jvesely, nhaehnle, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69826
* [OPENMP]Improve diagnostics for unsupported unified addressing.Alexey Bataev2019-11-051-4/+9
| | | | Improved diagnostics for better user experience.
* [Clang FE] Recognize -mnop-mcount CL option (SystemZ only).Jonas Paulsson2019-11-053-0/+14
| | | | | | | | | | | | | | Recognize -mnop-mcount from the command line and add a function attribute "mnop-mcount"="true" when passed. When this option is used, a nop is added instead of a call to fentry. This is used when building the Linux Kernel. If this option is passed for any other target than SystemZ, an error is generated. Review: Ulrich Weigand https://reviews.llvm.org/D67763
* [OpenCL] Add builtin function attribute handlingSven van Haastregt2019-11-052-43/+66
| | | | | | | | | Add handling for the "pure", "const" and "convergent" function attributes for OpenCL builtin functions. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D64319
* [mips] Set __OCTEON__ macrosSimon Atanasyan2019-11-051-0/+3
|
* [mips] Fix `__mips_isa_rev` macros value for Octeon CPUSimon Atanasyan2019-11-051-1/+1
|
* [CUDA][HIP] Disable emitting llvm.linker.options in device compilationYaxun (Sam) Liu2019-11-041-4/+9
| | | | | | | The linker options (e.g. pragma detect_mismatch) are intended for host compilation only, therefore disable it for device compilation. Differential Revision: https://reviews.llvm.org/D57829
* [CGDebugInfo] Emit subprograms for decls when AT_tail_call is understoodVedant Kumar2019-11-041-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, clang emits subprograms for declared functions when the target debugger or DWARF standard is known to support entry values (DW_OP_entry_value & the GNU equivalent). Treat DW_AT_tail_call the same way to allow debuggers to follow cross-TU tail calls. Pre-patch debug session with a cross-TU tail call: ``` * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt] frame #1: 0x0000000100000f99 main`main at a.c:8:10 [opt] ``` Post-patch (note that the tail-calling frame, "helper", is visible): ``` * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt] frame #1: 0x0000000100000f80 main`helper [opt] [artificial] frame #2: 0x0000000100000f99 main`main at a.c:8:10 [opt] ``` rdar://46577651 Differential Revision: https://reviews.llvm.org/D69743
* [AST][NFC] Fixes a comment typoMark de Wever2019-11-041-1/+1
| | | | Also a test for commit access.
* [OPENMP50]Support for imperfectly nested loops.Alexey Bataev2019-11-043-16/+115
| | | | Added support for imperfectly nested loops introduced in OpenMP 5.0.
* clang/Modules: Bring back optimization lost in 31e14f41a21fDuncan P. N. Exon Smith2019-11-041-3/+4
| | | | | | 31e14f41a21f9016050a20f07d5da03db2e8c13e accidentally dropped caching of failed module loads. This brings it back by making ModuleMap::getCachedModuleLoad return an Optional.
* [ms] Fix Microsoft compatibility handling of commas in nested macro expansions.Eric Astor2019-11-041-10/+18
| | | | | | | | | | | | | | | | | | | In Microsoft-compatibility mode, single commas from nested macro expansions should not be considered as argument separators; we already emulated this by marking them to be ignored. However, in MSVC's preprocessor, subsequent expansions DO treat these commas as argument separators... so we now ignore each comma at most once. Includes a small unit test that validates we match MSVC's behavior as shown in https://gcc.godbolt.org/z/y0twaq Fixes PR43282 Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69626
* Recommit "[CodeView] Add option to disable inline line tables."Amy Huang2019-11-043-0/+11
| | | | | | | | | | | | This reverts commit 004ed2b0d1b86d424643ffc88fce20ad8bab6804. Original commit hash 6d03890384517919a3ba7fe4c35535425f278f89 Summary: This adds a clang option to disable inline line tables. When it is used, the inliner uses the call site as the location of the inlined function instead of marking it as an inline location with the function location. https://reviews.llvm.org/D67723
* [Sema] Make helper in TreeTransform.h 'inline' instead of 'static'. NFCIlya Biryukov2019-11-041-1/+1
| | | | | | | | | | | | | | | | | Summary: There seems to be no evidence that having internal linkage for the function was intentional. Since 'static' functions are normally used only in .cpp files, using 'inline' in the header file is more appropriate. Reviewers: Anastasia Reviewed By: Anastasia Subscribers: merge_guards_bot, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69242
* [Diagnostics] Improve some error messages related to bad use of dynamic_castDávid Bolvanský2019-11-041-1/+1
|
* Fix compilation warning. NFC.Michael Liao2019-11-041-2/+2
|
* [OpenCL] Fix address space for const method call from nonconst (PR43145)Sven van Haastregt2019-11-041-1/+4
| | | | | | Patch by Anastasia Stulova and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D68781
* clang/Modules: Sink CompilerInstance::KnownModules into ModuleMapDuncan P. N. Exon Smith2019-11-031-20/+14
| | | | | | | | | | | | Avoid use-after-frees when FrontendAction::BeginSourceFile is called twice on the same CompilerInstance by sinking CompilerInstance::KnownModules into ModuleMap. On the way, rename the map to CachedModuleLoads. I considered (but rejected) merging this with ModuleMap::Modules, since that only has top-level modules and this map includes submodules. This is an alternative to https://reviews.llvm.org/D58497. Thanks to nemanjai for the detailed analysis of the problem!
* [opaque pointer types] Add element type argument to IRBuilder ↵Craig Topper2019-11-032-2/+3
| | | | | | | | | | | | | | | | | | | | CreatePreserveStructAccessIndex and CreatePreserveArrayAccessIndex Summary: These were the only remaining users of the GetElementPtrInst::getGEPReturnType method that gets the element type from the pointer type. Remove that method since its now dead. Reviewers: jyknight, t.p.northover, arsenm Reviewed By: arsenm Subscribers: wdng, arsenm, arphaman, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D69756
* ModuleMap::findHeader - fix null dereference warning. NFCI.Simon Pilgrim2019-11-031-1/+1
| | | | We were checking M for a null value after we'd already dereferenced it multiple times.
* make -ftime-trace also trace time spent creating debug infoLuboš Luňák2019-11-021-0/+33
| | | | Differential Revision: https://reviews.llvm.org/D69750
* DebugInfo: Let -gdwarf use the toolchain default DWARF version, instead of ↵David Blaikie2019-11-011-3/+4
| | | | hardcoded/aliased to -gdwarf-4
* DebugInfo: (NFC) Refactor DWARF version calculation to make a future change ↵David Blaikie2019-11-011-6/+21
| | | | (-fdebug-default-version) easier
* [NFC]: Removed an implicit capture argument from lambda.Sourabh Singh Tomar2019-11-021-1/+1
|
* [WebAssembly] Add experimental SIMD dot product instructionThomas Lively2019-11-011-0/+6
| | | | | | | | | | | | | | | | | | | Summary: This instruction is not merged to the spec proposal, but we need it to be implemented in the toolchain to experiment with it. It is available only on an opt-in basis through a clang builtin. Defined in https://github.com/WebAssembly/simd/pull/127. Depends on D69696. Reviewers: aheejin Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D69697
* [OpenCL] Support -fdeclare-opencl-builtins in C++ modeSven van Haastregt2019-11-011-2/+5
| | | | | | | Support for C++ mode was accidentally lacking due to not checking the OpenCLCPlusPlus LangOpts version. Differential Revision: https://reviews.llvm.org/D69233
* [WebAssembly] SIMD integer min and max instructionsThomas Lively2019-10-311-0/+42
| | | | | | | | | | | | | | | | | | | | | | Summary: Introduces a clang builtins and LLVM intrinsics representing integer min/max instructions. These instructions have not been merged to the SIMD spec proposal yet, so they are currently opt-in only via builtins and not produced by general pattern matching. If these instructions are accepted into the spec proposal the builtins and intrinsics will be replaced with normal pattern matching. Defined in https://github.com/WebAssembly/simd/pull/27. Reviewers: aheejin Reviewed By: aheejin Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D69696
* clang: Fix assert on void pointer arithmetic with address_spaceMatt Arsenault2019-10-311-1/+1
| | | | | This attempted to always use the default address space void pointer type instead of preserving the source address space.
* [clang][driver] Add ProfileData to LLVM_LINK_COMPONENTSHeejin Ahn2019-10-311-0/+1
| | | | | | | | | | | | | | Summary: After D68351 we need this to make builds with `-DBUILD_SHARED_LIB=ON` work. Reviewers: tlively Subscribers: mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69699
* [CodeGen] Fix invalid llvm.linker.options about pragma detect_mismatchYaxun (Sam) Liu2019-10-311-0/+2
| | | | | | | | | | When a target does not support pragma detect_mismatch, an llvm.linker.options metadata with an empty entry is created, which causes diagnostic in backend since backend expects name/value pair in llvm.linker.options entries. This patch fixes that. Differential Revision: https://reviews.llvm.org/D69678
* [profile] Add a mode to continuously sync counter updates to a fileVedant Kumar2019-10-311-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for continuously syncing profile counter updates to a file. The motivation for this is that programs do not always exit cleanly. On iOS, for example, programs are usually killed via a signal from the OS. Running atexit() handlers after catching a signal is unreliable, so some method for progressively writing out profile data is necessary. The approach taken here is to mmap() the `__llvm_prf_cnts` section onto a raw profile. To do this, the linker must page-align the counter and data sections, and the runtime must ensure that counters are mapped to a page-aligned offset within a raw profile. Continuous mode is (for the moment) incompatible with the online merging mode. This limitation is lifted in https://reviews.llvm.org/D69586. Continuous mode is also (for the moment) incompatible with value profiling, as I'm not sure whether there is interest in this and the implementation may be tricky. As I have not been able to test extensively on non-Darwin platforms, only Darwin support is included for the moment. However, continuous mode may "just work" without modification on Linux and some UNIX-likes. AIUI the default value for the GNU linker's `--section-alignment` flag is set to the page size on many systems. This appears to be true for LLD as well, as its `no_nmagic` option is on by default. Continuous mode will not "just work" on Fuchsia or Windows, as it's not possible to mmap() a section on these platforms. There is a proposal to add a layer of indirection to the profile instrumentation to support these platforms. rdar://54210980 Differential Revision: https://reviews.llvm.org/D68351
OpenPOWER on IntegriCloud