summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang-format] Break template declarations followed by commentsKrasimir Georgiev2018-05-232-2/+55
| | | | | | | | | | | | | | | | | Summary: This patch fixes two bugs in clang-format where the template wrapper doesn't skip over comments causing a long template declaration to not be split into multiple lines. These were latent and exposed by r332436. Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D47257 llvm-svn: 333085
* Fix duplicate class template definitions problemGabor Marton2018-05-233-21/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We fail to import a `ClassTemplateDecl` if the "To" context already contains a definition and then a forward decl. This is because `localUncachedLookup` does not find the definition. This is not a lookup error, the parser behaves differently than assumed in the importer code. A `DeclContext` contains one DenseMap (`LookupPtr`) which maps names to lists. The list is a special list `StoredDeclsList` which is optimized to have one element. During building the initial AST, the parser first adds the definition to the `DeclContext`. Then during parsing the second declaration (the forward decl) the parser again calls `DeclContext::addDecl` but that will not add a new element to the `StoredDeclsList` rarther it simply overwrites the old element with the most recent one. This patch fixes the error by finding the definition in the redecl chain. Added tests for the same issue with `CXXRecordDecl` and with `ClassTemplateSpecializationDecl`. These tests pass and they pass because in `VisitRecordDecl` and in `VisitClassTemplateSpecializationDecl` we already use `D->getDefinition()` after the lookup. Reviewers: a.sidorin, xazax.hun, szepet Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D46950 llvm-svn: 333082
* Test commitKristof Umann2018-05-231-2/+2
| | | | llvm-svn: 333080
* Fix unaligned memory access when reading INPUT_FILE_OFFSETS dataRaphael Isemann2018-05-231-1/+2
| | | | | | | | | | | | | | Summary: The blob data is unaligned, so we also should read it as such. Should fix the random failures with the sanitizer builds. Reviewers: rsmith, v.g.vassilev Reviewed By: v.g.vassilev Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47247 llvm-svn: 333069
* Revert r333044 "Use zeroinitializer for (trailing zero portion of) large ↵Hans Wennborg2018-05-235-136/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | array initializers" It caused asserts, see PR37560. > Use zeroinitializer for (trailing zero portion of) large array initializers > more reliably. > > Clang has two different ways it emits array constants (from InitListExprs and > from APValues), and both had some ability to emit zeroinitializer, but neither > was able to catch all cases where we could use zeroinitializer reliably. In > particular, emitting from an APValue would fail to notice if all the explicit > array elements happened to be zero. In addition, for large arrays where only an > initial portion has an explicit initializer, we would emit the complete > initializer (which could be huge) rather than emitting only the non-zero > portion. With this change, when the element would have a suffix of more than 8 > zero elements, we emit the array constant as a packed struct of its initial > portion followed by a zeroinitializer constant for the trailing zero portion. > > In passing, I found a bug where SemaInit would sometimes walk the entire array > when checking an initializer that only covers the first few elements; that's > fixed here to unblock testing of the rest. > > Differential Revision: https://reviews.llvm.org/D47166 llvm-svn: 333067
* [DOXYGEN] Formatting changes for better intrinsics documentation renderingEkaterina Romanova2018-05-235-31/+43
| | | | | | | | (1) I added some \see cross-references to a few select intrinsics that are related (and have the same or similar semantics). (2) pmmintrin.h, smmintrin.h, xmmintrin.h have very few minor formatting changes. They make rendering of our intrinsics documentation better. llvm-svn: 333065
* [X86] Undef the vector reduction helper macros when we're done with them.Craig Topper2018-05-231-0/+8
| | | | | | These are implementation helper macros we shouldn't expose them to user code if we don't need to. llvm-svn: 333064
* [X86] In the floating point max reduction intrinsics, negate infinity before ↵Craig Topper2018-05-232-8/+6
| | | | | | | | feeding it to set1. Previously we negated the whole vector after splatting infinity. But its better to negate the infinity before splatting. This generates IR with the negate already folded with the infinity constant. llvm-svn: 333062
* [X86] Remove mask argument from more builtins that are handled completely in ↵Craig Topper2018-05-236-672/+296
| | | | | | CGBuiltin.cpp. Just wrap a select builtin around them in the header file instead. llvm-svn: 333061
* [analyzer] CStringChecker fix for strlcpy when no bytes are copied to the ↵David Carlier2018-05-232-1/+10
| | | | | | | | | | | | | | dest buffer Again, strlc* does not return a pointer so the zero size case doest not fit. Reviewers: NoQ, george.karpenkov Reviewed by: NoQ Differential Revision: https://reviews.llvm.org/D47007 llvm-svn: 333060
* This is a test commit.David Carlier2018-05-231-1/+1
| | | | llvm-svn: 333059
* [AST][ObjC] Print implicit property expression that only has a setter ↵Alex Lorenz2018-05-234-3/+26
| | | | | | | | without crashing rdar://40447209 llvm-svn: 333046
* Use zeroinitializer for (trailing zero portion of) large array initializersRichard Smith2018-05-235-71/+136
| | | | | | | | | | | | | | | | | | | | | | | more reliably. Clang has two different ways it emits array constants (from InitListExprs and from APValues), and both had some ability to emit zeroinitializer, but neither was able to catch all cases where we could use zeroinitializer reliably. In particular, emitting from an APValue would fail to notice if all the explicit array elements happened to be zero. In addition, for large arrays where only an initial portion has an explicit initializer, we would emit the complete initializer (which could be huge) rather than emitting only the non-zero portion. With this change, when the element would have a suffix of more than 8 zero elements, we emit the array constant as a packed struct of its initial portion followed by a zeroinitializer constant for the trailing zero portion. In passing, I found a bug where SemaInit would sometimes walk the entire array when checking an initializer that only covers the first few elements; that's fixed here to unblock testing of the rest. Differential Revision: https://reviews.llvm.org/D47166 llvm-svn: 333044
* [CodeGen] use nsw negation for builtin absSanjay Patel2018-05-222-4/+5
| | | | | | | | | | | | | The clang builtins have the same semantics as the stdlib functions. The stdlib functions are defined in section 7.20.6.1 of the C standard with: "If the result cannot be represented, the behavior is undefined." That lets us mark the negation with 'nsw' because "sub i32 0, INT_MIN" would be UB/poison. Differential Revision: https://reviews.llvm.org/D47202 llvm-svn: 333038
* [X86] As mentioned in post-commit feedback in D47174, move the 128 bit f16c ↵Craig Topper2018-05-225-135/+90
| | | | | | | | | | intrinsics into f16cintrin.h and remove __emmintrin_f16c.h These were included in emmintrin.h to match Intel Intrinsics Guide documentation. But this is because icc is capable of emulating them on targets that don't support F16C using library calls. Clang/LLVM doesn't have this emulation support. So it makes more sense to include them in immintrin.h instead. I've left a comment behind to hopefully deter someone from trying to move them again in the future. llvm-svn: 333033
* [X86] Remove mask argument from some builtins that are handled completely in ↵Craig Topper2018-05-226-101/+69
| | | | | | CGBuiltin.cpp. Just wrap a select builtin around them in the header file instead. llvm-svn: 333027
* [X86] Another attempt at fixing the intrinsic module map for rr333014.Craig Topper2018-05-221-1/+1
| | | | llvm-svn: 333026
* [X86] Add two missing #endif directives to immintrin.h that should have been ↵Craig Topper2018-05-221-0/+2
| | | | | | in r333014. llvm-svn: 333023
* [X86] Add __emmintrin_f16c.h to module map and CMakeLists.Craig Topper2018-05-222-0/+6
| | | | | | I missed this in r333014 llvm-svn: 333020
* [X86] Move 128-bit f16c intrinsics to __emmintrin_f16c.h include from ↵Craig Topper2018-05-224-110/+149
| | | | | | | | | | | | emmintrin.h. Move 256-bit f16c intrinsics back to f16cintrin.h Intel documents the 128-bit versions as being in emmintrin.h and the 256-bit version as being in immintrin.h. This patch makes a new __emmtrin_f16c.h to hold the 128-bit versions to be included from emmintrin.h. And makes the existing f16cintrin.h contain the 256-bit versions and include it from immintrin.h with an error if its included directly. Differential Revision: https://reviews.llvm.org/D47174 llvm-svn: 333014
* Reland r332885, "CodeGen, Driver: Start using direct split dwarf emission in ↵Peter Collingbourne2018-05-228-60/+115
| | | | | | | | | clang." As well as two follow-on commits r332906, r332911 with a fix for test clang/test/CodeGen/split-debug-filename.c. llvm-svn: 333013
* Revert "[clang-format] Fix putting ObjC message arguments in one line for ↵Jacek Olesiak2018-05-222-56/+1
| | | | | | | | | | | | | | | | multiline receiver" Summary: Reverts D46879 Reviewers: benhamilton Reviewed By: benhamilton Subscribers: krasimir, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D47205 llvm-svn: 332998
* Revert r332982 Call CreateTempMemWithoutCast for ActiveFlagYaxun Liu2018-05-225-56/+36
| | | | | | Due to regression on arm. llvm-svn: 332991
* [CodeGen] produce the LLVM canonical form of absSanjay Patel2018-05-222-14/+10
| | | | | | | | We chose the 'slt' form as canonical in IR with: rL332819 ...so we should generate that form directly for efficiency. llvm-svn: 332989
* [CodeGen] add tests for abs builtins; NFCSanjay Patel2018-05-221-0/+29
| | | | llvm-svn: 332988
* Call CreateTempMemWithoutCast for ActiveFlagYaxun Liu2018-05-225-36/+56
| | | | | | | | | | | | | | | | Introduced CreateMemTempWithoutCast and CreateTemporaryAllocaWithoutCast to emit alloca without casting to default addr space. ActiveFlag is a temporary variable emitted for clean up. It is defined as AllocaInst* type and there is a cast to AlllocaInst in SetActiveFlag. An alloca casted to generic pointer causes assertion in SetActiveFlag. Since there is only load/store of ActiveFlag, it is safe to use the original alloca, therefore use CreateMemTempWithoutCast is called. Differential Revision: https://reviews.llvm.org/D47099 llvm-svn: 332982
* [CodeView] Enable debugging of captured variables within C++ lambdasBrock Wyma2018-05-223-19/+181
| | | | | | | | | This change will help Visual Studio resolve forward references to C++ lambda routines used by captured variables. Differential Revision: https://reviews.llvm.org/D45438 llvm-svn: 332975
* [clang-format] Add a test case for crashKrasimir Georgiev2018-05-221-0/+12
| | | | llvm-svn: 332974
* Revert "CodeGen, Driver: Start using direct split dwarf emission in clang."Amara Emerson2018-05-228-112/+60
| | | | | | This reverts commit r332885 as it broke several greendragon buildbots. llvm-svn: 332973
* Revert "Fix another make_unique ambiguity."Amara Emerson2018-05-221-2/+1
| | | | | | This reverts commit r332906 as a dependency to revert r332885. llvm-svn: 332972
* Revert "Add missing x86-registered-target."Amara Emerson2018-05-221-1/+0
| | | | | | This reverts commit r332911, as a dependency to revert r332885. llvm-svn: 332971
* clang-format: [JS] do not wrap before any `is`.Martin Probst2018-05-222-2/+10
| | | | | | | | | | | | | | | | | | | | Summary: `is` type annotations can occur at any nesting level. For example: function x() { return function y(): a is B { ... }; } Breaking before the `is` above breaks TypeScript parsing the code. This change prevents the wrap. Reviewers: krasimir Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D47193 llvm-svn: 332968
* [objc-gnustep2] Use unsigned char to avoid potential UB in isalnum.David Chisnall2018-05-221-1/+1
| | | | | | Suggested by Gabor Buella. llvm-svn: 332966
* [objc-gnu] Fix test.David Chisnall2018-05-221-1/+1
| | | | | | | | The test was implicitly capturing the local filesystem layout. Patch by Hans Wennborg! llvm-svn: 332965
* [objc-gnustep2] Use isalnum instead of a less efficient and nonportable ↵David Chisnall2018-05-221-1/+1
| | | | | | | | equivalent. Patch by Hans Wennborg! llvm-svn: 332964
* Revert "Revert r332955 "GNUstep Objective-C ABI version 2""David Chisnall2018-05-2215-364/+1691
| | | | llvm-svn: 332963
* [clang-format] Fix crash in getLengthToMatchingParenKrasimir Georgiev2018-05-221-3/+3
| | | | | | | | | | | | | | Summary: Found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8212 Reviewers: bkramer Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D47191 llvm-svn: 332961
* Revert r332955 "GNUstep Objective-C ABI version 2"Bjorn Pettersson2018-05-2215-1691/+364
| | | | | | | Reverted due to buildbot failures. Seems like isnumber() is some Apple addition to cctype. llvm-svn: 332957
* Add cctype include.David Chisnall2018-05-221-0/+1
| | | | | | | This appears to leak in already on libc++ platforms, but is breaking on some other targets. llvm-svn: 332955
* GNUstep Objective-C ABI version 2David Chisnall2018-05-2215-364/+1691
| | | | | | | | | | | | | | | | | | | | | Summary: This includes initial support for the (hopefully final) updated Objective-C ABI, developed here: https://github.com/davidchisnall/clang-gnustep-abi-2 It also includes some cleanups and refactoring from older GNU ABIs. The current version is ELF only, other formats to follow. Reviewers: rjmccall, DHowett-MSFT Reviewed By: rjmccall Subscribers: smeenai, cfe-commits Differential Revision: https://reviews.llvm.org/D46052 llvm-svn: 332950
* [X86] Prevent inclusion of __wmmintrin_aes.h and __wmmintrin_pclmul.h ↵Craig Topper2018-05-222-2/+10
| | | | | | without including wmmintrin.h llvm-svn: 332929
* Add missing include for cstdint to Visibility.hRaphael Isemann2018-05-211-0/+1
| | | | | | | | | | Summary: We use uint8_t in this header, so we need to include cstdint. Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47164 llvm-svn: 332913
* Add missing x86-registered-target.Peter Collingbourne2018-05-211-0/+1
| | | | llvm-svn: 332911
* [X86] Remove a builtin that should have been removed in r332882.Craig Topper2018-05-212-2/+0
| | | | llvm-svn: 332909
* Fix another make_unique ambiguity.Peter Collingbourne2018-05-211-1/+2
| | | | llvm-svn: 332906
* [X86] Remove masking from pternlog llvm intrinsics and use a select ↵Craig Topper2018-05-213-18/+77
| | | | | | | | | | | | instruction instead. Because the intrinsics in the headers are implemented as macros, we can't just use a select builtin and pternlog builtin. This would require one of the macro arguments to be used twice. Depending on what was passed to the macro we could expand an expression twice leading to weird behavior. We could maybe declare our local variable in the macro, but that would need to worry about name collisions. To avoid that just generate IR directly in CGBuiltin.cpp. Differential Revision: https://reviews.llvm.org/D47125 llvm-svn: 332891
* Revert r332847; it caused us to miscompile certain forms of reference ↵Richard Smith2018-05-2110-77/+47
| | | | | | initialization. llvm-svn: 332886
* CodeGen, Driver: Start using direct split dwarf emission in clang.Peter Collingbourne2018-05-218-60/+112
| | | | | | | | Fixes PR37466. Differential Revision: https://reviews.llvm.org/D47093 llvm-svn: 332885
* [X86] Use __builtin_convertvector to implement some of the packed integer to ↵Craig Topper2018-05-2114-152/+128
| | | | | | | | | | | | packed float conversion intrinsics. I believe this is safe assuming default default FP environment. The conversion might be inexact, but it can never overflow the FP type so this shouldn't be undefined behavior for the uitofp/sitofp instructions. We already do something similar for scalar conversions. Differential Revision: https://reviews.llvm.org/D46863 llvm-svn: 332882
* CodeGen: Add a dwo output file argument to addPassesToEmitFile and hook it ↵Peter Collingbourne2018-05-211-1/+1
| | | | | | | | | | up to dwo output. Part of PR37466. Differential Revision: https://reviews.llvm.org/D47089 llvm-svn: 332881
OpenPOWER on IntegriCloud