summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [analyzer] Fix bots by changing the analyzer-config tests.George Karpenkov2018-07-112-4/+2
| | | | | | To be investigated. llvm-svn: 336756
* [analyzer] Partial revert of https://reviews.llvm.org/D49050George Karpenkov2018-07-111-8/+7
| | | | llvm-svn: 336755
* [analyzer] Pass through all arguments from the registerChecker() to the ↵George Karpenkov2018-07-112-25/+13
| | | | | | | | | | checker constructor A lot of checkers could be cleaned up in a similar way Differential Revision: https://reviews.llvm.org/D49050 llvm-svn: 336753
* [SemaCXX] Remove comment from coroutines test, NFCBrian Gesiak2018-07-111-2/+0
| | | | | | | | | Summary: The file name was accidentally included when the test file was added. Test Plan: check-clang llvm-svn: 336750
* Remove qualtype qualifier in coroutine error to prevent assert in debugBrian Gesiak2018-07-112-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: A forward-declared coroutine_traits should trip an error; we need a complete type. Unfortunately, in debug mode only, we trip an assert when attempting to provide the fully qualified type for the error message. If you try to compile a program with a forward-declared coroutine_traits in debug mode, clang will crash. I've included a test for the behavior and removed the q modifier on the error message. This prevents the crash in debug mode and does not change the behavior for the error message on a forward-declaration of a coroutine_traits type. Test Plan: I've included a test for the forward-declaration. Patch by Tanoy Sinha! Reviewers: modocache, GorNishanov Reviewed By: modocache Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49099 llvm-svn: 336748
* [docs] List correct default for -ftemplate-depth; also add missingRichard Smith2018-07-111-1/+6
| | | | | | documentation for -fconstexpr-steps. llvm-svn: 336747
* PR38095: Allow constant-folding of loads through bitcasted pointers ifRichard Smith2018-07-112-3/+17
| | | | | | the bitcast only changed cvr-qualifications within the pointer type. llvm-svn: 336746
* DR330: look through array types when forming the cv-decomposition of a type.Richard Smith2018-07-118-57/+183
| | | | | | | | | | This allows more qualification conversions, eg. conversion from 'int *(*)[]' -> 'const int *const (*)[]' is now permitted, along with all the consequences of that: more types are similar, more cases are permitted by const_cast, and conversely, fewer "casting away constness" cases are permitted by reinterpret_cast. llvm-svn: 336745
* [X86] Also fix the test for _mm512_mullo_epi64 to test the intrinsic instead ↵Craig Topper2018-07-101-1/+1
| | | | | | | | of a copy of the intrinsic implementation. This had the same issue I just fixed in r336739. Apparently I copy pasted _mm512_mullo_epi64 when I added _mm512_mullox_epi64. llvm-svn: 336740
* [X86] Fix the test for _mm512_mullox_epi64 to test the intrinsic instead of ↵Craig Topper2018-07-101-1/+1
| | | | | | a copy of the intrinsic implementation. llvm-svn: 336739
* Fix determination of whether a reinterpret_cast casts away constness.Richard Smith2018-07-104-180/+223
| | | | | | | | | | | | | | The "casts away constness" check doesn't care at all how the different layers of the source and destination type were formed: for example, if the source is a pointer and the destination is a pointer-to-member, the types are still decomposed and their pointee qualifications are still checked. This rule is bizarre and somewhat ridiculous, so as an extension we accept code making use of such reinterpret_casts with a warning outside of SFINAE contexts. llvm-svn: 336738
* [NFC] Switch CodeGenFunction to use value init instead of member init listsErich Keane2018-07-102-56/+40
| | | | | | | | | The member init list for the sole constructor for CodeGenFunction has gotten out of hand, so this patch moves the non-parameter-dependent initializations into the member value inits. Note: This is what was intended to be committed in r336726 llvm-svn: 336729
* Revert -r336726, which included more files than intended.Erich Keane2018-07-1023-589/+141
| | | | llvm-svn: 336727
* [NFC] Switch CodeGenFunction to use value init instead of member init listsErich Keane2018-07-1023-141/+589
| | | | | | | | The member init list for the sole constructor for CodeGenFunction has gotten out of hand, so this patch moves the non-parameter-dependent initializations into the member value inits. llvm-svn: 336726
* Patch to fix pragma metadata for do-while loopsBjorn Pettersson2018-07-102-5/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Make sure that loop metadata only is put on the backedge when expanding a do-while loop. Previously we added the loop metadata also on the branch in the pre-header. That could confuse optimization passes and result in the loop metadata being associated with the wrong loop. Fixes https://bugs.llvm.org/show_bug.cgi?id=38011 Committing on behalf of deepak2427 (Deepak Panickal) Reviewers: #clang, ABataev, hfinkel, aaron.ballman, bjope Reviewed By: bjope Subscribers: bjope, rsmith, shenhan, zzheng, xbolva00, lebedev.ri, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D48721 llvm-svn: 336717
* Revert r336590 "[libclang] evalute compound statement cursors before trying ↵Evgeniy Stepanov2018-07-102-54/+13
| | | | | | | | | to evaluate" New memory leaks in LibclangParseTest_EvaluateChildExpression_Test::TestBody() llvm-svn: 336716
* Revert r336591 "[libclang] NFC, simplify clang_Cursor_Evaluate"Evgeniy Stepanov2018-07-101-24/+25
| | | | | | This change is blocking r336590 which is being reverted due to memory leaks. llvm-svn: 336715
* Fix a typo/regression in r335495.John Baldwin2018-07-102-1/+7
| | | | | | | | | | | Use getTriple.isMIPS64() to detect 64-bit MIPS ABIs in FreeBSD::getSupportedSanitizers() instead of getTriple.isMIPS32(). Reviewed By: atanasyan Differential Revision: https://reviews.llvm.org/D49143 llvm-svn: 336710
* Support -fdebug-prefix-map for assembler source (pass to cc1as). ThisPaul Robinson2018-07-104-9/+30
| | | | | | | | | | | is useful to omit the debug compilation dir when compiling assembly files with -g. Part of PR38050. Patch by Siddhartha Bagaria! Differential Revision: https://reviews.llvm.org/D48989 llvm-svn: 336685
* AMDGPU: Try to fix test againMatt Arsenault2018-07-101-1/+1
| | | | llvm-svn: 336681
* Update test for backend error message changeMatt Arsenault2018-07-101-1/+1
| | | | llvm-svn: 336676
* [analyzer] Add option to set maximum symbol complexity thresholdMikhail R. Gadelha2018-07-103-1/+19
| | | | | | | | | | | | | | | | | | | Summary: This adds an option, max-symbol-complexity, so an user can set the maximum symbol complexity threshold. Note that the current behaviour is equivalent to max complexity = 0, when taint analysis is not enabled and tests show that in a number of tests, having complexity = 25 yields the same results as complexity = 10000. This patch was extracted and modified from Dominic Chen's patch, D35450. Reviewers: george.karpenkov, NoQ, ddcc Reviewed By: george.karpenkov Subscribers: xazax.hun, szepet, a.sidorin Differential Revision: https://reviews.llvm.org/D49093 llvm-svn: 336671
* [modules] Fix 37878; Autoload subdirectory modulemaps with specific LangOptsYuka Takahashi2018-07-1010-15/+66
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Reproducer and errors: https://bugs.llvm.org/show_bug.cgi?id=37878 lookupModule was falling back to loadSubdirectoryModuleMaps when it couldn't find ModuleName in (proper) search paths. This was causing iteration over all files in the search path subdirectories for example "/usr/include/foobar" in bugzilla case. Users don't expect Clang to load modulemaps in subdirectories implicitly, and also the disk access is not cheap. if (AllowExtraModuleMapSearch) true with ObjC with @import ModuleName. Reviewers: rsmith, aprantl, bruno Subscribers: cfe-commits, teemperor, v.g.vassilev Differential Revision: https://reviews.llvm.org/D48367 llvm-svn: 336660
* Fixing builtin __atomic_fetch_min declarationOmer Paparo Bivas2018-07-101-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D49068 llvm-svn: 336658
* [MinGW] Skip adding default win32 api libraries if -lwindowsapp is specifiedMartin Storsjo2018-07-102-8/+26
| | | | | | | | | | | | | | | | | In this setup, skip adding all the default windows import libraries, if linking to windowsapp (which replaces them, when targeting the windows store/UWP api subset). With GCC, the same is achieved by using a custom spec file, but since clang doesn't use spec files, we have to allow other means of overriding what default libraries to use (without going all the way to using -nostdlib, which would exclude everything). The same approach, in detecting certain user specified libraries and omitting others from the defaults, was already used in SVN r314138. Differential Revision: https://reviews.llvm.org/D49059 llvm-svn: 336655
* [MinGW] Treat any -lucrt* as replacing -lmsvcrtMartin Storsjo2018-07-102-1/+7
| | | | | | | | | | | | | | Since SVN r314138, we check if the user has specified any particular alternative msvcrt/ucrt version, and skip the default -lmsvcrt in those cases. In addition to the existing names checked, we should also treat a plain -lucrt in the same way, mingw-w64 has now added a separate import library named libucrt.a, in addition to libucrtbase.a. Differential Revision: https://reviews.llvm.org/D49054 llvm-svn: 336654
* [X86] Lowering integer truncation intrinsics to native IRMikhail Dvoretckii2018-07-104-37/+50
| | | | | | | | | | | | | This patch lowers the _mm[256|512]_cvtepi{64|32|16}_epi{32|16|8} intrinsics to native IR in cases where the result's length is less than 128 bits. The resulting IR for 256-bit inputs is folded into VPMOV instructions, while for 128-bit inputs the vpshufb (or, in the 64-to-32-bit case, vinsertps) instructions are generated instead Differential Revision: https://reviews.llvm.org/D48712 llvm-svn: 336643
* Test commitStephen Kelly2018-07-101-0/+1
| | | | | | Add redundant doc. llvm-svn: 336640
* [X86] Use masked the masked scalar fma builtins to implement the default ↵Craig Topper2018-07-102-568/+340
| | | | | | | | | | rounding version of the fma intrinsics. The rounding mode is checked in CGBuiltin.cpp to generate the correct intrinsic call. Making this switch switchs the masking to use the i8 bitcast to <8 x i1> and extract i1 version of the IR for the mask. Previously we ended up with a scalar 'and' plus an icmp. llvm-svn: 336637
* [Sema] Fix a structured binding typo correction bugErik Pilkington2018-07-102-0/+9
| | | | | | | | | BindingDecls have null type until their initializer is processed, so we can't assume that a correction candidate has non-null type. rdar://41559582 llvm-svn: 336634
* [ODRHash] Merge the two function hashes into one.Richard Trieu2018-07-107-50/+368
| | | | | | | | | | | Functions that are a sub-Decl of a record were hashed differently than other functions. This change keeps the AddFunctionDecl function and the hash of records now calls this function. In addition, AddFunctionDecl has an option to perform a hash as if the body was absent, which is required for some checks after loading modules. Additional logic prevents multiple error message from being printed. llvm-svn: 336632
* Update crash diagnostics test to avoid attempting to write into variousEric Christopher2018-07-101-2/+2
| | | | | | directories if possible and to not require %t to have "Output" in the name. llvm-svn: 336630
* Fix parsing of privacy annotations in os_log format strings.Akira Hatanaka2018-07-102-30/+72
| | | | | | | | | | Privacy annotations shouldn't have to appear in the first comma-delimited string in order to be recognized. Also, they should be ignored if they are preceded or followed by non-whitespace characters. rdar://problem/40706280 llvm-svn: 336629
* [X86] Remove custom handling for __builtin_ia32_divss_round_mask and ↵Craig Topper2018-07-101-24/+0
| | | | | | __builtin_ia32_divsd_round_mask. llvm-svn: 336628
* [X86] Add __builtin_ia32_selectss_128 and __builtin_ia32_selectsd_128 that ↵Craig Topper2018-07-108-138/+162
| | | | | | | | | | | | is suitable for use in scalar mask intrinsics. This will convert the i8 mask argument to <8 x i1> and extract an i1 and then emit a select instruction. This replaces the '(__U & 1)" and ternary operator used in some of intrinsics. The old sequence was lowered to a scalar and and compare. The new sequence uses an i1 vector that will interoperate better with other mask intrinsics. This removes the need to handle div_ss/sd specially in CGBuiltin.cpp. A follow up patch will add the GCCBuiltin name back in llvm and remove the custom handling. I made some adjustments to legacy move_ss/sd intrinsics which we reused here to do a simpler extract and insert instead of 2 extracts and two inserts or a shuffle. llvm-svn: 336622
* Rename function calls missed in r336605Richard Trieu2018-07-091-2/+2
| | | | | | NextIsLatest -> isFirst llvm-svn: 336610
* [Index] Add index::IndexingOptions::IndexImplicitInstantiationFangrui Song2018-07-095-5/+8
| | | | | | | | | | | | | | | | | Summary: With IndexImplicitInstantiation=true, the following case records an occurrence of B::bar in A::foo, which will benefit cross reference tools. template <class T> struct B { void bar() {}}; template <class T> struct A { void foo(B<T> *x) { x->bar(); }}; int main() { A<int> a; a.foo(0); } Reviewers: akyrtzi, arphaman, rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49002 llvm-svn: 336606
* [AST] Rename some Redeclarable functions to reduce confusionFangrui Song2018-07-091-35/+31
| | | | | | | | | | Reviewers: rsmith, akyrtzi Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D48894 llvm-svn: 336605
* Added -fcrash-diagnostics-dir flagBob Haarman2018-07-093-5/+27
| | | | | | | | | | | | | | | | | | Summary: New flag causes crash reports to be written in the specified directory rather than the temp directory. Patch by Chijioke Kamanu. Reviewers: hans, inglorion, rnk Reviewed By: hans Subscribers: zturner, hiraditya, llvm-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D48601 llvm-svn: 336604
* [Power9] [CLANG] Add __float128 support for trunc to double round to oddStefan Pintilie2018-07-092-0/+6
| | | | | | | | | Add support for this builtin: double builtin_truncf128_round_to_odd(float128) Differential Revision: https://reviews.llvm.org/D48482 llvm-svn: 336596
* [OPENMP] Do not mark local variables as declare target.Alexey Bataev2018-07-092-2/+21
| | | | | | | | | When the parsing of the functions happens inside of the declare target region, we may erroneously mark local variables as declare target thought they are not. This attribute can be applied only to global variables. llvm-svn: 336592
* [libclang] NFC, simplify clang_Cursor_EvaluateAlex Lorenz2018-07-091-25/+24
| | | | | | | Take advantage of early returns as suggested by Duncan in https://reviews.llvm.org/D49051 llvm-svn: 336591
* [libclang] evalute compound statement cursors before trying to evaluateAlex Lorenz2018-07-092-13/+54
| | | | | | | | | | | | | | the cursor like a declaration This change fixes a bug in libclang in which it tries to evaluate a statement cursor as a declaration cursor, because that statement still has a pointer to the declaration parent. rdar://38888477 Differential Revision: https://reviews.llvm.org/D49051 llvm-svn: 336590
* [Index] Ignore noop #undef's when handling macro occurrences.Eric Liu2018-07-091-0/+2
| | | | llvm-svn: 336584
* [Builtins][Attributes][X86] Tag all X86 builtins with their required vector ↵Craig Topper2018-07-0953-4242/+4429
| | | | | | | | | | | | | | | | | | | | | | | | width. Add a min_vector_width function attribute and tag all x86 instrinsics with it This is part of an ongoing attempt at making 512 bit vectors illegal in the X86 backend type legalizer due to CPU frequency penalties associated with wide vectors on Skylake Server CPUs. We want the loop vectorizer to be able to emit IR containing wide vectors as intermediate operations in vectorized code and allow these wide vectors to be legalized to 256 bits by the X86 backend even though we are targetting a CPU that supports 512 bit vectors. This is similar to what happens with an AVX2 CPU, the vectorizer can emit wide vectors and the backend will split them. We want this splitting behavior, but still be able to use new Skylake instructions that work on 256-bit vectors and support things like masking and gather/scatter. Of course if the user uses explicit vector code in their source code we need to not split those operations. Especially if they have used any of the 512-bit vector intrinsics from immintrin.h. And we need to make it so that merely using the intrinsics produces the expected code in order to be backwards compatible. To support this goal, this patch adds a new IR function attribute "min-legal-vector-width" that can indicate the need for a minimum vector width to be legal in the backend. We need to ensure this attribute is set to the largest vector width needed by any intrinsics from immintrin.h that the function uses. The inliner will be reponsible for merging this attribute when a function is inlined. We may also need a way to limit inlining in the future as well, but we can discuss that in the future. To make things more complicated, there are two different ways intrinsics are implemented in immintrin.h. Either as an always_inline function containing calls to builtins(can be target specific or target independent) or vector extension code. Or as a macro wrapper around a taget specific builtin. I believe I've removed all cases where the macro was around a target independent builtin. To support the always_inline function case this patch adds attribute((min_vector_width(128))) that can be used to tag these functions with their vector width. All x86 intrinsic functions that operate on vectors have been tagged with this attribute. To support the macro case, all x86 specific builtins have also been tagged with the vector width that they require. Use of any builtin with this property will implicitly increase the min_vector_width of the function that calls it. I've done this as a new property in the attribute string for the builtin rather than basing it on the type string so that we can opt into it on a per builtin basis and avoid any impact to target independent builtins. There will be future work to support vectors passed as function arguments and supporting inline assembly. And whatever else we can find that isn't covered by this patch. Special thanks to Chandler who suggested this direction and reviewed a preview version of this patch. And thanks to Eric Christopher who has had many conversations with me about this issue. Differential Revision: https://reviews.llvm.org/D48617 llvm-svn: 336583
* [Power9] Add __float128 builtins for Round To OddStefan Pintilie2018-07-092-0/+53
| | | | | | | | | Add a number of builtins for __float128 Round To Odd. This is the Clang portion of the builtins work. Differential Revision: https://reviews.llvm.org/D47548 llvm-svn: 336579
* [OPENMP, NVPTX] Do not globalize local variables in parallel regions.Alexey Bataev2018-07-095-29/+33
| | | | | | | | | | In generic data-sharing mode we are allowed to not globalize local variables that escape their declaration context iff they are declared inside of the parallel region. We can do this because L2 parallel regions are executed sequentially and, thus, we do not need to put shared local variables in the global memory. llvm-svn: 336567
* [PCH] Add an option to not write comments into PCHIlya Biryukov2018-07-092-1/+9
| | | | | | | | | | | | | | | | | | Summary: Will be used in clangd, see the follow-up change. Clangd does not use comments read from PCH to avoid crashes due to changed contents of the file. However, reading them considerably slows down code completion on files with large preambles. Reviewers: sammccall Reviewed By: sammccall Subscribers: ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D48942 llvm-svn: 336539
* Try to fix build bot after r336524Eric Liu2018-07-091-1/+1
| | | | llvm-svn: 336532
* [Preamble] Check system dependencies in preamble tooIlya Biryukov2018-07-091-1/+11
| | | | | | | | | | | | | | | | | | | | | | Summary: PrecompiledPreamble hasn't checked if the system dependencies changed before. This resulted in invalid preamble not being rebuilt if headers that changed were found in -isystem include paths. This pattern is sometimes used to avoid showing warnings in third party code, so we want to correctly handle those cases. Tested in clangd, see the follow-up patch. Reviewers: sammccall, ioeric Reviewed By: sammccall Subscribers: omtcyfz, cfe-commits Differential Revision: https://reviews.llvm.org/D48946 llvm-svn: 336528
OpenPOWER on IntegriCloud