summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Fix misleading indentation in ObjCDeallocChecker. NFC.Devin Coughlin2016-07-281-1/+1
| | | | llvm-svn: 277009
* Revert r276973 "Adjust Registry interface to not require plugins to export a ↵John Brawn2016-07-283-4/+2
| | | | | | | | | registry" Buildbot failures when building with clang -Werror. Reverting while I try to figure this out. llvm-svn: 277008
* [Driver] Fix Windows SDK DetectionZachary Turner2016-07-281-4/+5
| | | | | | | | | | | | | | | | This fixes a couple of bugs in Windows SDK Detection. 1. `readFullStringValue` returns a bool, but was being compared with ERROR_SUCCESS. 2. `RegQueryValueExW` might return the null terminator in the queried value which will result in incorrect values being returned from `getSystemRegistryString`. Patch By: comicfans44@gmail.com Reviewed By: zturner Differential Revision: http://reviews.llvm.org/D21946 llvm-svn: 277005
* [OpenMP] Change name of variable in mappble expression.Samuel Antao2016-07-281-7/+7
| | | | | | This attempts to fix a failure in Windows bots pottentially related with a reserved keyword. llvm-svn: 276988
* [OpenMP] Do not use default argument in lambda from mappable expressions ↵Samuel Antao2016-07-281-4/+7
| | | | | | | | handlers. Windows bots were complaining about that. llvm-svn: 276981
* [OpenMP][CUDA] Do not forward OpenMP flags for CUDA device actions.Samuel Antao2016-07-281-2/+6
| | | | | | | | | | | | | | | Summary: This patch prevents OpenMP flags from being forwarded to CUDA device commands. That was causing the CUDA frontend to attempt to emit OpenMP code which is not supported. This fixes the bug reported in https://llvm.org/bugs/show_bug.cgi?id=28723. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, tra, ABataev Subscribers: caomhin, cfe-commits Differential Revision: https://reviews.llvm.org/D22895 llvm-svn: 276979
* [OpenMP] Code generation for the is_device_ptr clauseSamuel Antao2016-07-285-47/+240
| | | | | | | | | | | | Summary: This patch adds support for the is_device_ptr clause. It expands SEMA to use the mappable expression logic that can only be tested with code generation in place and check conflicts with other data sharing related clauses using the mappable expressions infrastructure. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: caomhin, cfe-commits Differential Revision: https://reviews.llvm.org/D22788 llvm-svn: 276978
* [OpenMP] Codegen for use_device_ptr clause.Samuel Antao2016-07-288-169/+606
| | | | | | | | | | | | Summary: This patch adds support for the use_device_ptr clause. It includes changes in SEMA that could not be tested without codegen, namely, the use of the first private logic and mappable expressions support. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: caomhin, cfe-commits Differential Revision: https://reviews.llvm.org/D22691 llvm-svn: 276977
* Reapply r276856 "Adjust Registry interface to not require plugins to export ↵John Brawn2016-07-283-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | a registry" This version has two fixes compared to the original: * In Registry.h the template static members are instantiated before they are used, as clang gives an error if you do it the other way around. * The use of the Registry template in clang-tidy is updated in the same way as has been done everywhere else. Original commit message: Currently the Registry class contains the vestiges of a previous attempt to allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a plugin would have its own copy of a registry and export it to be imported by the tool that's loading the plugin. This only works if the plugin is entirely self-contained with the only interface between the plugin and tool being the registry, and in particular this conflicts with how IR pass plugins work. This patch changes things so that instead the add_node function of the registry is exported by the tool and then imported by the plugin, which solves this problem and also means that instead of every plugin having to export every registry they use instead LLVM only has to export the add_node functions. This allows plugins that use a registry to work on Windows if LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used. llvm-svn: 276973
* [AArch64] Using AArch64TargetParser in Clang.Zijiao Ma2016-07-282-54/+17
| | | | | | | | | | This resubmit r270688 which broke some specific buildbots.That's because there is incorrect indexing problem in the targetparser,and the problem is fixed in r276957. Differential Revision: https://reviews.llvm.org/D21277 llvm-svn: 276958
* [analyzer] Add check::BeginFunction to CheckerDocumentation checks. NFC.Devin Coughlin2016-07-281-0/+1
| | | | | | This was an oversight from when I added BeginFunction support in r261293. llvm-svn: 276950
* Retry: [Driver] Compute effective target triples once per job (NFCI)Vedant Kumar2016-07-275-26/+24
| | | | | | | | | | | | | | | | Compute an effective triple once per job. Cache the triple in the prevailing ToolChain for the duration of the job. Clients which need effective triples now look them up in the ToolChain. This eliminates wasteful re-computation of effective triples (e.g in getARMFloatABI()). While we're at it, delete MachO::ComputeEffectiveClangTriple. It was a no-op override. Differential Revision: https://reviews.llvm.org/D22596 llvm-svn: 276937
* Revert "[Driver] Compute effective target triples once per job (NFCI)"Vedant Kumar2016-07-277-338/+187
| | | | | | | This reverts commit r275895 in order to address some post-commit review feedback from Eric Christopher (see: the list thread for r275895). llvm-svn: 276936
* [OpenMP] Add support to map member expressions with references to pointers.Samuel Antao2016-07-271-3/+23
| | | | | | | | | | | | Summary: This patch add support to map pointers through references in class members. Although a reference does not have storage that a user can access, it still has to be mapped in order to get the deep copy right and the dereferencing code work properly. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: caomhin, cfe-commits Differential Revision: https://reviews.llvm.org/D22787 llvm-svn: 276934
* [OpenMP] Add support for mapping array sections through pointer references.Samuel Antao2016-07-272-9/+17
| | | | | | | | | | | | | | | Summary: This patch fixes a bug in the map of array sections whose base is a reference to a pointer. The existing mapping support was not prepared to deal with it, causing the compiler to crash. Mapping a reference to a pointer enjoys the same characteristics of a regular pointer, i.e., it is passed by value. Therefore, the reference has to be materialized in the target region. Reviewers: hfinkel, carlo.bertolli, kkwli0, ABataev Subscribers: caomhin, cfe-commits Differential Revision: https://reviews.llvm.org/D22690 llvm-svn: 276933
* Basic/Targets.cpp: Reformat aarch64 CPU list.Matthias Braun2016-07-271-8/+11
| | | | | | | Having 1 entry per line and an alphabetical order is clearer and reduces the risk of invalid merges. llvm-svn: 276931
* Refactor how include paths are appended to the command arguments.Samuel Antao2016-07-271-57/+30
| | | | | | | | | | | | | | | Summary: This patch aims at removing redundancy in the way include paths for the regular and offloading toolchains are appended to the arguments list in the clang tool. This was suggested by @rsmith in response to r275931. Reviewers: rsmith, tra Subscribers: rsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D22518 llvm-svn: 276929
* [CUDA] Align kernel launch args correctly when the LLVM type's alignment is ↵Justin Lebar2016-07-272-25/+22
| | | | | | | | | | | | | | | | | | | | | | | different from the clang type's alignment. Summary: Before this patch, we computed the offsets in memory of args passed to GPU kernel functions by throwing all of the args into an LLVM struct. clang emits packed llvm structs basically whenever it feels like it, and packed structs have alignment 1. So we cannot rely on the llvm type's alignment matching the C++ type's alignment. This patch fixes our codegen so we always respect the clang types' alignments. Reviewers: rnk Subscribers: cfe-commits, tra Differential Revision: https://reviews.llvm.org/D22879 llvm-svn: 276927
* Don't crash when generating code for __attribute__((naked)) member functions.Justin Lebar2016-07-272-0/+8
| | | | | | | | | | | | | | Summary: Previously this crashed inside EmitThisParam(). There should be no prelude for naked functions, so just skip the whole thing. Reviewers: majnemer Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D22715 llvm-svn: 276925
* Add flags to toggle preservation of assembly commentsNirav Dave2016-07-273-0/+6
| | | | | | | | | | | | Summary: Add -fpreserve-as-comments and -fno-preserve-as-comments. Reviewers: echristo, rnk Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D22883 llvm-svn: 276907
* Adjust coercion of aggregates on RenderScriptPirama Arumuga Nainar2016-07-273-1/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In RenderScript, the size of the argument or return value emitted in the IR is expected to be the same as the size of corresponding qualified type. For ARM and AArch64, the coercion performed by Clang can change the parameter or return value to a type whose size is different (usually larger) than the original aggregate type. Specifically, this can happen in the following cases: - Aggregate parameters of size <= 64 bytes and return values smaller than 4 bytes on ARM - Aggregate parameters and return values smaller than bytes on AArch64 This patch coerces the cases above to an integer array that is the same size and alignment as the original aggregate. A new field is added to TargetInfo to detect a RenderScript target and limit this coercion just to that case. Tests added to test/CodeGen/renderscript.c Reviewers: rsmith Subscribers: aemerson, srhines, llvm-commits Differential Revision: https://reviews.llvm.org/D22822 llvm-svn: 276904
* [Sema] Teach getCurrentThisType to reconize lambda in in-class initializerErik Pilkington2016-07-271-22/+16
| | | | | | | | Fixes PR27994, a crash on valid. Differential revision: https://reviews.llvm.org/D21145 llvm-svn: 276900
* Fix unnecessary default switch warningSimon Pilgrim2016-07-271-1/+1
| | | | llvm-svn: 276889
* Implement filtering for code completion of identifiers.Vassil Vassilev2016-07-273-2/+38
| | | | | | | | Patch by Cristina Cristescu and Axel Naumann! Agreed on post commit review (D17820). llvm-svn: 276878
* [ARM] Pass thumb as architecture to the underlying tools, when targeting windowsRenato Golin2016-07-271-1/+3
| | | | | | | | This makes sure that the thumb section flag gets set by the assembler. Patch by Martin Storsjö. llvm-svn: 276869
* Revert r276856 "Adjust Registry interface to not require plugins to export a ↵John Brawn2016-07-273-4/+2
| | | | | | | | registry" This is causing a huge pile of buildbot failures. llvm-svn: 276857
* Adjust Registry interface to not require plugins to export a registryJohn Brawn2016-07-273-2/+4
| | | | | | | | | | | | | | | | | | | | Currently the Registry class contains the vestiges of a previous attempt to allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a plugin would have its own copy of a registry and export it to be imported by the tool that's loading the plugin. This only works if the plugin is entirely self-contained with the only interface between the plugin and tool being the registry, and in particular this conflicts with how IR pass plugins work. This patch changes things so that instead the add_node function of the registry is exported by the tool and then imported by the plugin, which solves this problem and also means that instead of every plugin having to export every registry they use instead LLVM only has to export the add_node functions. This allows plugins that use a registry to work on Windows if LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used. Differential Revision: http://reviews.llvm.org/D21385 llvm-svn: 276856
* clang-format: Fix incorrect detection of QT-signals access specifier.Daniel Jasper2016-07-271-1/+1
| | | | | | | | | | | | | | | | | Before: void f() { label: signals .baz(); } After: void f() { label: signals.baz(); } llvm-svn: 276854
* [ARM] Pass -mimplcit-it= to integrated assemblerOliver Stannard2016-07-271-0/+21
| | | | | | Differential Revision: https://reviews.llvm.org/D22761 llvm-svn: 276851
* Support setting default value for -rtlib at build timeJonas Hahnfeld2016-07-273-18/+29
| | | | | | | | | | | | | | | | | This patch introduces a new cmake variable: CLANG_DEFAULT_RTLIB, thru which we can specify a default value for -rtlib (libgcc or compiler-rt) at build time, just like how we set the default C++ stdlib thru CLANG_DEFAULT_CXX_STDLIB. With these two options, we can configure clang to build binaries on Linux that have no runtime dependence on any gcc libs (libstdc++ or libgcc_s). Patch by Lei Zhang! Differential Revision: https://reviews.llvm.org/D22663 llvm-svn: 276848
* Fix for compiling with clang <= 3.7 and g++6 headersVedant Kumar2016-07-271-3/+3
| | | | | | | | | | | Make integers explicitly unsigned, so the tuple constructor will resolve properly when but with clang 3.6, 3.7 and gcc 6.1.1 libstdc++ headers. Patch by Frederich Munch! Differential Revision: https://reviews.llvm.org/D22798 llvm-svn: 276831
* Modules: follow up to r276769.Manman Ren2016-07-261-0/+1
| | | | | | | | In r276769, I forgot to forward the driver option, add that here. rdar://26675801 llvm-svn: 276797
* [analyzer] Hotfix for build failure due to declaration shadowing in r276782.Artem Dergachev2016-07-261-3/+3
| | | | | | | CloneDetector member variable is shadowing the class with the same name, which causes build failures on some platforms. llvm-svn: 276791
* [analyzer] Add basic capabilities to detect source code clones.Artem Dergachev2016-07-264-0/+375
| | | | | | | | | | | | | | | | | | | | | This patch adds the CloneDetector class which allows searching source code for clones. For every statement or group of statements within a compound statement, CloneDetector computes a hash value, and finds clones by detecting identical hash values. This initial patch only provides a simple hashing mechanism that hashes the kind of each sub-statement. This patch also adds CloneChecker - a simple static analyzer checker that uses CloneDetector to report copy-pasted code. Patch by Raphael Isemann! Differential Revision: https://reviews.llvm.org/D20795 llvm-svn: 276782
* Modules: add command line option fmodules-disable-diagnostic-validationManman Ren2016-07-263-8/+21
| | | | | | | | | | | | | | | | | | | | | | With PCH+Module, sometimes compiler gives a hard error: Module file ‘<some-file path>.pcm' is out of date and needs to be rebuilt This happens when we have a pch importing a module and the module gets overwritten by another compiler instance after we build the pch (one example is that both compiler instances hash to the same pcm file but use different diagnostic options). When we try to load the pch later on, the compiler notices that the imported module is out of date (modification date, size do not match) but it can't handle this out of date pcm (i.e it does not know how to rebuild the pch). This commit introduces a new command line option so for PCH + module, we can turn on this option and if two compiler instances only differ in diagnostic options, the latter instance will not invalidate the original pcm. rdar://26675801 Differential Revision: http://reviews.llvm.org/D22773 llvm-svn: 276769
* [Tooling] skip anonymous namespaces when checking if typeLoc references a ↵Eric Liu2016-07-261-16/+29
| | | | | | | | | | | | | | | | type decl from a different canonical namespace. Summary: [Tooling] skip anonymous namespaces when checking if typeLoc references a type decl from a different canonical namespace. Reviewers: bkramer Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D22808 llvm-svn: 276754
* [OpenMP] diagnose orphaned teams constructKelvin Li2016-07-261-6/+14
| | | | | | | | | | The OpenMP spec mandates that 'a teams construct must be contained within a target construct'. Currently, this scenario is not diagnosed. This patch is to add check for orphaned teams construct and issue an error message. Differential Revision: https://reviews.llvm.org/D22785 llvm-svn: 276726
* [Coverage] Do not write out coverage mappings with zero entriesVedant Kumar2016-07-261-0/+11
| | | | | | | | | | | | | After r275121, we stopped mapping regions from system headers. Lambdas declared in regions belonging to system headers started producing empty coverage mappings, since the files corresponding to their spelling locs were being ignored. The coverage reader doesn't know what to do with these empty mappings. This commit makes sure that we don't produce them and adds a test. I'll make the reader stricter in a follow-up commit. llvm-svn: 276716
* [Sema][ObjC] Compute the nullability of a conditional expression basedAkira Hatanaka2016-07-251-1/+1
| | | | | | | | | | | | on the nullabilities of its operands. This commit is a follow-up to r276076 and enables computeConditionalNullability to compute the merged nullability when the operands are objective-c pointers. rdar://problem/22074116 llvm-svn: 276696
* Support '#pragma once' in headers when using PCHSunil Srivastava2016-07-251-1/+3
| | | | | | | | | | | | | The '#pragma once' directive was erroneously ignored when encountered in the header-file specified in generate-PCH-mode. This resulted in compile-time errors in some cases with legal code, and also a misleading warning being produced. Patch by Warren Ristow! Differential Revision: http://reviews.llvm.org/D19815 llvm-svn: 276653
* [Myriad]: better compatibility with vendor sourceDouglas Katzman2016-07-252-22/+32
| | | | | | | | - Accept ma{2100,2150,2150} for -mcpu - Define more preprocessor macros - Don't append "le/" to little-endian lib dirs llvm-svn: 276646
* MPI-Checker: move MPIFunctionClassifier.hAlexander Kornienko2016-07-255-106/+10
| | | | | | | | | | | | | | | | Summary: This patch moves the MPIFunctionClassifier header to `clang/include/clang/StaticAnalyzer/Checkers`, in order to make it accessible in other parts of the architecture. Reviewers: dcoughlin, zaks.anna Subscribers: alexfh, cfe-commits Patch by Alexander Droste! Differential Revision: https://reviews.llvm.org/D22671 llvm-svn: 276639
* Update description for CLANG_DEFAULT_CXX_STDLIB and add comment. NFCJonas Hahnfeld2016-07-251-0/+2
| | | | | | | We agreed to call it "platform default" instead of "architecture default". (see D17286) llvm-svn: 276618
* [MSVCToolChain] Guard hardcoded Windows paths with LLVM_ON_WIN32David Majnemer2016-07-251-0/+2
| | | | | | | Paths like C:/foo will never work on UNIX platforms, don't bother implicitly adding them to the search path. llvm-svn: 276606
* [Sema] Replace mem_fn with lambdas. NFC.George Burgess IV2016-07-242-7/+11
| | | | | | | | | I'm told that some optimizers like lambdas a lot more than mem_fn. Given that the readability difference is basically nil, and we seem to use lambdas basically everywhere else, it seems sensible to just use lambdas. llvm-svn: 276577
* [Driver] Switch some getenv calls to llvm::sys::Process::GetEnvDavid Majnemer2016-07-242-27/+29
| | | | | | No functional change is intended. llvm-svn: 276573
* [X86] Block pbroadcastq instructions on 32-bit targets instead of pbroadcastb.Craig Topper2016-07-243-7/+3
| | | | | | Thanks to Simon Pilgrim for catching the mistake. llvm-svn: 276564
* [analyzer] Pring LocationContext in ExplodedGraph dumps.Artem Dergachev2016-07-241-51/+41
| | | | | | | | | | Remove some FIXMEs in the surrounding code, which have been addressed long time ago by introducing checker-specific tags. Differential Revision: https://reviews.llvm.org/D22622 llvm-svn: 276557
* [Profile] Use a flag to enable PGO rather than the profraw filenameXinliang David Li2016-07-231-0/+1
| | | | | | | | Patch by Jake VanAdrighem Differential Revision: http://reviews.llvm.org/D22608 llvm-svn: 276517
* Add -fmodules-ts flag to cc1 for the provisional C++ modules TS, and markRichard Smith2016-07-232-4/+7
| | | | | | 'module' and 'import' as keywords when the flag is specified. llvm-svn: 276508
OpenPOWER on IntegriCloud