summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* 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-2611-0/+753
| | | | | | | | | | | | | | | | | | | | | 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-2611-11/+54
| | | | | | | | | | | | | | | | | | | | | | 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
* Revert "Make RecursiveASTVisitor visit lambda capture initialization ↵Martin Bohme2016-07-262-11/+0
| | | | | | | | | | expressions" This reverts commit r276755. (Broke clang-tidy check modernize-loop-convert.) llvm-svn: 276759
* Update for LLVM changesDavid Majnemer2016-07-261-5504/+3125
| | | | | | | InstSimplify has gained the ability to remove needless bitcasts which perturbed some clang codegen tests. llvm-svn: 276756
* Make RecursiveASTVisitor visit lambda capture initialization expressionsMartin Bohme2016-07-262-0/+11
| | | | | | | | | | | | | | | Summary: Lambda capture initializations are part of the explicit source code and therefore should be visited by default but, so far, RecursiveASTVisitor does not visit them. This appears to be an oversight. Because the lambda body needs custom handling (calling TraverseLambdaBody()), the DEF_TRAVERSE_STMT for LambdaExpr sets ShouldVisitChildren to false but then neglects to visit the lambda capture initializations. This patch adds code to visit the expressions associated with lambda capture initializations. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D22566 llvm-svn: 276755
* [Tooling] skip anonymous namespaces when checking if typeLoc references a ↵Eric Liu2016-07-262-16/+37
| | | | | | | | | | | | | | | | 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
* Update for LLVM changesDavid Majnemer2016-07-2612-7113/+5018
| | | | | | | InstSimplify has gained the ability to remove needless bitcasts which perturbed some clang codegen tests. llvm-svn: 276728
* [OpenMP] diagnose orphaned teams constructKelvin Li2016-07-263-6/+19
| | | | | | | | | | 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-262-3/+17
| | | | | | | | | | | | | 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
* [CMake] Pass DYLD_LIBRARY_PATH as CMake variable instead of as envarChris Bieneman2016-07-251-6/+9
| | | | | | | | On OS X 10.11 System Integrity Protection prevents the DYLD environment variables from being set on system binaries. To work around this r276710 accepts DYLD_LIBRARY_PATH as a CMake variable and sets it directly on the archiver commands. To make this work with bootstrapping we need to set DYLD_LIBRARY_PATH to the current stage's library directory and pass that into the next stage's configuration. llvm-svn: 276711
* [Sema][ObjC] Compute the nullability of a conditional expression basedAkira Hatanaka2016-07-252-2/+28
| | | | | | | | | | | | 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
* [CMake] Cleaning up some CMake warningsChris Bieneman2016-07-251-3/+6
| | | | | | | | | | In Bootstrap builds Clang logs some warnings. These are caused because Clang passes CLANG_STAGE and BOOTSTRAP_DEFAULT_PASSTHROUGH into the next stage's configuration. BOOTSTRAP_DEFAULT_PASSTHROUGH shouldn't be passed, so it is renamed to _BOOTSTRAP_DEFAULT_PASSTHROUGH, to prevent passthrough. CLANG_STAGE should be passed, so I've changed the code to log it if it is set outside the if(CLANG_ENABLE_BOOTSTRAP) block. This makes the variable always used, so the warning goes away. llvm-svn: 276674
* [cc1as] Add MCTargetOptions argument to createAsmBackendJoel Jones2016-07-251-2/+4
| | | | | | | | | | | | | Allow an assembler backend to get ABI options. This is to match the changes to http://reviews.llvm.org/D16213. Tested with "make check-clang" Patch by: Joel Jones Differential Revision: https://reviews.llvm.org/D16538 llvm-svn: 276655
* Support '#pragma once' in headers when using PCHSunil Srivastava2016-07-253-1/+21
| | | | | | | | | | | | | 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-253-22/+35
| | | | | | | | - 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-9/+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-252-2/+4
| | | | | | | We agreed to call it "platform default" instead of "architecture default". (see D17286) llvm-svn: 276618
* Update test to account for r276604David Majnemer2016-07-251-2/+2
| | | | llvm-svn: 276607
* [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
* [cxx1z-constexpr-lambda] Make a lambda's closure type eligible as a ↵Faisal Vali2016-07-232-9/+24
| | | | | | | | | | | | | literal-type in C++1z Additionally, for pre-C++1z, instead of forbidding a lambda's closure type from being a literal type through circumlocutorily setting HasNonLiteralTypeFieldsOrBases falsely to true -- handle lambda's more directly in CXXRecordDecl::isLiteral(). One additional small step towards implementing constexpr-lambdas. Thanks to Richard Smith for his review! https://reviews.llvm.org/D22662 llvm-svn: 276514
* Work around MSVC's lack of support for unrestricted unions by making thisRichard Smith2016-07-231-0/+4
| | | | | | | struct a bit bigger under MSVC (this shouldn't be a big deal; we typically allocate no more than two of these at a time, on the stack). llvm-svn: 276509
* Add -fmodules-ts flag to cc1 for the provisional C++ modules TS, and markRichard Smith2016-07-236-4/+30
| | | | | | 'module' and 'import' as keywords when the flag is specified. llvm-svn: 276508
* Add doxygen comments to emmintrin.h's intrinsics.Ekaterina Romanova2016-07-221-0/+769
| | | | | | | | | | | | Only around 50% of the intrinsics in this file are documented now. The patches for the rest of the intrisics in this file will be send out later. The doxygen comments are automatically generated based on Sony's intrinsics docu ment. I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream. This patch was internally reviewed by Paul Robinson. llvm-svn: 276499
* P0217R3: Parsing support and framework for AST representation of C++1zRichard Smith2016-07-2226-62/+879
| | | | | | | | | | | decomposition declarations. There are a couple of things in the wording that seem strange here: decomposition declarations are permitted at namespace scope (which we partially support here) and they are permitted as the declaration in a template (which we reject). llvm-svn: 276492
* [Profile] Enable profile merging with -fprofile-generat[=<dir>]Xinliang David Li2016-07-225-16/+20
| | | | | | | This patch enables raw profile merging for this option which is the new intended behavior. llvm-svn: 276484
* [modules] Teach the ASTWriter to ignore mutations coming from the ASTReader.Vassil Vassilev2016-07-2210-10/+76
| | | | | | | | | | | | | | | Processing update records (and loading a module, in general) might trigger unexpected calls to the ASTWriter (being a mutation listener). Now we have a mechanism to suppress those calls to the ASTWriter but notify other possible mutation listeners. Fixes https://llvm.org/bugs/show_bug.cgi?id=28332 Patch by Cristina Cristescu and me. Reviewed by Richard Smith (D21800). llvm-svn: 276473
* Add regression test for PR27699.Vassil Vassilev2016-07-225-0/+19
| | | | llvm-svn: 276469
* Add .rgba syntax extension to ext_vector_type typesPirama Arumuga Nainar2016-07-228-13/+128
| | | | | | | | | | | | | | | | | | Summary: This patch enables .rgba accessors to ext_vector_type types and adds tests for syntax validation and code generation. 'a' and 'b' can appear either in the point access mode or the numeric access mode (for indices 10 and 11). To disambiguate between the two usages, the accessor type is explicitly passed to relevant methods. Reviewers: rsmith Subscribers: Anastasia, bader, srhines, cfe-commits Differential Revision: http://reviews.llvm.org/D20602 llvm-svn: 276455
* Clang changes for overloading invariant.start and end intrinsicsAnna Thomas2016-07-222-8/+10
| | | | | | | | | | | | | | | | | | | | This change depends on the corresponding LLVM change at: https://reviews.llvm.org/D22519 The llvm.invariant.start and llvm.invariant.end intrinsics currently support specifying invariant memory objects only in the default address space. With this LLVM change, these intrinsics are overloaded for any adddress space for memory objects and we can use these llvm invariant intrinsics in non-default address spaces. Example: llvm.invariant.start.p1i8(i64 4, i8 addrspace(1)* %ptr) This overloaded intrinsic is needed for representing final or invariant memory in managed languages. llvm-svn: 276448
* test commit. update comment grammatically. NFCAnna Thomas2016-07-221-1/+1
| | | | llvm-svn: 276425
* [X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128 with ↵Simon Pilgrim2016-07-222-2/+31
| | | | | | | | | | generic IR As discussed on D22460, I've updated the vbroadcastf128 pd256/ps256 builtins to map directly to generic IR - load+splat a 128-bit vector to both lanes of a 256-bit vector. Fix for PR28657. llvm-svn: 276417
* [Coverage] Attempt to appease a Windows builderVedant Kumar2016-07-221-1/+1
| | | | | | | | | | | | | | | | The builder prints out the following IR: \5CCoverageMapping\5COutput\5Ctest\5Cf1.c The updated test in r276367 expects path separators to be either '/' or '\\', so it chokes on the unexpected "5C" stuff. I'm not sure what that is, but I included a kludge that should work around it. Failing bot: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/8718 llvm-svn: 276370
* [Coverage] Strengthen a test caseVedant Kumar2016-07-221-4/+1
| | | | | | | | We should be able to use `mkdir` without turning on `REQUIRES: shell`. Moreover, this test should check for a path separator which precedes the relative filename to make sure that absolute paths are being used. llvm-svn: 276367
* [analyzer] Add checker modeling potential C++ self-assignmentDevin Coughlin2016-07-218-3/+234
| | | | | | | | | | | | | | | | | | | | | This checker checks copy and move assignment operators whether they are protected against self-assignment. Since C++ core guidelines discourages explicit checking for `&rhs==this` in general we take a different approach: in top-frame analysis we branch the exploded graph for two cases, where &rhs==this and &rhs!=this and let existing checkers (e.g. unix.Malloc) do the rest of the work. It is important that we check all copy and move assignment operator in top frame even if we checked them already since self-assignments may happen undetected even in the same translation unit (e.g. using random indices for an array what may or may not be the same). This reapplies r275820 after fixing a string-lifetime issue discovered by the bots. A patch by Ádám Balogh! Differential Revision: https://reviews.llvm.org/D19311 llvm-svn: 276365
* Reverting r275115 which caused PR28634.Wolfgang Pieb2016-07-212-49/+1
| | | | | | | When empty (forwarding) basic blocks that are referenced by user labels are removed, incorrect code may be generated. llvm-svn: 276361
* [profile] update test case with interface change.Xinliang David Li2016-07-212-10/+3
| | | | | | See http://reviews.llvm.org/D22613, http://reviews.llvm.org/D22614 llvm-svn: 276356
* [Sema] Handle errors during rewriteBuiltinFunctionDeclDavid Majnemer2016-07-212-2/+9
| | | | | | | | | | rewriteBuiltinFunctionDecl can encounter errors when performing DefaultFunctionArrayLvalueConversion. These errors were not handled which led to a null pointer dereference. This fixes PR28651. llvm-svn: 276352
* [CodeGen] Fix a crash when constant folding switch statementErik Pilkington2016-07-212-0/+17
| | | | | | Differential revision: https://reviews.llvm.org/D22542 llvm-svn: 276350
* Disable a flaky test on Windows that uses "echo >>"Reid Kleckner2016-07-211-0/+5
| | | | llvm-svn: 276335
* Reroll "Include unreferenced nested types in member list only for CodeView"Adrian McCarthy2016-07-215-12/+32
| | | | | | Another attempt at r276271, hopefully without breaking ModuleDebugInfo test. llvm-svn: 276317
* Move some IntrusiveRefCntPtrs instead of copying.Benjamin Kramer2016-07-213-15/+17
| | | | | | No functionality change intended. llvm-svn: 276292
* Revert "Include unreferenced nested types in member list only for CodeView"Adrian McCarthy2016-07-215-36/+12
| | | | | | | | | | Patch broke ModuleDebugInfo test on the build bots (but not locally). Again. svn revision: r276271 This reverts commit 9da8a1b05362bc96f2855fb32b5588b89407685d. llvm-svn: 276279
OpenPOWER on IntegriCloud