summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Factor out duplicated code and simplify.Richard Smith2017-01-041-132/+81
| | | | | | No functionality change intended. llvm-svn: 290996
* [Sema] Replace remove_if+erase with erase_if. NFC.George Burgess IV2017-01-042-7/+3
| | | | llvm-svn: 290991
* Reverting commit r290983 while debugging test failure on windows.Arpith Chacko Jacob2017-01-042-153/+162
| | | | llvm-svn: 290989
* [OpenMP] Update target codegen for NVPTX device.Arpith Chacko Jacob2017-01-042-162/+153
| | | | | | | | | | | | | | | | | This patch includes updates for codegen of the target region for the NVPTX device. It moves initializers from the compiler to the runtime and updates the worker loop to assume parallel work is retrieved from the runtime. A subsequent patch will update the codegen to retrieve the parallel work using calls to the runtime. It includes the removal of the inline attribute for the worker loop and disabling debug info in it. This allows codegen for a target directive and serial execution on the NVPTX device. Reviewers: ABataev Differential Revision: https://reviews.llvm.org/D28125 llvm-svn: 290983
* [CUDA] Pre-include sm_60 and sm_61 headers.Artem Belevich2017-01-041-0/+5
| | | | | | | | | CUDA-8.0 comes with new headers which nvcc pre-includes via cuda_runtime.h Clang now makes them available as well. Differential Revision: https://reviews.llvm.org/D28301 llvm-svn: 290982
* Accept and ignore -Wa,-mbig-obj on COFF targets for gas compatibilityReid Kleckner2017-01-041-0/+4
| | | | | | | | | LLVM's integrated assembler will automatically switch to big objects when there are more than 2**16 sections. Patch by Kyra! llvm-svn: 290979
* Add -f[no-]strict-return flag that can be used to avoid undefined behaviourAlex Lorenz2017-01-043-4/+27
| | | | | | | | | | | | | | | | | | | | | | | in non-void functions that fall off at the end without returning a value when compiling C++. Clang uses the new compiler flag to determine when it should treat control flow paths that fall off the end of a non-void function as unreachable. If -fno-strict-return is on, the code generator emits the ureachable and trap IR only when the function returns either a record type with a non-trivial destructor or another non-trivially copyable type. The primary goal of this flag is to avoid treating falling off the end of a non-void function as undefined behaviour. The burden of undefined behaviour is placed on the caller instead: if the caller ignores the returned value then the undefined behaviour is avoided. This kind of behaviour is useful in several cases, e.g. when compiling C code in C++ mode. rdar://13102603 Differential Revision: https://reviews.llvm.org/D27163 llvm-svn: 290960
* clang-format: [JS] avoid indent after ambient function declarations.Martin Probst2017-01-041-1/+4
| | | | | | | | | | | | | | | | | | | | | Summary: Before: declare function foo(); let x = 1; After: declare function foo(); let x = 1; The problem was that clang-format would unconditionally try to parse a child block, even though ambient function declarations do not have a body (similar to forward declarations). Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D28246 llvm-svn: 290959
* Fix deduction of pack elements after a braced-init-list.Richard Smith2017-01-041-6/+2
| | | | | | | | | | Previously, if the arguments for a parameter pack contained a braced-init-list, we would abort deduction (keeping the pack deductions from prior arguments) at the point when we reached the braced-init-list, resulting in wrong deductions and rejects-valids. We now just leave a "hole" in the pack for such an argument, which needs to be filled by another deduction of the same pack. llvm-svn: 290933
* Change clang-format's Chromium JavaScript defaultsNico Weber2017-01-041-0/+3
| | | | | | | | | | | | | | Chromium is starting to use clang-format on more JavaScript. In doing this, we discovered that our defaults were not doing a good job differentiating between JS and C++. This change moves some defaults to only apply to C++. https://reviews.llvm.org/D28165 Patch from Dan Beam <dbeam@chromium.org>! llvm-svn: 290930
* Fix template argument deduction when only some of a parameter pack is a ↵Richard Smith2017-01-041-36/+41
| | | | | | | | | | | | | | | | | non-deduced context. When a parameter pack has multiple corresponding arguments, and some subset of them are overloaded functions, it's possible that some subset of the parameters are non-deduced contexts. In such a case, keep deducing from the remainder of the arguments, and resolve the incomplete pack against whatever other deductions we've performed for the pack. GCC, MSVC, and ICC give three different bad behaviors for this case; what we do now (and what we did before) don't exactly match any of them, sadly :( I'm getting a core issue opened to specify more precisely how this should be handled. llvm-svn: 290923
* Extend -Wtautological-overlap-compare to more cases.Richard Trieu2017-01-041-3/+7
| | | | | | | | | | | Previously, -Wtautological-overlap-compare did not warn on cases where the boolean expression was in an assignment or return statement. This patch should cause all boolean statements to be passed to the tautological compare checks in the CFG analysis. This is one of the issues from PR13101 llvm-svn: 290920
* Add -plugin-opt=sample-profile for thinLTO build.Dehao Chen2017-01-041-0/+9
| | | | | | | | | | | | Summary: ThinLTO needs to pass down the sample profile file path to linker. Reviewers: tejohnson, davidxl, mehdi_amini Subscribers: bruno, cfe-commits Differential Revision: https://reviews.llvm.org/D27832 llvm-svn: 290919
* Re-add objectsize function/incomplete type checks.George Burgess IV2017-01-031-2/+8
| | | | | | | I accidentally omitted these when refactoring this code. This caused problems when building parts of the test-suite on MacOS. llvm-svn: 290916
* [Win64] Don't widen integer literal zero arguments to unprototyped function ↵Reid Kleckner2017-01-031-1/+1
| | | | | | | | | | | | | | | | | | | | | calls The special case to widen the integer literal zero when passed to variadic function calls should only apply to variadic functions, not unprototyped functions. This is consistent with what MSVC does. In this test case, MSVC uses a 4-byte store to pass the 5th argument to 'kr' and an 8-byte store to pass the zero to 'v': void v(int, ...); void kr(); void f(void) { v(1, 2, 3, 4, 0); kr(1, 2, 3, 4, 0); } Aaron Ballman discovered this issue in https://reviews.llvm.org/D28166 llvm-svn: 290906
* [OpenMP] Code cleanup for NVPTX OpenMP codegenArpith Chacko Jacob2017-01-032-65/+31
| | | | | | | | | | | This patch cleans up private methods for NVPTX OpenMP codegen. It converts private members to static functions to follow the coding style of CGOpenMPRuntime.cpp and declutter the header file. Reviewers: ABataev Differential Revision: https://reviews.llvm.org/D28124 llvm-svn: 290904
* [OPENMP] Private, firstprivate, and lastprivate clauses for distribute, host ↵Carlo Bertolli2017-01-031-0/+18
| | | | | | | | | | | | code generation https://reviews.llvm.org/D17840 This patch enables private, firstprivate, and lastprivate clauses for the OpenMP distribute directive. Regression tests differ from the similar case of the same clauses on the for directive, by removing a reference to two global variables g and g1. This is necessary because: 1. a distribute pragma is only allowed inside a target region; 2. referring a global variable (e.g. g and g1) in a target region requires the program to enclose the variable in a "declare target" region; 3. declare target pragmas, which are used to define a declare target region, are currently unavailable in clang (patch being prepared). For this reason, I moved the global declarations into local variables. llvm-svn: 290898
* [clang-tidy] Add check name to YAML exportAlexander Kornienko2017-01-032-0/+47
| | | | | | | | | | | | Add a field indicating the associated check for every replacement to the YAML report generated with the '-export-fixes' option. Update clang-apply-replacements to handle the new format. Patch by Alpha Abdoulaye! Differential revision: https://reviews.llvm.org/D26137 llvm-svn: 290892
* Handle StaticAssertDecl in DeclContextPrinterAlex Lorenz2017-01-031-0/+4
| | | | | | | | | | | This commit fixes a crash that occurs when -print-decl-contexts AST consumer tries to print an unhandled declaration. rdar://19467234 Differential Revision: https://reviews.llvm.org/D26964 llvm-svn: 290887
* Handle VarTemplateDecl in DeclContextPrinterAlex Lorenz2017-01-031-0/+4
| | | | | | | | | | | This commit fixes a crash that occurs when -print-decl-contexts AST consumer tries to print an unhandled declaration. rdar://19467234 Differential Revision: https://reviews.llvm.org/D26964 llvm-svn: 290886
* Handle AccessSpecDecl in DeclContextPrinterAlex Lorenz2017-01-031-0/+4
| | | | | | | | | | | This commit fixes a crash that occurs when -print-decl-contexts AST consumer tries to print an unhandled declaration. rdar://19467234 Differential Revision: https://reviews.llvm.org/D26964 llvm-svn: 290885
* Handle ClassTemplateSpecializationDecl in DeclContextPrinterAlex Lorenz2017-01-031-1/+22
| | | | | | | | | | | This commit fixes a crash that occurs when -print-decl-contexts AST consumer tries to print an unhandled declaration. rdar://19467234 Differential Revision: https://reviews.llvm.org/D26964 llvm-svn: 290884
* Handle EmptyDecl in DeclContextPrinterAlex Lorenz2017-01-031-0/+4
| | | | | | | | | | | This commit fixes a crash that occurs when -print-decl-contexts AST consumer tries to print an unhandled declaration. rdar://19467234 Differential Revision: https://reviews.llvm.org/D26964 llvm-svn: 290882
* Handle UsingDecl and UsingShadowDecl in DeclContextPrinterAlex Lorenz2017-01-031-0/+8
| | | | | | | | | | | This commit fixes a crash that occurs when -print-decl-contexts AST consumer tries to print an unhandled declaration. rdar://19467234 Differential Revision: https://reviews.llvm.org/D26964 llvm-svn: 290881
* Handle FriendDecl in DeclContextPrinterAlex Lorenz2017-01-031-0/+7
| | | | | | | | | | | This commit fixes a crash that occurs when -print-decl-contexts AST consumer tries to print an unhandled declaration. rdar://19467234 Differential Revision: https://reviews.llvm.org/D26964 llvm-svn: 290880
* [CodeCompletion] Autocomplete NS_DESIGNATED_INITIALIZER in initializersAlex Lorenz2017-01-031-0/+17
| | | | | | | | | | with arguments rdar://21014571 Differential Revision: https://reviews.llvm.org/D27039 llvm-svn: 290879
* [OpenMP] Sema and parsing for 'target teams distribute parallel for simd’ ↵Kelvin Li2017-01-0313-18/+216
| | | | | | | | | | pragma This patch is to implement sema and parsing for 'target teams distribute parallel for simd’ pragma. Differential Revision: https://reviews.llvm.org/D28202 llvm-svn: 290862
* Remove isIgnored()-test that is more expensive than the analysis behind itDaniel Jasper2017-01-021-12/+2
| | | | | | | | | | In many translation units I have tried, the calls to isIgnored() removed in this patch are more expensive than doing the analysis that is behind it. The speed-up in translation units I have tried is between 10 and 20%. Review: https://reviews.llvm.org/D28208 llvm-svn: 290842
* Revert "DR1391: Check for implicit conversion sequences for non-dependent ↵Renato Golin2017-01-022-208/+85
| | | | | | | | | | | | | | function template parameters between deduction and substitution. The idea is to accept as many cases as possible, on the basis that substitution failure outside the immediate context is much more common during substitution than during implicit conversion sequence formation." This reverts commit r290808, as it broken all ARM and AArch64 test-suite test: MultiSource/UnitTests/C++11/frame_layout Also, please, next time, try to write a commit message in according to our guidelines: http://llvm.org/docs/DeveloperPolicy.html#commit-messages llvm-svn: 290811
* DR1391: Check for implicit conversion sequences for non-dependent functionRichard Smith2017-01-022-85/+208
| | | | | | | | | | | | template parameters between deduction and substitution. The idea is to accept as many cases as possible, on the basis that substitution failure outside the immediate context is much more common during substitution than during implicit conversion sequence formation. This does not implement the partial ordering portion of DR1391, which so far appears to be misguided. llvm-svn: 290808
* Address post-commit review comments.Richard Smith2017-01-021-3/+0
| | | | llvm-svn: 290807
* CodeGen: update comment about RTTI fieldSaleem Abdulrasool2017-01-011-1/+1
| | | | | | | | | | The MS ABI RTTI has a reserved field which is used as a cache for the demangled name. It must be zero-initialized, which is used as a hint by the runtime to say that the cache has not been populated. Since this field is populated at runtime, the RTTI structures must be placed in the .data section rather than .rdata. NFC llvm-svn: 290799
* [c++17] Implement P0522R0 as written. This allows a template template argumentRichard Smith2016-12-314-10/+112
| | | | | | | | | | | | | | | | | | | to be specified for a template template parameter whenever the parameter is at least as specialized as the argument (when there's an obvious and correct mapping from uses of the parameter to uses of the argument). For example, a template with more parameters can be passed to a template template parameter with fewer, if those trailing parameters have default arguments. This is disabled by default, despite being a DR resolution, as it's fairly broken in its current state: there are no partial ordering rules to cope with template template parameters that have different parameter lists, meaning that code that attempts to decompose template-ids based on arity can hit unavoidable ambiguity issues. The diagnostics produced on a non-matching argument are also pretty bad right now, but I aim to improve them in a subsequent commit. llvm-svn: 290792
* Remove redundant assertion.Richard Smith2016-12-311-3/+0
| | | | llvm-svn: 290780
* Wdocumentation fixSimon Pilgrim2016-12-301-133/+133
| | | | llvm-svn: 290773
* CodeGen: use a StringSwitch instead of cascasding ifsSaleem Abdulrasool2016-12-301-15/+8
| | | | | | | Change the cascading ifs to a StringSwitch to simplify the conversion of the relocation model. NFC llvm-svn: 290762
* Allow lexer to handle string_view literals. Patch from Anton Bikineev.Eric Fiselier2016-12-303-4/+13
| | | | | | | This implements the compiler side of p0403r0. This patch was reviewed as https://reviews.llvm.org/D26829. llvm-svn: 290744
* Remove bogus assertion and add testcase that triggers it.Richard Smith2016-12-301-2/+4
| | | | llvm-svn: 290743
* [OpenMP] Sema and parsing for 'target teams distribute parallel for’ pragmaKelvin Li2016-12-2913-16/+215
| | | | | | | | This patch is to implement sema and parsing for 'target teams distribute parallel for’ pragma. Differential Revision: https://reviews.llvm.org/D28160 llvm-svn: 290725
* [ItaniumABI] NFC changesPiotr Padlewski2016-12-281-2/+3
| | | | llvm-svn: 290677
* [ThinLTO] No need to rediscover imports in distributed backendTeresa Johnson2016-12-281-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | Summary: We can simply import all external values with summaries included in the individual index file created for the distributed backend job, as only those are added to the individual index file created by the WriteIndexesThinBackend (in addition to summaries for the original module, which are skipped here). While computing the cross module imports on this index would come to the same conclusion as the original thin link import logic, it is unnecessary work. And when tuning, it avoids the need to pass the same function importing parameters (e.g. -import-instr-limit) to both the thin link and the backends (otherwise they won't make the same decisions). Reviewers: mehdi_amini, pcc Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28139 llvm-svn: 290674
* Fix format. NFCKelvin Li2016-12-281-5/+8
| | | | llvm-svn: 290673
* Revert "Driver: switch Windows to static RelocModel"Reid Kleckner2016-12-283-6/+27
| | | | | | | This reverts commit r290569. It caused unforeseen codegen changes for switch jump tables described in PR31488. llvm-svn: 290672
* [CodeGen] Unique constant CompoundLiterals.George Burgess IV2016-12-282-4/+32
| | | | | | | | | | | | | | | | | | | | Our newly aggressive constant folding logic makes it possible for CGExprConstant to see the same CompoundLiteralExpr more than once. So, emitting a new GlobalVariable every time we see a CompoundLiteral is no longer correct. We had a similar issue with BlockExprs that was caught while testing said aggressive folding, so I applied the same style of fix (see D26410) here. If we find yet another case where this needs to happen, we should probably refactor this so we don't have a third DenseMap+getter+setter. As a design note: getAddrOfConstantCompoundLiteralIfEmitted is really only intended to be called by ConstExprEmitter::EmitLValue. So, returning a GlobalVariable* instead of a ConstantAddress costs us effectively nothing, and saves us either a few bytes per entry in our map or a bit of code duplication. llvm-svn: 290661
* Mark 'auto' as dependent when instantiating the type of a non-type templateRichard Smith2016-12-283-29/+37
| | | | | | | parameter. Fixes failed deduction for 'auto' non-type template parameters nested within templates. llvm-svn: 290660
* DR1315: a non-type template argument in a partial specialization is permittedRichard Smith2016-12-282-107/+145
| | | | | | | | | | to make reference to template parameters. This is only a partial implementation; we retain the restriction that the argument must not be type-dependent, since it's unclear how that would work given the existence of other language rules requiring an exact type match in this context, even for type-dependent cases (a question has been raised on the core reflector). llvm-svn: 290647
* DebugInfo: Don't include size/alignment on class declarationsDavid Blaikie2016-12-271-6/+0
| | | | | | | | | | This seems like it must've been a leftover by accident - no tests were backing it up & it doesn't make much sense to include size/alignment on class declarations (it'd only be on those declarations for which the definition was available - otherwise the size/alignment would not be known). llvm-svn: 290631
* Add warning flag for "partial specialization is not more specialized than ↵Richard Smith2016-12-271-2/+2
| | | | | | primary template" error (since Eigen hits it), and while I'm here also add a warning flag for "partial specialization is not usable because one or more of its parameters cannot be deduced" warning. llvm-svn: 290625
* [DOXYGEN] Improved doxygen comments for xmmintrin.h intrinsics.Ekaterina Romanova2016-12-271-105/+171
| | | | | | | | Added \n commands to insert a line breaks where necessary, since one long line of documentation is nearly unreadable. Formatted comments to fit into 80 chars. In some cases added \a command in front of the parameter names to display them in italics. llvm-svn: 290619
* DR1495: A partial specialization is ill-formed if it is not (strictly) moreRichard Smith2016-12-273-16/+161
| | | | | | | | specialized than the primary template. (Put another way, if we imagine there were a partial specialization matching the primary template, we should never select it if some other partial specialization also matches.) llvm-svn: 290593
OpenPOWER on IntegriCloud