summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* D18325: Added mm_malloc module export.John Thompson2016-03-221-0/+1
| | | | llvm-svn: 264092
* StaticAnalyzer: Avoid an unintentional copyJustin Bogner2016-03-221-1/+1
| | | | | | | | | | The range here isn't over references, so using `auto &` here incites a copy. Switching to `auto *` would do, but we might as well list an explicit type for clarity. Found by -Wrange-loop-analysis. llvm-svn: 264071
* [MS ABI] Assign an inheritance model for the dest of a member pointer upcastDavid Majnemer2016-03-221-1/+3
| | | | | | | | | While we correctly assigned an inheritance model for the source of a member pointer upcast, we did not do so for the destination. This fixes PR27030. llvm-svn: 264065
* clang-format: [JS] do not wrap ES6 imports/exports.Daniel Jasper2016-03-222-5/+23
| | | | | | | | | "import ... from '...';" and "export ... from '...';" should be treated the same as goog.require/provide/module/forwardDeclare calls. Patch by Martin Probst. llvm-svn: 264055
* [ASTMatchers] New matcher hasReturnValue addedAlexander Kornienko2016-03-221-0/+1
| | | | | | | | | | | | | | Summary: A checker (will be uploaded after this patch) needs to check implicit casts. Existing generic matcher "has" ignores implicit casts and parenthesized expressions and no specific matcher for matching return value expression preexisted. The patch adds such a matcher (hasReturnValue). Reviewers: klimek, sbenza Subscribers: xazax.hun, klimek, cfe-commits Patch by Ádám Balogh! Differential Revision: http://reviews.llvm.org/D17986 llvm-svn: 264037
* Fix warning about extra semicolon. NFC.Vasileios Kalintiris2016-03-221-1/+1
| | | | llvm-svn: 264035
* [Objective-c] Do not set IsExact to true when the receiver is a class.Akira Hatanaka2016-03-221-3/+1
| | | | | | | | | | | | IsExact shouldn't be set to true in WeakObjectProfileTy::getBaseInfo when the receiver is a class because having a class as the receiver doesn't guarantee that the Base is exact. This is a follow-up to r263818. rdar://problem/25208167 llvm-svn: 264025
* [OpenMP] Base support for target directive codegen on NVPTX device.Arpith Chacko Jacob2016-03-224-6/+471
| | | | | | | | | | | | | | Summary: This patch adds base support for codegen of the target directive on the NVPTX device. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D17877 Reworked test case after buildbot failure on windows. Updated patch to integrate r263837 and test case nvptx_target_firstprivate_codegen.cpp. llvm-svn: 264018
* [CUDA] Implement atomicInc and atomicDec builtinsJustin Lebar2016-03-221-0/+16
| | | | | | | | | | | | | | | These functions cannot be implemented as atomicrmw or cmpxchg instructions, so they are implemented as a call to the NVVM intrinsics @llvm.nvvm.atomic.load.inc.32.p0i32 and @llvm.nvvm.atomic.load.dec.32.p0i32. Patch by Jason Henline. Reviewers: jlebar Differential Revision: http://reviews.llvm.org/D18322 llvm-svn: 264009
* [sema] [CUDA] Use std algorithms in EraseUnwantedCUDAMatchesImpl.Justin Lebar2016-03-221-17/+14
| | | | | | | | | | | | Summary: NFC Reviewers: tra Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18327 llvm-svn: 264008
* Revert r263974, "clang-cl: With -fmsc-version=1900, use MSVS2015 diag ↵NAKAMURA Takumi2016-03-212-10/+1
| | | | | | | | formatting." It seems the test wouldn't expect if default target is *-win32. llvm-svn: 264007
* [modules] Store mangling numbers in a deterministic order so they don't ↵Richard Smith2016-03-211-4/+2
| | | | | | cause the resulting .pcm files to be nondeterministic. llvm-svn: 263996
* Revert "Convert some ObjC msgSends to runtime calls."Pete Cooper2016-03-215-121/+18
| | | | | | | | | | | | | | This reverts commit r263607. This change caused more objc_retain/objc_release calls in the IR but those are then incorrectly optimized by the ARC optimizer. Work is going to have to be done to ensure the ARC optimizer doesn't optimize user written RR, but that should land before this change. This change will also need to be updated to take account for any changes required to ensure that user written calls to RR are distinct from those inserted by ARC. llvm-svn: 263984
* clang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting.Nico Weber2016-03-212-1/+10
| | | | llvm-svn: 263974
* [modules] Don't invent a module cache path unless implicit module builds are ↵Richard Smith2016-03-211-22/+20
| | | | | | enabled. llvm-svn: 263970
* clang-format: [JS] no space in union and intersection types.Daniel Jasper2016-03-212-0/+14
| | | | | | | | | The operators | and & in types, as opposed to the bitwise operators, should not have whitespace around them (e.g. `Foo<Bar|Baz>`). Patch by Martin Probst. Thank you. llvm-svn: 263961
* Add replacement = "xxx" to AvailabilityAttr.Manman Ren2016-03-215-10/+33
| | | | | | | | | | | | This commit adds a named argument to AvailabilityAttr, while r263652 adds an optional string argument to __attribute__((deprecated)). This was commited in r263687 and reverted in 263752 due to misaligned access. rdar://20588929 llvm-svn: 263958
* clang-cl: support __cdecl-on-struct anachronismReid Kleckner2016-03-211-0/+9
| | | | | | | | | | | | | | | | | | | | | | Summary: The Microsoft compiler emits warning C4229: anachronism used : modifiers on data are ignored for struct {} __cdecl s; but ICU's gendict can generate such (and does when building LibreOffice), so accepting this in clang-cl too would be useful. Reviewers: rnk Patch by Stephan Bergmann Differential Revision: http://reviews.llvm.org/D16628 llvm-svn: 263947
* clang-format: Make include sorting's main include detection configurable.Daniel Jasper2016-03-211-2/+9
| | | | | | | | | | This patch adds a regular expression to configure suffixes of an included file to check whether it is the "main" include of the current file. Previously, clang-format has allowed arbitrary suffixes on the formatted file, which is still the case when no IncludeMainRegex is specified. llvm-svn: 263943
* [Cxx1z] Implement Lambda Capture of *this by Value as [=,*this] (P0018R3)Faisal Vali2016-03-2112-53/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement lambda capture of *this by copy. For e.g.: struct A { int d = 10; auto foo() { return [*this] (auto a) mutable { d+=a; return d; }; } }; auto L = A{}.foo(); // A{}'s lifetime is gone. // Below is still ok, because *this was captured by value. assert(L(10) == 20); assert(L(100) == 120); If the capture was implicit, or [this] (i.e. *this was captured by reference), this code would be otherwise undefined. Implementation Strategy: - amend the parser to accept *this in the lambda introducer - add a new king of capture LCK_StarThis - teach Sema::CheckCXXThisCapture to handle by copy captures of the enclosing object (i.e. *this) - when CheckCXXThisCapture does capture by copy, the corresponding initializer expression for the closure's data member direct-initializes it thus making a copy of '*this'. - in codegen, when assigning to CXXThisValue, if *this was captured by copy, make sure it points to the corresponding field member, and not, unlike when captured by reference, what the field member points to. - mark feature as implemented in svn Much gratitude to Richard Smith for his carefully illuminating reviews! llvm-svn: 263921
* [tsan] Allow -fsanitize=thread for iOS-style simulator targetsDevin Coughlin2016-03-201-1/+6
| | | | | | | | | Update the clang driver to allow -fsanitize=thread when targeting x86_64 iOS and tvOS simulators. Also restrict TSan targeting OS X to only be supported on x86_64 and not i386. Differential Revision: http://reviews.llvm.org/D18280 llvm-svn: 263913
* AST: Fix some bogus indentation. NFCJustin Bogner2016-03-201-2/+2
| | | | | | Noticed by Liu Xin. Thanks! llvm-svn: 263909
* P0184R0: Allow types of 'begin' and 'end' expressions in range-based for ↵Richard Smith2016-03-2010-36/+62
| | | | | | loops to differ. llvm-svn: 263895
* Reapply [2] [VFS] Add 'overlay-relative' field to YAML filesBruno Cardoso Lopes2016-03-203-20/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reapplies r261552 and r263748. Fixed testcase to reapply. The VFS overlay mapping between virtual paths and real paths is done through the 'external-contents' entries in YAML files, which contains hardcoded paths to the real files. When a module compilation crashes, headers are dumped into <name>.cache/vfs directory and are mapped via the <name>.cache/vfs/vfs.yaml. The script generated for reproduction uses -ivfsoverlay pointing to file to gather the mapping between virtual paths and files inside <name>.cache/vfs. Currently, we are only capable of reproducing such crashes in the same machine as they happen, because of the hardcoded paths in 'external-contents'. To be able to reproduce a crash in another machine, this patch introduces a new option in the VFS yaml file called 'overlay-relative'. When it's equal to 'true' it means that the provided path to the YAML file through the -ivfsoverlay option should also be used to prefix the final path for every 'external-contents'. Example, given the invocation snippet "... -ivfsoverlay <name>.cache/vfs/vfs.yaml" and the following entry in the yaml file: "overlay-relative": "true", "roots": [ ... "type": "directory", "name": "/usr/include", "contents": [ { "type": "file", "name": "stdio.h", "external-contents": "/usr/include/stdio.h" }, ... Here, a file manager request for virtual "/usr/include/stdio.h", that will map into real path "/<absolute_path_to>/<name>.cache/vfs/usr/include/stdio.h. This is a useful feature for debugging module crashes in machines other than the one where the error happened. Differential Revision: http://reviews.llvm.org/D17457 rdar://problem/24499339 llvm-svn: 263893
* [Sema] Make type deduction work with some overloadable functionsGeorge Burgess IV2016-03-191-0/+5
| | | | | | | | | | | Some functions can't have their address taken. If we encounter an overload set where only one of the candidates can have its address taken, we should automatically select that candidate's type in type deduction. Differential Revision: http://reviews.llvm.org/D15591 llvm-svn: 263888
* [Sema] Allow casting of some overloaded functionsGeorge Burgess IV2016-03-192-14/+82
| | | | | | | | | | | Some functions can't have their address taken. If we encounter an overload set where only one of the candidates can have its address taken, we should automatically select that candidate in cast expressions. Differential Revision: http://reviews.llvm.org/D17701 llvm-svn: 263887
* [TLS on Darwin] use CXX_FAST_TLS calling convention for tls_init.Manman Ren2016-03-181-2/+10
| | | | | | | | | | This makes sure we don't generate a lot of code to spill/reload CSRs when calling tls_init from the access functions. This helps performance when tls_init is not inlined into the access functions. llvm-svn: 263854
* [OPENMP] Implementation of codegen for firstprivate clause of target directiveCarlo Bertolli2016-03-182-0/+42
| | | | | | | | | | | | | | | This patch implements the following aspects: It extends sema to check that a variable is not reference in both a map clause and firstprivate or private. This is needed to ensure correct functioning at codegen level, apart from being useful for the user. It implements firstprivate for target in codegen. The implementation applies to both host and nvptx devices. It adds regression tests for codegen of firstprivate, host and device side when using the host as device, and nvptx side. Please note that the regression test for nvptx codegen is missing VLAs. This is because VLAs currently require saving and restoring the stack which appears not to be a supported operation by nvptx backend. It adds a check in sema regression tests for target map, firstprivate, and private clauses. http://reviews.llvm.org/D18203 llvm-svn: 263837
* Fix printing of anonymous struct typedefs.Steven Watanabe2016-03-182-23/+31
| | | | | | | | | | | | | | | | | | | | | | clang -cc1 -ast-print put the struct definition in the wrong place, like this: struct {} typedef S; The reason that this happens is that the printing code first prints the struct definition, and then tells the next declaration to leave out the type. This behavior is correct for simple variable declarations, but fails for typedefs (or extern, mutable, etc). The patch address this problem by skipping the struct declaration when we first see it, and then telling the first subsequent declaration that it needs to print out the full struct definition. Differential Revision: http://reviews.llvm.org/D17285 llvm-svn: 263836
* [Objective-c] Fix a crash in WeakObjectProfileTy::getBaseInfo.Akira Hatanaka2016-03-181-5/+9
| | | | | | | | | | | | | The crash occurs in WeakObjectProfileTy::getBaseInfo when getBase() is called on an ObjCPropertyRefExpr object whose receiver is an interface. This commit fixes the crash by checking the type of the receiver and setting IsExact to true if it is an interface. rdar://problem/25208167 Differential Revision: http://reviews.llvm.org/D18268 llvm-svn: 263818
* Add -fnative-half-arguments-and-returnsPirama Arumuga Nainar2016-03-182-3/+8
| | | | | | | | | | | | | | | | | | Summary: r246764 handled __fp16 arguments and returns for AAPCS, but skipped this handling for OpenCL. Simlar to OpenCL, RenderScript also handles __fp16 type natively. This patch adds the -fnative-half-arguments-and-returns command line flag to allow such languages to skip this coercion of __fp16. Reviewers: srhines, olista01 Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18138 llvm-svn: 263795
* Revert r263783 as buildbot failure is being investigated.Arpith Chacko Jacob2016-03-184-466/+6
| | | | llvm-svn: 263784
* [OpenMP] Base support for target directive codegen on NVPTX device.Arpith Chacko Jacob2016-03-184-6/+466
| | | | | | | | | | | | | Summary: Reworked test case after buildbot failure on windows. This patch adds base support for codegen of the target directive on the NVPTX device. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D17877 llvm-svn: 263783
* Remove usage of LLVM_PREFIX.Chaoren Lin2016-03-181-4/+0
| | | | | | | | | | | | Summary: LLVM_PREFIX could be undefined if CMAKE_INSTALL_PREFIX were set to empty. Reviewers: kparzysz, bkramer, chandlerc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17784 llvm-svn: 263766
* Revert r263687 for ubsan bot failure.Manman Ren2016-03-175-33/+10
| | | | llvm-svn: 263752
* Revert "Reapply [VFS] Add 'overlay-relative' field to YAML files"Bruno Cardoso Lopes2016-03-173-101/+20
| | | | | | | | | Tests failing on http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/46102 This reverts commit a1683cd6c9e07359c09f86e98a4db6b4e1bc51fc. llvm-svn: 263750
* Reapply [VFS] Add 'overlay-relative' field to YAML filesBruno Cardoso Lopes2016-03-173-20/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reapplies r261552. The VFS overlay mapping between virtual paths and real paths is done through the 'external-contents' entries in YAML files, which contains hardcoded paths to the real files. When a module compilation crashes, headers are dumped into <name>.cache/vfs directory and are mapped via the <name>.cache/vfs/vfs.yaml. The script generated for reproduction uses -ivfsoverlay pointing to file to gather the mapping between virtual paths and files inside <name>.cache/vfs. Currently, we are only capable of reproducing such crashes in the same machine as they happen, because of the hardcoded paths in 'external-contents'. To be able to reproduce a crash in another machine, this patch introduces a new option in the VFS yaml file called 'overlay-relative'. When it's equal to 'true' it means that the provided path to the YAML file through the -ivfsoverlay option should also be used to prefix the final path for every 'external-contents'. Example, given the invocation snippet "... -ivfsoverlay <name>.cache/vfs/vfs.yaml" and the following entry in the yaml file: "overlay-relative": "true", "roots": [ ... "type": "directory", "name": "/usr/include", "contents": [ { "type": "file", "name": "stdio.h", "external-contents": "/usr/include/stdio.h" }, ... Here, a file manager request for virtual "/usr/include/stdio.h", that will map into real path "/<absolute_path_to>/<name>.cache/vfs/usr/include/stdio.h. This is a useful feature for debugging module crashes in machines other than the one where the error happened. Differential Revision: http://reviews.llvm.org/D17457 rdar://problem/24499339 llvm-svn: 263748
* Revert "For MS ABI, emit dllexport friend functions defined inline in class"Reid Kleckner2016-03-175-25/+13
| | | | | | | | | This reverts commit r263738. This appears to cause a failure in CXX/temp/temp.decls/temp.friend/p1.cpp llvm-svn: 263740
* For MS ABI, emit dllexport friend functions defined inline in classReid Kleckner2016-03-175-13/+25
| | | | | | | | | | | | Summary: ...as that is apparently what MSVC does Reviewers: rnk Patch by Stephan Bergmann Differential Revision: http://reviews.llvm.org/D15267 llvm-svn: 263738
* clang-format: [JS] Make requoting of JavaScript string literals onlyDaniel Jasper2016-03-171-78/+88
| | | | | | change affected ranges. llvm-svn: 263713
* clang-format: [JS] Fix incorrect spacing around contextual keywords.Daniel Jasper2016-03-171-2/+5
| | | | | | | | | | Before: x.of (); After: x.of(); llvm-svn: 263710
* clang-format: Slightly weaken AlignAfterOpenBracket=AlwaysBreak.Daniel Jasper2016-03-171-1/+11
| | | | | | | | | | | | | | | | | | If a call takes a single argument, using AlwaysBreak can lead to lots of wasted lines and additional indentation without improving the readability in a significant way. Before: caaaaaaaaaaaall( caaaaaaaaaaaall( caaaaaaaaaaaall( caaaaaaaaaaaaaaaaaaaaaaall(aaaaaaaaaaaaaa, aaaaaaaaa)))); After: caaaaaaaaaaaall(caaaaaaaaaaaall(caaaaaaaaaaaall( caaaaaaaaaaaaaaaaaaaaaaall(aaaaaaaaaaaaaa, aaaaaaaaa)))); llvm-svn: 263709
* [OPENMP 4.5] Allow to use private data members in 'copyprivate' clause.Alexey Bataev2016-03-171-43/+31
| | | | | | | | OpenMP 4.5 allows privatization of non-static data members in non-static member functions. This patch adds support of private data members in 'copyprivate' clauses. llvm-svn: 263706
* [OPENMP 4.0] Use 'declare reduction' constructs in 'reduction' clauses.Alexey Bataev2016-03-176-218/+588
| | | | | | | | OpenMP 4.0 allows to define custom reduction operations using '#pragma omp declare reduction' construct. Patch allows to use this custom defined reduction operations in 'reduction' clauses. llvm-svn: 263701
* Minor code cleanups. NFC.Junmo Park2016-03-171-1/+1
| | | | llvm-svn: 263694
* [VFS] Remove wrong header includeBruno Cardoso Lopes2016-03-171-1/+0
| | | | | | Follow up from r263686. Forgot to remove the wrong header file. llvm-svn: 263691
* [index] Make sure that declarations of builtin functions are indexed.Argyrios Kyrtzidis2016-03-171-2/+5
| | | | | | rdar://25154630 llvm-svn: 263689
* Add an optional named argument (replacement = "xxx") to AvailabilityAttr.Manman Ren2016-03-175-10/+33
| | | | | | | | | | This commit adds a named argument to AvailabilityAttr, while r263652 adds an optional string argument to __attribute__((deprecated)). This enables the compiler to provide Fix-Its for deprecated declarations. rdar://20588929 llvm-svn: 263687
* Reapply [2]: [VFS] Add support for handling path traversalsBruno Cardoso Lopes2016-03-172-24/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was applied twice r261551 and 263617 and later reverted because: (1) Windows bot failing on unittests. Change the current behavior to do not handle path traversals on windows. (2) Windows bot failed to include llvm/Config/config.h in order to use HAVE_REALPATH. Use LLVM_ON_UNIX instead, as done in lib/Basic/FileManager.cpp. Handle ".", ".." and "./" with trailing slashes while collecting files to be dumped into the vfs overlay directory. Include the support for symlinks into components. Given the path: /install-dir/bin/../lib/clang/3.8.0/include/altivec.h, if "bin" component is a symlink, it's not safe to use `path::remove_dots` here, and `realpath` is used to get the right answer. Since `realpath` is expensive, we only do it at collecting time (which only happens during the crash reproducer) and cache the base directory for fast lookups. Overall, this makes the input to the VFS YAML file to be canonicalized to never contain traversal components. Differential Revision: http://reviews.llvm.org/D17104 rdar://problem/24499339 llvm-svn: 263686
* [OPENMP] Support for codegen of private clause of target, host sideCarlo Bertolli2016-03-161-1/+5
| | | | | | | | This patch adds support for codegen of private clause of target and a regression test for host code generation, when the host is used as target device. I believe that code generation for nvptx backend would not require anything additional or different to what is done for the host. http://reviews.llvm.org/D18105 llvm-svn: 263654
OpenPOWER on IntegriCloud