summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Typo.Joerg Sonnenberger2016-11-251-1/+1
| | | | llvm-svn: 287947
* Do not do raw name replacement when FromDecl is a class forward-declaration.Eric Liu2016-11-251-3/+10
| | | | | | | | | | | | | | | Summary: If the `FromDecl` is a class forward declaration, the reference is still considered as referring to the original definition given the nature of forward-declarations, so we can't do a raw name replacement in this case. Reviewers: bkramer Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D27132 llvm-svn: 287929
* Consider nested namespaces in the canonical namespace as canonical as well.Eric Liu2016-11-251-31/+49
| | | | | | | | | | | | | | | | | | | | Summary: For example, this case was missed when looking for different but canonical namespaces. UseContext in this case should be considered as in the canonical namespace. ``` namespace a { namespace b { <FromContext> } } namespace a { namespace b { namespace c { <UseContext> } } } ``` Added some commenting. Reviewers: bkramer Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D27125 llvm-svn: 287924
* [CodeGen] Pass objects that are expensive to copy by const ref.Benjamin Kramer2016-11-244-16/+18
| | | | | | | No functionality change. Found by clang-tidy's performance-unnecessary-value-param. llvm-svn: 287894
* [Format] Avoid copying std::sets and simplify code a bit.Benjamin Kramer2016-11-241-3/+3
| | | | | | No functional change. llvm-svn: 287892
* [Sema] Pass APSInts by const ref, avoiding copies.Benjamin Kramer2016-11-241-3/+3
| | | | | | | No functionality change intended. Fix by clang-tidy's performance-unnecessary-value-param check. llvm-svn: 287890
* [PPC] support for arithmetic builtins in the FEEhsan Amiri2016-11-241-1/+176
| | | | | | | | | | | | | | | | | | | | (commit again after fixing the buildbot failures) This adds various overloads of the following builtins to altivec.h: vec_neg vec_nabs vec_adde vec_addec vec_sube vec_subec vec_subc Note that for vec_sub builtins on 32 bit integers, the semantics is similar to what ISA describes for instructions like vsubecuq that work on quadwords: the first operand is added to the one's complement of the second operand. (As opposed to two's complement which I expected). llvm-svn: 287872
* [ASTDumper] Add some more character escapes for convenience.Benjamin Kramer2016-11-241-2/+5
| | | | llvm-svn: 287859
* Remove comments (NFC)Kelvin Li2016-11-241-1509/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D27006 llvm-svn: 287852
* [PPC] revert r287795Ehsan Amiri2016-11-231-176/+1
| | | | | | A test that passed locally is failing on one of the build bots. llvm-svn: 287796
* [PPC] support for arithmetic builtins in the FEEhsan Amiri2016-11-231-1/+176
| | | | | | | | | | | | | | | | | | | | (commit again after fixing the buildbot failures) This adds various overloads of the following builtins to altivec.h: vec_neg vec_nabs vec_adde vec_addec vec_sube vec_subec vec_subc Note that for vec_sub builtins on 32 bit integers, the semantics is similar to what ISA describes for instructions like vsubecuq that work on quadwords: the first operand is added to the one's complement of the second operand. (As opposed to two's complement which I expected). llvm-svn: 287795
* [Sema][Atomics] Treat expected pointer in compare exchange atomics as _NonnullAlex Lorenz2016-11-231-0/+3
| | | | | | | | | | | This commit teaches clang that is has to emit a warning when NULL is passed as the 'expected' pointer parameter into an atomic compare exchange call. rdar://18926650 Differential Revision: https://reviews.llvm.org/D26978 llvm-svn: 287776
* [PPC] Reverting r287772Ehsan Amiri2016-11-231-175/+1
| | | | | | Due to buildbot failure, I revert. Will recommit after investigation. llvm-svn: 287775
* Remove C++ default arg side table for MS ABI ctor closuresReid Kleckner2016-11-238-71/+28
| | | | | | | | | | | | | | | | | | | Summary: We don't need a side table in ASTContext to hold CXXDefaultArgExprs. The important part of building the CXXDefaultArgExprs was to ODR use the default argument expressions, not to make AST nodes. Refactor the code to only check the default argument, and remove the side table in ASTContext which wasn't being serialized. Fixes PR31121 Reviewers: thakis, rsmith, majnemer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27007 llvm-svn: 287774
* [PPC] support for arithmetic builtins in the FEEhsan Amiri2016-11-231-1/+175
| | | | | | | | | | | | | | | | | | | This adds various overloads of the following builtins to altivec.h: vec_neg vec_nabs vec_adde vec_addec vec_sube vec_subec vec_subc Note that for vec_sub builtins on 32 bit integers, the semantics is similar to what ISA describes for instructions like vsubecuq that work on quadwords: the first operand is added to the one's complement of the second operand. (As opposed to two's complement which I expected). llvm-svn: 287772
* [CodeCompletion] Fix incorrect Objective-C block parameter formattingAlex Lorenz2016-11-231-4/+8
| | | | | | | | | | This commit fixes an incorrectly formatted Objective-C block parameter placeholder in a code completion result. The incorrect parameter had a redundant leading parenthesis. rdar://25224416 llvm-svn: 287771
* [ASTImporter] Added ability to import AtomicType nodesGabor Horvath2016-11-231-0/+9
| | | | | | | | Patch by: Kareem Khazem Differential Revision: https://reviews.llvm.org/D26328 llvm-svn: 287763
* [CodeGen] Simplify code. No functionality change intended.Benjamin Kramer2016-11-231-8/+1
| | | | llvm-svn: 287754
* [X86] Replace valignd/q builtins with appropriate __builtin_shufflevector.Craig Topper2016-11-233-78/+90
| | | | llvm-svn: 287733
* Make diagnostic for use of default member initializer before enclosing class isRichard Smith2016-11-222-16/+7
| | | | | | | complete a little more general; it is produced in other cases than the one that it previously talked about. llvm-svn: 287713
* Remove variable only used in an assertion.John McCall2016-11-221-5/+0
| | | | llvm-svn: 287691
* [CodeGen] Insert TargetLibraryInfoWrapperPass before anything else.Marcin Koscielnicki2016-11-221-2/+9
| | | | | | | | | | | | Currently, TargetLibraryInfoWrapperPass is inserted by PMBuilder. However, some passes are inserted manually before the PMBuilder ones - if any of them happens to use TargetLibraryInfoWrapperPass, it'll get a default-constructed one, with an unknown target triple. This happens to InstrProfiling in D21736, breaking it. Differential Revision: http://reviews.llvm.org/D21737 llvm-svn: 287688
* darwin: Unconditionally pass -lto_library, remove -Wliblto warning.Nico Weber2016-11-221-8/+8
| | | | | | | | | | | | | | | | | | | | | https://reviews.llvm.org/D25932 made it so that clang always checks if libLTO.dylib is present on disk, even if -flto is not being used. The motivation for that change was that if a dependency happens to contain bitcode, ld64 will try to load libLTO without -flto explicitly being enabled. However, the change had the undesirable side effect of warning if libLTO.dylib doesn't exist even if it isn't needed. Change things so that -lto_library is always passes, independent of if it exists or not. ld64 only looks at this flag if it uses LTO. If the dylib exists, all is well. If it doesn't, and LTO is not being used, all is well too. If ld64 does end up using LTO and the dylib does not exist, ld64 will print something like ld: could not process llvm bitcode object file, because foo/libLTO.dylib could not be loaded file 'test.o' for architecture x86_64 https://reviews.llvm.org/D26984 llvm-svn: 287685
* Make llvm::Error generated from replacement interfaces more specific.Eric Liu2016-11-221-20/+35
| | | | | | | | | | | | | | | | | Summary: The new error information contains the type of error (e.g. overlap or bad file path) and the replacement(s) that is causing the error. This enables us to resolve some errors. For example, for insertion at the same location conflict, we need to know the existing replacement which conflicts with the new replacement in order to calculate the new position to be insert before/after the existing replacement (for merging). Reviewers: klimek, bkramer Subscribers: djasper, cfe-commits Differential Revision: https://reviews.llvm.org/D26853 llvm-svn: 287639
* Rename option to -lto-pass-remarks-outputAdam Nemet2016-11-221-1/+1
| | | | | | | The new option -pass-remarks-output broke LLVM_LINK_LLVM_DYLIB because of the duplicate option name with opt. llvm-svn: 287628
* [analyzer] Fix a crash on accessing a field within a literal-initialized union.Artem Dergachev2016-11-221-1/+2
| | | | | | | | | | | Because in case of unions we currently default-bind compound values in the store, this quick fix avoids the crash for this case. Patch by Ilya Palachev and independently by Alexander Shaposhnikov! Differential Revision: https://reviews.llvm.org/D26442 llvm-svn: 287618
* Sema, CodeGen: Ensure that an implicit copy ctor is available more often ↵Peter Collingbourne2016-11-222-9/+27
| | | | | | | | | | | | | | | | under the Microsoft C++ ABI. This is needed because whether the constructor is deleted can control whether we pass structs by value directly. To fix this properly we probably want a more direct way for CodeGen to ask whether the constructor was deleted. Fixes PR31049. Differential Revision: https://reviews.llvm.org/D26822 llvm-svn: 287600
* Indicate in AST dump whether special member functions are defaulted and trivial.Richard Smith2016-11-211-1/+8
| | | | llvm-svn: 287599
* [ObjC] Prevent infinite loops when iterating over redeclarationAlex Lorenz2016-11-211-0/+6
| | | | | | | | | | | | | | | | of a method that was declared in an invalid interface This commit fixes an infinite loop that occurs when clang tries to iterate over redeclaration of a method that was declared in an invalid @interface. The existing validity checks don't catch this as that @interface is a duplicate of a previously declared valid @interface declaration, so we have to verify that the found redeclaration is in a valid declaration context. rdar://29220965 Differential Revision: https://reviews.llvm.org/D26664 llvm-svn: 287530
* [Frontend] Add a predefined macro that describes the Objective-C bool typeAlex Lorenz2016-11-211-0/+3
| | | | | | | | | | | | | This commit adds a new predefined macro named __OBJC_BOOL_IS_BOOL that describes the Objective-C boolean type: its value is zero if the Objective-C boolean uses the signed character type, otherwise its value is one as the Objective-C boolean uses the builtin boolean type. rdar://21170440 Differential Revision: https://reviews.llvm.org/D26234 llvm-svn: 287529
* [XRay] Support AArch64 in ClangDean Michael Berris2016-11-211-7/+13
| | | | | | | | | | | | | | | | | | This patch adds XRay support in Clang for AArch64 target. This patch is one of a series: LLVM: https://reviews.llvm.org/D26412 compiler-rt: https://reviews.llvm.org/D26413 Author: rSerge Reviewers: rengolin, dberris Subscribers: aemerson, cfe-commits, iid_iunknown Differential Revision: https://reviews.llvm.org/D26415 llvm-svn: 287518
* Add doxygen comments to immintrin.h's intrinsics.Ekaterina Romanova2016-11-201-0/+35
| | | | | | | | | | 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 Charles Li. llvm-svn: 287483
* Remove alignment from ctors/dtors lists in an attempt to placate LTO.John McCall2016-11-191-3/+9
| | | | llvm-svn: 287458
* Change setDiagnosticsOutputFile to take a unique_ptr from a raw pointer (NFC)Mehdi Amini2016-11-191-1/+2
| | | | | | | | | | | | | | Summary: This makes it explicit that ownership is taken. Also replace all `new` with make_unique<> at call sites. Reviewers: anemet Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26884 llvm-svn: 287449
* Introduce a helper class for building complex constant initializers. NFC.John McCall2016-11-196-508/+767
| | | | | | | I've adopted this in most of the places it makes sense, but v-tables and CGObjCMac will need a second pass. llvm-svn: 287437
* Doxygen comments for avxintrin.h.Ekaterina Romanova2016-11-191-0/+923
| | | | | | | | | | | | | | Added doxygen comments to avxintrin.h's intrinsics. As of now, all the intrinsics in this file that were documented by Sony's intrinsics guide should have corresponding doxygen comments. Note: The doxygen comments are automatically generated based on Sony's intrinsic s document. I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream. Reviewed by Wolfgang Pieb. llvm-svn: 287436
* Sema: As of MSVC 2015, a user-declared move operation causes the deletion of ↵Peter Collingbourne2016-11-191-4/+9
| | | | | | | | both copy operations. Differential Revision: https://reviews.llvm.org/D26868 llvm-svn: 287411
* [Sema] Don't allow applying address-of operator to a call to a functionAkira Hatanaka2016-11-191-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | with __unknown_anytype return type. When the following code is compiled, Sema infers that the type of __unknown_anytype is double: extern __unknown_anytype func(); double *d = (double*)&func(); This triggers an assert in CodeGenFunction::EmitCallExprLValue because it doesn't expect to see a call to a function with a non-reference scalar return type. This commit prevents the assert by making VisitUnaryAddrOf error out if the address-of operator is applied to a call to a function with __unknown_anytype return type. rdar://problem/20287610 Differential revision: https://reviews.llvm.org/D26808 llvm-svn: 287410
* [AMDGPU] Change frexp.exp builtin to return i16 for f16 inputKonstantin Zhuravlyov2016-11-181-3/+12
| | | | | | Differential Revision: https://reviews.llvm.org/D26863 llvm-svn: 287390
* [analyzer] Refactor recursive symbol reachability check to use symbol_iteratorDominic Chen2016-11-181-24/+9
| | | | | | | | | | Reviewers: zaks.anna, dcoughlin Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26773 llvm-svn: 287380
* [ARM] Fix sema check of ARM special register namesOleg Ranevskyy2016-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a simple sema check patch for arguments of `__builtin_arm_rsr` and the related builtins, which currently do not allow special registers with indexes >7. Some of the possible register name formats these builtins accept are: ``` {c}p<coprocessor>:<op1>:c<CRn>:c<CRm>:<op2> ``` ``` o0:op1:CRn:CRm:op2 ``` where `op1` / `op2` are integers in the range [0, 7] and `CRn` / `CRm` are integers in the range [0, 15]. The current sema check does not allow `CRn` > 7 and accepts `op2` up to 15. Reviewers: LukeCheeseman, rengolin Subscribers: asl, aemerson, rengolin, cfe-commits Differential Revision: https://reviews.llvm.org/D26464 llvm-svn: 287378
* Adapt to llvm NamedRegionTimer changesMatthias Braun2016-11-184-8/+13
| | | | | | We have to specify a name and description for the timers and groups now. llvm-svn: 287371
* LTO support for -fsave-optimization-record on DarwinAdam Nemet2016-11-181-0/+13
| | | | | | | | I guess this would have to be added for each linker. Differential Revision: https://reviews.llvm.org/D26833 llvm-svn: 287358
* Fix a comment for -fsave-optimization-recordAdam Nemet2016-11-181-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D26807 llvm-svn: 287357
* [OpenCL] Introduce ReadPipeType and WritePipeType.Joey Gouly2016-11-186-23/+87
| | | | | | | This allows Sema to diagnose passing a read_only pipe to a write_only pipe argument. llvm-svn: 287343
* Add doxygen comments for lzcntintrin.h's intrinsics.Ekaterina Romanova2016-11-181-0/+50
| | | | | | | | | The doxygen comments are automatically generated based on Sony's intrinsics document. I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream. This patch was internally reviewed by Charles Li. llvm-svn: 287317
* [AVX-512] Replace masked 16-bit element variable shift builtins with new ↵Craig Topper2016-11-182-162/+90
| | | | | | unmasked versions and selects. llvm-svn: 287313
* Add doxygen comments to fxsrintrin.h's intrinsics.Ekaterina Romanova2016-11-181-4/+52
| | | | | | | | | The doxygen comments are automatically generated based on Sony's intrinsics document. I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream. This patch was internally reviewed by Paul Robinson and Charles Li. llvm-svn: 287295
* Forward ns_consumed delegate arguments with a move.John McCall2016-11-181-3/+21
| | | | | | | | | | | | | | | | StartFunction enters a release cleanup for ns_consumed arguments in ARC, so we need to balance that somehow. We could teach StartFunction that it's emitting a delegating function, so that the cleanup is unnecessary, but that would be invasive and somewhat fraught. We could balance the consumed argument with an extra retain, but clearing the original variable should be easier to optimize and avoid some extra work at -O0. And there shouldn't be any difference as long as nothing else uses the argument, which should always be true for the places we emit delegate arguments. Fixes PR 27887. llvm-svn: 287291
* [CUDA] Wrapper header changes necessary to support MacOS.Justin Lebar2016-11-182-2/+14
| | | | | | | | | | Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26780 llvm-svn: 287288
OpenPOWER on IntegriCloud