summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [analyzer] Require darwin for scan-build testsDevin Coughlin2019-11-045-4/+6
| | | | | Let's at least get some coverage from these tests. We can generalize to other platforms later.
* [analyzer] Fixup scan-build tests for non-Darwin platforms.Devin Coughlin2019-11-045-1/+8
| | | | | This is a fix to 0aba69eb1a01c44185009f50cc633e3c648e9950 to address failing bots.
* [analyzer] Add test directory for scan-build.Devin Coughlin2019-11-049-1/+142
| | | | | | | | | | The static analyzer's scan-build script is critical infrastructure but is not well tested. To start to address this, add a new test directory under tests/Analysis for scan-build lit tests and seed it with several tests. The goal is that future scan-build changes will be accompanied by corresponding tests. Differential Revision: https://reviews.llvm.org/D69781
* [CUDA][HIP] Disable emitting llvm.linker.options in device compilationYaxun (Sam) Liu2019-11-043-4/+42
| | | | | | | 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-043-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* [OPENMP][DOCS]Update list of implemented features, NFC.Alexey Bataev2019-11-041-2/+2
|
* Add release notes for commit ccc4d83cda16bea1d9dfd0967dc7d2cfb24b8e75.James Y Knight2019-11-041-1/+43
| | | | | (Which was "[ObjC] Diagnose implicit type coercion from ObjC 'Class' to object pointer types.")
* [OPENMP50]Support for imperfectly nested loops.Alexey Bataev2019-11-047-55/+246
| | | | Added support for imperfectly nested loops introduced in OpenMP 5.0.
* clang/Modules: Bring back optimization lost in 31e14f41a21fDuncan P. N. Exon Smith2019-11-042-5/+9
| | | | | | 31e14f41a21f9016050a20f07d5da03db2e8c13e accidentally dropped caching of failed module loads. This brings it back by making ModuleMap::getCachedModuleLoad return an Optional.
* [X86] Add support for -mvzeroupper and -mno-vzeroupper to match gccCraig Topper2019-11-043-0/+11
| | | | | | | | | | | | | | | | | -mvzeroupper will force the vzeroupper insertion pass to run on CPUs that normally wouldn't. -mno-vzeroupper disables it on CPUs where it normally runs. To support this with the default feature handling in clang, we need a vzeroupper feature flag in X86.td. Since this flag has the opposite polarity of the fast-partial-ymm-or-zmm-write we used to use to disable the pass, we now need to add this new flag to every CPU except KNL/KNM and BTVER2 to keep identical behavior. Remove -fast-partial-ymm-or-zmm-write which is no longer used. Differential Revision: https://reviews.llvm.org/D69786
* [ms] Fix Microsoft compatibility handling of commas in nested macro expansions.Eric Astor2019-11-042-10/+31
| | | | | | | | | | | | | | | | | | | 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-046-0/+47
| | | | | | | | | | | | 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-044-11/+11
|
* SanitizerMask::bitPosToMask - fix operator precedence warnings. NFCI.Simon Pilgrim2019-11-041-4/+5
| | | | Fix static analyzer operator precedence warnings with suitable bracketing. Pull out the mask generation code so clang-format doesn't make such a mess of it.
* [OpenCL] Fix FileCheck patternSven van Haastregt2019-11-041-1/+1
| | | | | For this test, FileCheck is not run with the CHECK prefix; it seems COMMON was intended here.
* 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-042-1/+15
| | | | | | Patch by Anastasia Stulova and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D68781
* [hwasan] Remove lazy thread-initialisationDavid Spickett2019-11-041-1/+7
| | | | | | | | | | | | | | | | | | | | | This was an experiment made possible by a non-standard feature of the Android dynamic loader. It required introducing a flag to tell the compiler which ABI was being targeted. This flag is no longer needed, since the generated code now works for both ABI's. We leave that flag untouched for backwards compatibility. This also means that if we need to distinguish between targeted ABI's again we can do that without disturbing any existing workflows. We leave a comment in the source code and mention in the help text to explain this for any confused person reading the code in the future. Patch by Matthew Malcomson Differential Revision: https://reviews.llvm.org/D69574
* clang/Modules: Sink CompilerInstance::KnownModules into ModuleMapDuncan P. N. Exon Smith2019-11-033-25/+30
| | | | | | | | | | | | 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
* Drop spurious self-include [NFC]Aaron Puchert2019-11-031-1/+0
| | | | This was introduced in D61357, probably by accident.
* 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.
* [CodeGenCXX][test] Use -fno-experimental-new-pass-manager for ↵Fangrui Song2019-11-021-1/+1
| | | | | | CodeGenCXX/union-tbaa2.cpp after D68593/llvmorg-10-init-8907-gcecc0d27ad5 It fails with -DENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=0 builds. Temporarily use -fno-experimental-new-pass-manager while we are investigating the root cause.
* Fix uninitialized variable warnings. NFCI.Simon Pilgrim2019-11-021-3/+3
|
* make -ftime-trace also trace time spent creating debug infoLuboš Luňák2019-11-021-0/+33
| | | | Differential Revision: https://reviews.llvm.org/D69750
* [X86] add mayRaiseFPException flag and FPCW registers for X87 instructionsPengfei Wang2019-11-011-1/+1
| | | | | | | | | | | | | | | | Summary: This patch adds flag "mayRaiseFPException" , FPCW and FPSW for X87 instructions which could raise float exception. Reviewers: pengfei, RKSimon, andrew.w.kaylor, uweigand, kpn, spatel, cameron.mcinally, craig.topper Reviewed By: craig.topper Subscribers: thakis, hiraditya, llvm-commits Patch by LiuChen. Differential Revision: https://reviews.llvm.org/D68854
* DebugInfo: Accept -gdwarf even in clang-clDavid Blaikie2019-11-011-1/+1
| | | | Fixes regression introduced by llvmorg-10-init-8908-g098d901bd1b
* DebugInfo: Let -gdwarf use the toolchain default DWARF version, instead of ↵David Blaikie2019-11-013-7/+9
| | | | 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
|
* [CMake] Add cross Windows to ARM Linux toolchain CMake cache file.Vladimir Vereschaka2019-11-011-0/+109
| | | | | | | This cache file can be used to build a cross Windows to ARM Linux toolchain. Differential Revision: https://reviews.llvm.org/D69651
* [WebAssembly] Add experimental SIMD dot product instructionThomas Lively2019-11-013-0/+14
| | | | | | | | | | | | | | | | | | | 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
* [libTooling] Add Stencil constructor.Yitzhak Mandelbaum2019-11-011-0/+7
| | | | | | | | | | | | | | | | Summary: Adds a constructor that takes a vector with which to initialize the `Parts` field and a corresponding free function that forwards to the constructor. These definitions are needed to assist in transitioning away from `Stencil` as a class to defining it as a type alias. Reviewers: ilya-biryukov Subscribers: cfe-commits, gribozavr Tags: #clang Differential Revision: https://reviews.llvm.org/D69632
* [OpenCL] Support -fdeclare-opencl-builtins in C++ modeSven van Haastregt2019-11-012-5/+10
| | | | | | | 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-313-0/+141
| | | | | | | | | | | | | | | | | | | | | | 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-312-5/+19
| | | | | 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-312-2/+9
| | | | | | | | | | 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-313-1/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [clang][ScanDeps] Fix issue with multiple commands with the same input.Michael Spencer2019-10-316-29/+66
| | | | | | | | | | | | | | | | | | | Previously, given a CompilationDatabase with two commands for the same source file we would report that file twice with the union of the dependencies for each command both times. This was due to the way `ClangTool` runs actions given an input source file (see the comment in `DependencyScanningTool.cpp`). This commit adds a `SingleCommandCompilationDatabase` that is created with each `CompileCommand` in the original CDB, which is then used for each `ClangTool` invocation. This gives us a single run of `DependencyScanningAction` per `CompileCommand`. I looked at using `AllTUsToolExecutor` which is a parallel tool executor, but I'm not sure it's suitable for `clang-scan-deps` as it does a lot more sharing of state than `AllTUsToolExecutor` expects. Differential Revision: https://reviews.llvm.org/D69643
* Remove unneeded template alias, causes issues with some MSVC versionReid Kleckner2019-10-311-3/+1
| | | | | | | | | I built locally with the latest MSVC in c++14 and c++17, but it does not complain for me. Osman Zakir on llvm-dev reports that they run into compile errors here. In any case, it seems prefereable to reuse clang's LLVM.h header to bring in llvm::Optional and Expected.
* [clang-format] Fix SpacesInSquareBrackets for Lambdas with Initial "&ref" ↵Mitchell Balan2019-10-312-1/+5
| | | | | | | | | | | | | | | | | | | Parameter Summary: This fixes an edge case in the `SpacesInSquareBrackets` option where an initial `&ref` lambda parameter is not padded with an initial space. `int foo = [&bar ]() {}` is fixed to give `int foo = [ &bar ]() {}` Reviewers: MyDeveloperDay, klimek, sammccall Reviewed by: MyDeveloperDay Subscribers: cfe-commits Tags: #clang, #clang-format Differential Revision: https://reviews.llvm.org/D69649
* Build fix after 4b6597fNico Weber2019-10-311-1/+1
|
* [clang][analyzer] Using CallDescription in StreamChecker.Balázs Kéri2019-10-313-280/+245
| | | | | | | | | | | | | | | | | | | Summary: Recognization of function names is done now with the CallDescription class instead of using IdentifierInfo. This means function name and argument count is compared too. A new check for filtering not global-C-functions was added. Test was updated. Reviewers: Szelethus, NoQ, baloghadamsoftware, Charusso Reviewed By: Szelethus, NoQ, Charusso Subscribers: rnkovacs, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, donat.nagy, Charusso, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67706
* Make flang driver stuff work on macOSNico Weber2019-10-312-5/+1
| | | | | | | | | | | 6bf55804 added special-case code for TY_PP_Fortran to ToolChain::LookupTypeForExtension(), but Darwin::LookupTypeForExtension() overrode that method without calling the superclass implementation. Make it call the superclass implementation to fix things. Differential Revision: https://reviews.llvm.org/D69636
* [cfi] Add flag to always generate .debug_frameDavid Candler2019-10-316-0/+20
| | | | | | | | | This adds a flag to LLVM and clang to always generate a .debug_frame section, even if other debug information is not being generated. In situations where .eh_frame would normally be emitted, both .debug_frame and .eh_frame will be used. Differential Revision: https://reviews.llvm.org/D67216
* [Diagnostics] Warn for std::is_constant_evaluated in constexpr modeDávid Bolvanský2019-10-314-2/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: constexpr int fn1() { if constexpr (std::is_constant_evaluated()) // condition is always true! return 0; else return 1; } constexpr int fn2() { if (std::is_constant_evaluated()) return 0; else return 1; } Solves PR42977 Reviewers: rsmith, aaron.ballman Reviewed By: rsmith Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69518
* Run clang-format on lib/CodeGen/CGCall.h and fix indentationAkira Hatanaka2019-10-301-308/+304
|
OpenPOWER on IntegriCloud