summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* Revert r332028; see PR37545 for details.Richard Smith2018-05-212-97/+80
| | | | llvm-svn: 332879
* [Clang Tablegen] Add llvm_unreachable() to getModifierName()Mark Searles2018-05-211-0/+2
| | | | | | | | | | | | | | | | | Fix internal build failure: ../../../ClangDiagnosticsEmitter.cpp -o ClangDiagnosticsEmitter.o ../../../ClangDiagnosticsEmitter.cpp: In function 'llvm::StringRef {anonymous}::getModifierName({anonymous}::ModifierType)': ../../../ClangDiagnosticsEmitter.cpp:495:1: error: control reaches end of non-void function [-Werror=return-type] } ^ Build failure triggered by git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332799 91177308-0d34-0410-b5e6-96231b3b80d8 Differential Revision: https://reviews.llvm.org/D47150 llvm-svn: 332854
* [OPENMP-SIMD] Fix PR37536: Fix definition of _OPENMP macro.Alexey Bataev2018-05-215-29/+34
| | | | | | | | if `-fopenmp-simd` is specified alone, `_OPENMP` macro should not be defined. If `-fopenmp-simd` is specified along with the `-fopenmp`, `_OPENMP` macro should be defined with the value `201511`. llvm-svn: 332852
* [AMDGPU] fixes for lds f32 builtinsDaniil Fukalov2018-05-214-9/+69
| | | | | | | | | | | | 1. added restrictions to memory scope, order and volatile parameters 2. added custom processing for these builtins - currently is not used code, needed to switch off GCCBuiltin link to the builtins (ongoing change to llvm tree) 3. builtins renamed as requested Differential Revision: https://reviews.llvm.org/D43281 llvm-svn: 332848
* [CodeGen] Recognize more cases of zero initializationSerge Pavlov2018-05-219-41/+77
| | | | | | | | | | | | | | | | | | | | | If a variable has an initializer, codegen tries to build its value. If the variable is large in size, building its value requires substantial resources. It causes strange behavior from user viewpoint: compilation of huge zero initialized arrays like: char data_1[2147483648u] = { 0 }; consumes enormous amount of time and memory. With this change codegen tries to determine if variable initializer is equivalent to zero initializer. In this case variable value is not constructed. This change fixes PR18978. Differential Revision: https://reviews.llvm.org/D46241 llvm-svn: 332847
* [Sema] Fix incorrect packed aligned structure layoutMomchil Velikov2018-05-212-3/+30
| | | | | | | | | | Handle attributes before checking the record layout (e.g. underalignment check during `alignas` processing), as layout may be cached without taking into account attributes that may affect it. Differential Revision: https://reviews.llvm.org/D46439 llvm-svn: 332843
* [CodeGen] Disable aggressive structor optimizations at -O0, take 2Pavel Labath2018-05-213-14/+49
| | | | | | | | | | | | | | | | | | | | | | | | | The first version of the patch (r332228) was flawed because it was putting structors into C5/D5 comdats very eagerly. This is correct only if we can ensure the comdat contains all required versions of the structor (which wasn't the case). This version uses a more nuanced approach: - for local structor symbols we use an alias because we don't have to worry about comdats or other compilation units. - linkonce symbols are emitted separately, as we cannot guarantee we will have all symbols we need to form a comdat (they are emitted lazily, only when referenced). - available_externally symbols are also emitted separately, as the code seemed to be worried about emitting an alias in this case. - other linkage types are not affected by the optimization level. They either get put into a comdat (weak) or get aliased (external). Reviewers: rjmccall, aprantl Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D46685 llvm-svn: 332839
* [X86] Remove some preprocessor feature checks from intrinsic headersCraig Topper2018-05-212-4/+0
| | | | | | | | | | | | | | | | | | | Summary: These look to be a couple things that weren't removed when we switched to target attribute. The popcnt makes including just smmintrin.h also include popcntintrin.h. The popcnt file itself already contains target attrributes. The prefetch ones are just wrappers around __builtin_prefetch which we have graceful fallbacks for in the backend if the exact instruction isn't available. So there's no reason to hide them. And it makes them available in functions that have the write target attribute but not a -march command line flag. Reviewers: echristo, RKSimon, spatel, DavidKreitzer Reviewed By: echristo Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47029 llvm-svn: 332830
* [X86] Remove some unused builtins.Craig Topper2018-05-212-16/+0
| | | | | | These were upgraded to native shufflevectors months ago. llvm-svn: 332829
* [X86] Remove mask arguments from permvar builtins/intrinsics. Use a select ↵Craig Topper2018-05-2013-199/+163
| | | | | | | | in IR instead. Someday maybe we'll use selects for all the builtins. llvm-svn: 332825
* Revert 332750, clang part (see comment on D46910).Nico Weber2018-05-201-2/+1
| | | | llvm-svn: 332822
* Sema: diagnose invalid catch parameter in ObjCSaleem Abdulrasool2018-05-202-3/+17
| | | | | | | | | Ensure that the type being used has an associated interface when declaring the parameter for `@catch`. Resolves PR37384! llvm-svn: 332821
* Print the qualified name when dumping deserialized decls.Vassil Vassilev2018-05-201-2/+4
| | | | | | | | | This is useful to understand and debug the lazy template specializations used in the pch and modules. Differential Revision: https://reviews.llvm.org/D41785 llvm-svn: 332817
* [Driver] Temporarily remove test for LLVM findNearestBrian Gesiak2018-05-191-1/+0
| | | | | | | Summary: This fixes a failure caused by the revert of https://reviews.llvm.org/rL332805. llvm-svn: 332806
* [Driver] Loosen test for LLVM findNearestBrian Gesiak2018-05-191-1/+1
| | | | | | | | | | | | | | | | | Summary: When https://reviews.llvm.org/D46776 landed to improve the behavior of `llvm::OptTable::findNearest`, a PS4 buildbot began failing due to an assertion that a suggestion "-debug-info-macro" should be provided for the unrecognized option `clang -cc1as -debug-info-macros`. All other buildbots succeeded in this check, and the PS4 buildbot succeeded in the other `findNearest` tests. Temporarily loosen this check in order to reland the `findNearest` change. Test Plan: check-clang llvm-svn: 332804
* CodeGen: block capture shouldn't ICEJF Bastien2018-05-192-13/+39
| | | | | | | | | | When a lambda capture captures a __block in the same statement, the compiler asserts out because isCapturedBy assumes that an Expr can only be a BlockExpr, StmtExpr, or if it's a Stmt then all the statement's children are expressions. That's wrong, we need to visit all sub-statements even if they're not expressions to see if they also capture. Fix this issue by pulling out the isCapturedBy logic to use RecursiveASTVisitor. <rdar://problem/39926584> llvm-svn: 332801
* Adjust and fix failing CXX tests after r332799Eric Fiselier2018-05-192-9/+9
| | | | llvm-svn: 332800
* [Clang Tablegen][RFC] Allow Early Textual Substitutions in `Diagnostic` ↵Eric Fiselier2018-05-1911-319/+1106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | messages. Summary: There are cases where the same string or select is repeated verbatim in a lot of diagnostics. This can be a pain to maintain and update. Tablegen provides no way stash the common text somewhere and reuse it in the diagnostics, until now! This patch allows diagnostic texts to contain `%sub{<definition-name>}`, where `<definition-name>` names a Tablegen record of type `TextSubstitution`. These substitutions are done early, before the diagnostic string is otherwise processed. All `%sub` modifiers will be replaced before the diagnostic definitions are emitted. The substitution must specify all arguments used by the substitution, and modifier indexes in the substitution are re-numbered accordingly. For example: ``` def select_ovl_candidate : TextSubstitution<"%select{function|constructor}0%select{| template| %2}1">; ``` when used as ``` "candidate `%sub{select_ovl_candidate}3,2,1 not viable" ``` will act as if we wrote: ``` "candidate %select{function|constructor}3%select{| template| %1}2 not viable" ``` Reviewers: rsmith, rjmccall, aaron.ballman, a.sidorin Reviewed By: rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D46740 llvm-svn: 332799
* Do not enable RTTI with -fexceptions, for PS4Sunil Srivastava2018-05-186-70/+19
| | | | | | | | | | | | | | | | | | | NFC for targets other than PS4. This patch is a change in behavior for PS4, in that PS4 will no longer enable RTTI when -fexceptions is specified (RTTI and Exceptions are disabled by default on PS4). RTTI will remain disabled except for types being thrown or caught. Also, '-fexceptions -fno-rtti' (previously prohibited on PS4) is now accepted, as it is for other targets. This patch removes some PS4 specific code, making the code cleaner. Also, in the test file rtti-options.cpp, PS4 tests where the behavior is the same as the generic x86_64-linux are removed, making the test cleaner. Differential Revision: https://reviews.llvm.org/D46982 llvm-svn: 332784
* [test] Fix run line to use correct tripleShoaib Meenai2018-05-181-1/+1
| | | | | | | | | | objc_begin_catch/objc_end_catch are specific to the Itanium ABI, so we should be using an Itanium triple for this test. Additionally, while I'm here, convert the run line to invoke the compiler directly rather than going through the driver. llvm-svn: 332777
* Maintain PS4 ABI compatibility by making the fix made in r331136 not apply ↵Douglas Yung2018-05-182-4/+7
| | | | | | | | | | | | when the target is the PS4. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47084 llvm-svn: 332773
* Revert r332470 (and corresponding tests in r332492).Richard Smith2018-05-1815-768/+57
| | | | | | | This regressed our support for __attribute__((section)). See added test file for example of code broken by this. llvm-svn: 332760
* Support: Simplify endian stream interface. NFCI.Peter Collingbourne2018-05-184-33/+31
| | | | | | | | | | | | Provide some free functions to reduce verbosity of endian-writing a single value, and replace the endianness template parameter with a field. Part of PR37466. Differential Revision: https://reviews.llvm.org/D47032 llvm-svn: 332757
* Revert "Move #include manipulation code to new lib/Tooling/Inclusions."Eric Liu2018-05-1811-26/+15
| | | | | | | This reverts commit r332720. This break build bot with modules. Need to investigate. Revert the change to unbreak bots. llvm-svn: 332751
* [Support] Avoid normalization in sys::getDefaultTargetTriplePetr Hosek2018-05-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | The return value of sys::getDefaultTargetTriple, which is derived from -DLLVM_DEFAULT_TRIPLE, is used to construct tool names, default target, and in the future also to control the search path directly; as such it should be used textually, without interpretation by LLVM. Normalization of this value may lead to unexpected results, for example if we configure LLVM with -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-linux-gnu, normalization will transform that value to x86_64--linux-gnu. Driver will use that value to search for tools prefixed with x86_64--linux-gnu- which may be confusing. This is also inconsistent with the behavior of the --target flag which is taken as-is without any normalization and overrides the value of LLVM_DEFAULT_TARGET_TRIPLE. Users of sys::getDefaultTargetTriple already perform their own normalization as needed, so this change shouldn't impact existing logic. Differential Revision: https://reviews.llvm.org/D46910 llvm-svn: 332750
* MC: Change the streamer ctors to take an object writer instead of a stream. ↵Peter Collingbourne2018-05-181-2/+4
| | | | | | | | | | | | | | NFCI. The idea is that a client that wants split dwarf would create a specific kind of object writer that creates two files, and use it to create the streamer. Part of PR37466. Differential Revision: https://reviews.llvm.org/D47050 llvm-svn: 332749
* [X86] Fix a bad cast from mask16 to mask8 in _mm256_mask_cvtepi16_epi8 ↵Craig Topper2018-05-181-2/+2
| | | | | | introduced in r332266. llvm-svn: 332738
OpenPOWER on IntegriCloud