summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [DeclPrinter] Allow printing fully qualified name of function declarationSerge Pavlov2017-11-231-5/+11
| | | | | | | | | | | When requesting a tooltip for a function call in an IDE, the fully qualified name helps to remove ambiguity in the function signature. Patch by Nikolai Kosjar! Differential Revision: https://reviews.llvm.org/D40013 llvm-svn: 318896
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-231-77/+99
| | | | | | minor fixes (NFC). llvm-svn: 318888
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-221-47/+54
| | | | | | minor fixes (NFC). llvm-svn: 318882
* [OPENMP] Add support for cancel constructs in `target teams distributeAlexey Bataev2017-11-225-4/+13
| | | | | | | | | parallel for`. Add support for cancel/cancellation point directives inside `target teams distribute parallel for` directives. llvm-svn: 318881
* [OPENMP] Add support for cancel constructs in [teams] distributeAlexey Bataev2017-11-225-12/+32
| | | | | | | | | parallel for directives. Added codegen/sema support for cancel constructs in [teams] distribute parallel for directives. llvm-svn: 318872
* Revert "[CodeGen] Fix vtable not receiving hidden visibility when using ↵Petr Hosek2017-11-226-21/+19
| | | | | | | | push(visibility)" This reverts commit r318853: tests are failing on Windows bots llvm-svn: 318866
* [OPENMP] Added missed checks for for [simd] based directives.Alexey Bataev2017-11-221-0/+52
| | | | | | | Added missed checks/analysis for safelen/simdlen clauses + linear clause in for [simd] based directives. llvm-svn: 318860
* [CodeGen] Fix vtable not receiving hidden visibility when using push(visibility)Petr Hosek2017-11-226-19/+21
| | | | | | | | | | This change should resolve https://bugs.llvm.org/show_bug.cgi?id=35022 Patch by Jake Ehrlich Differential Revision: https://reviews.llvm.org/D39627 llvm-svn: 318853
* [OPENMP] General improvement of code, NFC.Alexey Bataev2017-11-222-14/+27
| | | | llvm-svn: 318849
* [OPENMP] Do not mark captured variables as artificial in debug info.Alexey Bataev2017-11-222-6/+32
| | | | | | | Captured variables should not be marked as artificial parameters in outlined functions in debug info. llvm-svn: 318843
* [OpenMP] Adjust arguments of nvptx runtime functionsJonas Hahnfeld2017-11-221-12/+20
| | | | | | | | | | | | | In the future the compiler will analyze whether the OpenMP runtime needs to be (fully) initialized and avoid that overhead if possible. The functions already take an argument to transfer that information to the runtime, so pass in the default value 1. (This is needed for binary compatibility with libomptarget-nvptx currently being upstreamed.) Differential Revision: https://reviews.llvm.org/D40354 llvm-svn: 318836
* [OPENMP] Codegen for `target teams` directive.Alexey Bataev2017-11-222-2/+21
| | | | | | Added codegen of the clauses for `target teams` directive. llvm-svn: 318834
* [Driver] Make the use of relax relocations a per target optionPetr Hosek2017-11-223-1/+6
| | | | | | | | | | | | | The support for relax relocations is dependent on the linker and different toolchains within the same compiler can be using different linkers some of which may or may not support relax relocations. Give toolchains the option to control whether they want to use relax relocations in addition to the existing (global) build system option. Differential Revision: https://reviews.llvm.org/D39831 llvm-svn: 318816
* [X86] Update CPUSupports code to reuse LLVM .def file [NFC]Erich Keane2017-11-222-102/+7
| | | | llvm-svn: 318815
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-215-72/+125
| | | | | | minor fixes (NFC). llvm-svn: 318813
* The offsetof macro is intended to work with subobjects rather than simple ↵Aaron Ballman2017-11-211-9/+1
| | | | | | identifiers designating a member, making the -Wextended-offsetof diagnostic obsolete as this construct is not an extension. Implements WG14 DR496. llvm-svn: 318796
* Add an AST matcher for hasDefaultArgument() to match on parameter ↵Aaron Ballman2017-11-211-0/+1
| | | | | | | | declarations that have a default value. Patch by Julie Hockett. llvm-svn: 318794
* [Clang][OpenMP] New clang/libomptarget map interface: new function ↵George Rokos2017-11-211-53/+57
| | | | | | | | | | | signatures, clang-side This clang patch changes the __tgt_* API function signatures in preparation for the new map interface. Changes are: Device IDs 32bits --> 64bits, Flags 32bits --> 64bits Differential revision: https://reviews.llvm.org/D40281 llvm-svn: 318789
* Add -finstrument-function-entry-bare flagHans Wennborg2017-11-213-11/+22
| | | | | | | | | | | | | | | | | This is an instrumentation flag that's similar to -finstrument-functions, but it only inserts calls on function entry, the calls are inserted post-inlining, and they don't take any arugments. This is intended for users who want to instrument function entry with minimal overhead. (-pg would be another alternative, but forces frame pointer emission and affects link flags, so is probably best left alone to be used for generating gcov data.) Differential revision: https://reviews.llvm.org/D40276 llvm-svn: 318785
* [OPENMP] Initial support for asynchronous data update, NFC.Alexey Bataev2017-11-216-43/+167
| | | | | | | | | OpenMP 5.0 introduces asynchronous data update/dependecies clauses on target data directives. Patch adds initial support for outer task regions to use task-based codegen for future async target data directives. llvm-svn: 318781
* [ASTImporter] Support new AST nodes:Aleksei Sidorin2017-11-211-17/+295
| | | | | | | | | | | | | | | | * UnresolvedUsingType * EmptyDecl * NamespaceAliasDecl * UsingDecl * UsingShadowDecl * UsingDirectiveDecl * UnresolvedUsingValueDecl * UnresolvedUsingTypenameDecl Refactor error handling in ImportTemplateArgumentLoc() method. Add a test for inline namespaces. llvm-svn: 318776
* [OpenMP] Add implicit data sharing support when offloading to NVIDIA GPUs ↵Gheorghe-Teodor Bercea2017-11-212-23/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | using OpenMP device offloading Summary: This patch is part of the development effort to add support in the current OpenMP GPU offloading implementation for implicitly sharing variables between a target region executed by the team master thread and the worker threads within that team. This patch is the first of three required for successfully performing the implicit sharing of master thread variables with the worker threads within a team. The remaining two patches are: - Patch D38978 to the LLVM NVPTX backend which ensures the lowering of shared variables to an device memory which allows the sharing of references; - Patch (coming soon) is a patch to libomptarget runtime library which ensures that a list of references to shared variables is properly maintained. A simple code snippet which illustrates an implicit data sharing situation is as follows: ``` #pragma omp target { // master thread only int v; #pragma omp parallel { // worker threads // use v } } ``` Variable v is implicitly shared from the team master thread which executes the code in between the target and parallel directives. The worker threads must operate on the latest version of v, including any updates performed by the master. The code generated in this patch relies on the LLVM NVPTX patch (mentioned above) which prevents v from being lowered in the thread local memory of the master thread thus making the reference to this variable un-shareable with the workers. This ensures that the code generated by this patch is correct. Since the parallel region is outlined the passing of arguments to the outlined regions must preserve the original order of arguments. The runtime therefore maintains a list of references to shared variables thus ensuring their passing in the correct order. The passing of arguments to the outlined parallel function is performed in a separate function which the data sharing infrastructure constructs in this patch. The function is inlined when optimizations are enabled. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, Hahnfeld, ABataev, caomhin Reviewed By: ABataev Subscribers: cfe-commits, jholewinski Differential Revision: https://reviews.llvm.org/D38976 llvm-svn: 318773
* [OpenMP] Consistently use cubin extension for nvlinkJonas Hahnfeld2017-11-214-18/+39
| | | | | | | | | | | | This was previously done in some places, but for example not for bundling so that single object compilation with -c failed. In addition cubin was used for all file types during unbundling which is incorrect for assembly files that are passed to ptxas. Tighten up the tests so that we can't regress in that area. Differential Revision: https://reviews.llvm.org/D40250 llvm-svn: 318763
* [MINGW] normalize WIN32 macrosMartell Malone2017-11-217-38/+14
| | | | | | | | | | | | | | move _WIN64 and _WIN32 defines to lib/Basic/Targets/OSTargets.h move WIN32, WIN64 and __MINGW64__ to addMinGWDefines fixes __MINGW64__ not being defined for aarch64 adds WIN32 definition for x64 Reviewers: mstorsjo Differential Revision: https://reviews.llvm.org/D40285 llvm-svn: 318755
* [Analyzer] Stable iteration on indirect goto LabelDecl's to avoid ↵Aleksei Sidorin2017-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | non-determinism (attempt 2) CFG wass built in non-deterministic order due to the fact that indirect goto labels' declarations (LabelDecl's) are stored in the llvm::SmallSet container. LabelDecl's are pointers, whose order is not deterministic, and llvm::SmallSet sorts them by their non-deterministic addresses after "small" container is exceeded. This leads to non-deterministic processing of the elements of the container. The fix is to use llvm::SmallSetVector that was designed to have deterministic iteration order. Patch by Ilya Palachev! Differential Revision: https://reviews.llvm.org/D40073 llvm-svn: 318754
* [Analyzer] Revert r318750 because incorrect files were added for commit.Aleksei Sidorin2017-11-211-292/+17
| | | | | | Sorry for the noise. llvm-svn: 318753
* [CodeGen] Generate TBAA type descriptors in a more reliable mannerIvan A. Kosarev2017-11-212-43/+64
| | | | | | | | | This patch introduces a couple of helper functions that make it possible to handle the caching logic in a single place. Differential Revision: https://reviews.llvm.org/D39953 llvm-svn: 318752
* [Analyzer] Non-determinism: stable iteration on indirect goto LabelDecl'sAleksei Sidorin2017-11-211-17/+292
| | | | | | | | | | | | | | | | | | CFG wass built in non-deterministic order due to the fact that indirect goto labels' declarations (LabelDecl's) are stored in the llvm::SmallSet container. LabelDecl's are pointers, whose order is not deterministic, and llvm::SmallSet sorts them by their non-deterministic addresses after "small" container is exceeded. This leads to non-deterministic processing of the elements of the container. The fix is to use llvm::SmallSetVector that was designed to have deterministic iteration order. Patch by Ilya Palachev! Differential Revision: https://reviews.llvm.org/D40073 llvm-svn: 318750
* [Modules TS] Added module re-export support.Hamza Sood2017-11-213-12/+21
| | | | | | | This implements [dcl.modules.export] from the C++ Modules TS, which lets a module re-export another module with the "export import" syntax. Differential Revision: https://reviews.llvm.org/D40270 llvm-svn: 318744
* [x86][inline-asm] allow recognition of MPX regs inside ms inline-asm blobCoby Tayree2017-11-211-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D38445 llvm-svn: 318739
* [MS] Increase default new alignment for win64 and test itReid Kleckner2017-11-211-1/+1
| | | | | | | | | | | | | | | | | | Summary: This raises __STDCPP_DEFAULT_NEW_ALIGNMENT__ from 8 to 16 on Win64. This matches platforms that follow the usual `2 * sizeof(void*)` alignment requirement for malloc. We might want to consider making that the default rather than relying on long double alignment. Fixes PR35356 Reviewers: STL_MSFT, rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40277 llvm-svn: 318723
* ASTMatchers{,Macros}.h: Add some extra macros to use for decl/def of matchersDavid Blaikie2017-11-211-0/+9
| | | | | | | Fix ODR violations caused by using internal linkage variables in non-internal inline functions. (also removes duplicate definitions, etc) llvm-svn: 318720
* FormatInternal.h: Add missing includes.David Blaikie2017-11-211-0/+4
| | | | llvm-svn: 318719
* [X86] Remove 'mm3now' from isValidFeatureName.Craig Topper2017-11-211-2/+0
| | | | | | The correct spelling is '3dnow' which is already in the list. llvm-svn: 318716
* [analyzer] Diagnose stack leaks via block capturesAlexander Shaposhnikov2017-11-201-99/+192
| | | | | | | | | | | This diff extends StackAddrEscapeChecker to catch stack addresses leaks via block captures if the block is executed asynchronously or returned from a function. Differential revision: https://reviews.llvm.org/D39438 llvm-svn: 318705
* Revert r318669/318694Erich Keane2017-11-205-36/+1
| | | | | | Broke some libclang tests, so reverting for now. llvm-svn: 318698
* [OpenMP] Initial implementation of code generation for pragma 'teams ↵Carlo Bertolli2017-11-203-18/+137
| | | | | | | | | | distribute parallel for' on host https://reviews.llvm.org/D40187 This patch implements code gen for 'teams distribute parallel for' on the host, including all its clauses and related regression tests. llvm-svn: 318692
* [AutoComplete] Use stronger sort predicate for autocomplete candidates to ↵Mandeep Singh Grang2017-11-201-1/+5
| | | | | | | | | | | | | | | | | | remove non-deterministic ordering Summary: This fixes the failure in test/Driver/autocomplete.c uncovered by D39245. Reviewers: yamaguchi, teemperor, ruiu Reviewed By: yamaguchi, ruiu Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D40234 llvm-svn: 318681
* For Linux/gnu compatibility, preinclude <stdc-predef.h> if the file is availableErich Keane2017-11-205-1/+36
| | | | | | | | | | | | | | | | | | | | | | As reported in llvm bugzilla 32377. Here’s a patch to add preinclude of stdc-predef.h. The gcc documentation says “On GNU/Linux, <stdc-predef.h> is pre-included.” See https://gcc.gnu.org/gcc-4.8/porting_to.html; The preinclude is inhibited with –ffreestanding. Basically I fixed the failing test cases by adding –ffreestanding which inhibits this behavior. I fixed all the failing tests, including some in extra/test, there's a separate patch for that which is linked here Patch By: mibintc Differential Revision: https://reviews.llvm.org/D34158 llvm-svn: 318669
* Revert r318456 "Issue -Wempty-body warnings for else blocks"Hans Wennborg2017-11-201-3/+1
| | | | | | | | | | | | | | This caused warnings also when the if or else comes from macros. There was an attempt to fix this in r318556, but that introduced new problems and was reverted. Reverting this too until the whole issue is sorted. > This looks like it was just an oversight. > > Fixes http://llvm.org/pr35319 > > git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318456 91177308-0d34-0410-b5e6-96231b3b80d8 llvm-svn: 318667
* Revert r318556 "Loosen -Wempty-body warning"Hans Wennborg2017-11-203-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems this somehow made -Wempty-body fire in some macro cases where it didn't before, e.g. ../../third_party/ffmpeg/libavcodec/bitstream.c(169,5): error: if statement has empty body [-Werror,-Wempty-body] ff_dlog(NULL, "new table index=%d size=%d\n", table_index, table_size); ^ ../../third_party/ffmpeg\libavutil/internal.h(276,80): note: expanded from macro 'ff_dlog' # define ff_dlog(ctx, ...) do { if (0) av_log(ctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) ^ ../../third_party/ffmpeg/libavcodec/bitstream.c(169,5): note: put the semicolon on a separate line to silence this warning Reverting until this can be figured out. > Do not show it when `if` or `else` come from macros. > E.g., > > #define USED(A) if (A); else > #define SOME_IF(A) if (A) > > void test() { > // No warnings are shown in those cases now. > USED(0); > SOME_IF(0); > } > > Patch by Ilya Biryukov! > > Differential Revision: https://reviews.llvm.org/D40185 llvm-svn: 318665
* [CodeGen] Move Reciprocals option from TargetOptions to CodeGenOptionsCraig Topper2017-11-202-2/+2
| | | | | | Diffrential Revision: https://reviews.llvm.org/D40226 llvm-svn: 318662
* [ARM] For assembler files recognize -Xassembler or -Wa, -mthumbPeter Smith2017-11-201-1/+1
| | | | | | Attempt to fix warning picked up by buildbot. llvm-svn: 318648
* [ARM] For assembler files recognize -Xassembler or -Wa, -mthumbPeter Smith2017-11-202-5/+33
| | | | | | | | | | | | | | | | | | | | | | The Unified Arm Assembler Language is designed so that the majority of assembler files can be assembled for both Arm and Thumb with the choice made as a compilation option. The way this is done in gcc is to pass -mthumb to the assembler with either -Wa,-mthumb or -Xassembler -mthumb. This change adds support for these options to clang. There is no assembler equivalent of -mno-thumb, -marm or -mno-arm so we don't need to recognize these. Ideally we would do all of the processing in CollectArgsForIntegratedAssembler(). Unfortunately we need to change the triple and at that point it is too late. Instead we look for the option earlier in ComputeLLVMTriple(). Fixes PR34519 Differential Revision: https://reviews.llvm.org/D40127 llvm-svn: 318647
* [Driver] Add a cc1 flag for the new TBAA metadata formatIvan A. Kosarev2017-11-201-0/+2
| | | | | | | | | | | This patch starts a series of changes to add support for the new TBAA metadata format proposed in this llvm-dev thread: http://lists.llvm.org/pipermail/llvm-dev/2017-November/118748.html Differential Revision: https://reviews.llvm.org/D39955 llvm-svn: 318644
* [X86] Add icelake CPU support for -march.Craig Topper2017-11-191-0/+4
| | | | llvm-svn: 318617
* [X86] Set __corei7__ preprocessor defines for skylake server and cannonlake.Craig Topper2017-11-191-5/+2
| | | | | | This is the resolution we came to in D38824. llvm-svn: 318616
* Driver: remove `SupportsObjCGC` (NFC)Saleem Abdulrasool2017-11-196-12/+0
| | | | | | This option is not used in the frontend. Remove the method. llvm-svn: 318609
* [Driver] add initial support for alpine linuxMartell Malone2017-11-192-3/+11
| | | | | | | | | | | | set -pie as default for musl linux targets add detection of alpine linux append appropriate compile flags for alpine Reviewers: rnk Differential Revision: https://reviews.llvm.org/D39588 llvm-svn: 318608
* [OpenMP] Show error if VLAs are not supportedJonas Hahnfeld2017-11-185-12/+28
| | | | | | | | | | | | | | Some target devices (e.g. Nvidia GPUs) don't support dynamic stack allocation and hence no VLAs. Print errors with description instead of failing in the backend or generating code that doesn't work. This patch handles explicit uses of VLAs (local variable in target or declare target region) or implicitly generated (private) VLAs for reductions on VLAs or on array sections with non-constant size. Differential Revision: https://reviews.llvm.org/D39505 llvm-svn: 318601
OpenPOWER on IntegriCloud