summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [OpenCL] Fixed address space cast in C style cast of C++ parsingAnastasia Stulova2018-10-101-14/+29
| | | | | | | | | | | C style cast in OpenCL C++ was ignoring the address space conversions from OpenCL C and as a result accepting incorrect code to compile. This commit adds special function for checking correctness of address spaces that is shared between C and C++ casts. llvm-svn: 344148
* [Hexagon] Use GetLinkerPath instead of hard-coded string.Sid Manning2018-10-102-3/+5
| | | | | | | | | | | Add GetLinkerPath and set the default to "hexagon-link". Use GetLinkerPath instead of the hard-coded string. This change will allow -fuse-ld to function correctly. Differential revision: https://reviews.llvm.org/D53038 llvm-svn: 344147
* [clang] Properly apply attributes on explicit instantiations of static data ↵Louis Dionne2018-10-101-4/+2
| | | | | | | | | | | | | | members Summary: https://llvm.org/PR39118 Reviewers: aaron.ballman, rnk Subscribers: dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D52675 llvm-svn: 344146
* Lift VFS from clang to llvm (NFC)Jonas Devlieghere2018-10-1035-2286/+156
| | | | | | | | | | | | | | | | | | | This patch moves the virtual file system form clang to llvm so it can be used by more projects. Concretely the patch: - Moves VirtualFileSystem.{h|cpp} from clang/Basic to llvm/Support. - Moves the corresponding unit test from clang to llvm. - Moves the vfs namespace from clang::vfs to llvm::vfs. - Formats the lines affected by this change, mostly this is the result of the added llvm namespace. RFC on the mailing list: http://lists.llvm.org/pipermail/llvm-dev/2018-October/126657.html Differential revision: https://reviews.llvm.org/D52783 llvm-svn: 344140
* [CodeComplete] Fix crash when completing params function declarations.Sam McCall2018-10-101-1/+2
| | | | | | | | | | | | | | | | | | Summary: In a decl like `int AA(BB cc)` where BB isn't defined, we end up trying to parse `BB cc` as an expression (vexing parse) and end up triggering the parser's "recovery-in-function" completion with no actual function scope. This patch avoids the assumption that such a scope exists in this context. Reviewers: kadircet Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53070 llvm-svn: 344133
* [MinGW] Fix passing a sanitizer lib name as dependent libMartin Storsjo2018-10-101-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D52990 llvm-svn: 344125
* [X86] Remove FeatureRTM from Skylake processor listCraig Topper2018-10-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There are a LOT of Skylakes and later without TSX-NI. Examples: - SKL: https://ark.intel.com/products/136863/Intel-Core-i3-8121U-Processor-4M-Cache-up-to-3-20-GHz- - KBL: https://ark.intel.com/products/97540/Intel-Core-i7-7560U-Processor-4M-Cache-up-to-3-80-GHz- - KBL-R: https://ark.intel.com/products/149091/Intel-Core-i7-8565U-Processor-8M-Cache-up-to-4-60-GHz- - CNL: https://ark.intel.com/products/136863/Intel-Core-i3-8121U-Processor-4M-Cache-up-to-3_20-GHz This feature seems to be present only on high-end desktop and server chips (I can't find any SKX without). This commit leaves it disabled for all processors, but can be re-enabled for specific builds with -mrtm. Matches https://reviews.llvm.org/D53041 Patch by Thiago Macieira Reviewers: erichkeane, craig.topper Reviewed By: craig.topper Subscribers: lebedev.ri, cfe-commits Differential Revision: https://reviews.llvm.org/D53042 llvm-svn: 344117
* ExprConstant: Make __builtin_object_size use EM_IgnoreSideEffects.James Y Knight2018-10-101-24/+7
| | | | | | | | | | | | | | | | | | | | | | | And, since EM_OffsetFold is now unused, remove it. While builtin_object_size intends to ignore the presence of side-effects in its argument, the EM_OffsetFold mode was NOT configured to ignore side-effects. Rather it was effectively identical to EM_ConstantFold -- its explanatory comment notwithstanding. However, currently, keepEvaluatingAfterSideEffect() is not always honored -- sometimes evaluation continues despite it returning false. Therefore, since the b_o_s code was only checking the return value from evaluation, and not additionally checking the HasSideEffects flag, side-effects _were_ in many cases actually being ignored. This change is a prerequisite cleanup towards fixing that issue. Differential Revision: https://reviews.llvm.org/D52924 llvm-svn: 344110
* clang: Allow ifunc resolvers to accept argumentsEd Maste2018-10-101-2/+0
| | | | | | | | | | | | | | | | | | When ifunc support was added to Clang (r265917) it did not allow resolvers to take function arguments. This was based on GCC's documentation, which states resolvers return a pointer and take no arguments. However, GCC actually allows resolvers to take arguments, and glibc (on non-x86 platforms) and FreeBSD (on x86 and arm64) pass some CPU identification information as arguments to ifunc resolvers. I believe GCC's documentation is simply incorrect / out-of-date. FreeBSD already removed the prohibition in their in-tree Clang copy. Differential Revision: https://reviews.llvm.org/D52703 llvm-svn: 344100
* [Driver][cc1][cc1as] Call OptTable::PrintHelp with explicit " [options] file..."Fangrui Song2018-10-102-2/+4
| | | | | | | | | | | | | | Summary: This is to accommodate a change in llvm/lib/Option/OptTable.cpp D51009 Reviewers: rupprecht, alexshap, jhenderson Reviewed By: rupprecht Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51109 llvm-svn: 344098
* PR39231: fix null dereference when diagnosing deduction failure due toRichard Smith2018-10-091-1/+1
| | | | | | conflicting values for a non-type pack. llvm-svn: 344070
* [CUDA][HIP] Fix ShouldDeleteSpecialMember for inherited constructorsYaxun Liu2018-10-091-2/+11
| | | | | | | | | | | | | | | | | | | | | ShouldDeleteSpecialMember is called upon inherited constructors. It calls inferCUDATargetForImplicitSpecialMember. Normally the special member enum passed to ShouldDeleteSpecialMember matches the constructor. However this is not true when inherited constructor is passed, where DefaultConstructor is passed to treat the inherited constructor as DefaultConstructor. However inferCUDATargetForImplicitSpecialMember expects the special member enum argument to match the constructor, which results in assertion when this expection is not satisfied. This patch checks whether the constructor is inherited. If true it will get the real special member enum for the constructor and pass it to inferCUDATargetForImplicitSpecialMember. Differential Revision: https://reviews.llvm.org/D51809 llvm-svn: 344057
* [OPENMP][NVPTX] Support memory coalescing for globalized variables.Alexey Bataev2018-10-092-39/+109
| | | | | | | | | Added support for memory coalescing for better performance for globalized variables. From now on all the globalized variables are represented as arrays of 32 elements and each thread accesses these elements using `tid & 31` as index. llvm-svn: 344049
* [ASTMatcher] Add missing imaginaryLiteralStephen Kelly2018-10-091-0/+1
| | | | llvm-svn: 344026
* [analyzer] Support Reinitializes attribute in MisusedMovedObject checkGabor Horvath2018-10-091-14/+10
| | | | | | Differential Revision: https://reviews.llvm.org/D52983 llvm-svn: 344017
* [Index] Use locations to uniquify function-scope BindingDecl USRFangrui Song2018-10-091-0/+7
| | | | | | | | | | | | | | | | | | | Summary: This makes BindingDecl's of the same name have different USRs, so that references can be correctly attributed. int a[1] = {}; { auto [x] = a; x; } { auto [x] = a; x; } Reviewers: akyrtzi, arphaman, rsmith, hokein Reviewed By: hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52445 llvm-svn: 344010
* Introduce code_model macrosAli Tamur2018-10-082-1/+7
| | | | | | | | | | | | | | | | | | | Summary: gcc defines macros such as __code_model_small_ based on the user passed command line flag -mcmodel. clang accepts a flag with the same name and similar effects, but does not generate any macro that the user can use. This cl narrows the gap between gcc and clang behaviour. However, achieving full compatibility with gcc is not trivial: The set of valid values for mcmodel in gcc and clang are not equal. Also, gcc defines different macros for different architectures. In this cl, we only tackle an easy part of the problem and define the macro only for x64 architecture. When the user does not specify a mcmodel, the macro for small code model is produced, as is the case with gcc. Reviewers: compnerd, MaskRay Reviewed By: MaskRay Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D52920 llvm-svn: 344000
* [coro]Pass rvalue reference for named local variable to return_valueBrian Gesiak2018-10-081-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Addressing https://bugs.llvm.org/show_bug.cgi?id=37265. Implements [class.copy]/33 of coroutines TS. When the criteria for elision of a copy/move operation are met, but not for an exception-declaration, and the object to be copied is designated by an lvalue, or when the expression in a return or co_return statement is a (possibly parenthesized) id-expression that names an object with automatic storage duration declared in the body or parameter-declaration-clause of the innermost enclosing function or lambda-expression, overload resolution to select the constructor for the copy or the return_value overload to call is first performed as if the object were designated by an rvalue. Patch by Tanoy Sinha! Reviewers: modocache, GorNishanov Reviewed By: modocache, GorNishanov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51741 llvm-svn: 343949
* Thread safety analysis: Handle conditional expression in getTrylockCallExprAaron Puchert2018-10-061-1/+13
| | | | | | | | | | | | | | | | | | | | | Summary: We unwrap conditional expressions containing try-lock functions. Additionally we don't acquire on conditional expression branches, since that is usually not helpful. When joining the branches we would almost certainly get a warning then. Hopefully fixes an issue that was raised in D52398. Reviewers: aaron.ballman, delesley, hokein Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52888 llvm-svn: 343902
* [COFF, ARM64] Add _InterlockedAdd intrinsicMandeep Singh Grang2018-10-052-0/+10
| | | | | | | | | | | | Reviewers: rnk, mstorsjo, compnerd, TomTan, haripul, javed.absar, efriedma Reviewed By: efriedma Subscribers: efriedma, kristof.beyls, chrib, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D52811 llvm-svn: 343894
* Emit CK_NoOp casts in C mode, not just C++.James Y Knight2018-10-052-6/+9
| | | | | | | | | | | | Previously, it had been using CK_BitCast even for casts that only change const/restrict/volatile. Now it will use CK_Noop where appropriate. This is an alternate solution to r336746. Differential Revision: https://reviews.llvm.org/D52918 llvm-svn: 343892
* [DebugInfo] Add support for DWARF5 call site-related attributesVedant Kumar2018-10-052-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DWARF v5 introduces DW_AT_call_all_calls, a subprogram attribute which indicates that all calls (both regular and tail) within the subprogram have call site entries. The information within these call site entries can be used by a debugger to populate backtraces with synthetic tail call frames. Tail calling frames go missing in backtraces because the frame of the caller is reused by the callee. Call site entries allow a debugger to reconstruct a sequence of (tail) calls which led from one function to another. This improves backtrace quality. There are limitations: tail recursion isn't handled, variables within synthetic frames may not survive to be inspected, etc. This approach is not novel, see: https://gcc.gnu.org/wiki/summit2010?action=AttachFile&do=get&target=jelinek.pdf This patch adds an IR-level flag (DIFlagAllCallsDescribed) which lowers to DW_AT_call_all_calls. It adds the minimal amount of DWARF generation support needed to emit standards-compliant call site entries. For easier deployment, when the debugger tuning is LLDB, the DWARF requirement is adjusted to v4. Testing: Apart from check-{llvm, clang}, I built a stage2 RelWithDebInfo clang binary. Its dSYM passed verification and grew by 1.4% compared to the baseline. 151,879 call site entries were added. rdar://42001377 Differential Revision: https://reviews.llvm.org/D49887 llvm-svn: 343883
* [COFF, ARM64] Add _InterlockedCompareExchangePointer_nf intrinsicMandeep Singh Grang2018-10-051-5/+8
| | | | | | | | | | | | Reviewers: rnk, mstorsjo, compnerd, TomTan, haripul, efriedma Reviewed By: efriedma Subscribers: efriedma, kristof.beyls, chrib, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D52807 llvm-svn: 343881
* [CUDA] Use all 64 bits of GUID in __nv_module_idArtem Belevich2018-10-051-1/+1
| | | | | | | | | getGUID() returns an uint64_t and "%x" only prints 32 bits of it. Use PRIx64 format string to print all 64 bits. Differential Revision: https://reviews.llvm.org/D52938 llvm-svn: 343875
* clang-format: Don't insert spaces in front of :: for Java 8 Method References.Nico Weber2018-10-051-1/+7
| | | | | | | | | | | | | The existing code kept the space if it was there for identifiers, and it didn't handle `this`. After this patch, for Java `this` is handled in addition to identifiers, and existing space is always stripped between identifier and `::`. Also accept `::` in addition to `.` in front of `<` in `foo::<T>bar` generic calls. Differential Revision: https://reviews.llvm.org/D52842 llvm-svn: 343872
* Emit diagnostic note when calling an invalid function declaration.James Y Knight2018-10-051-3/+6
| | | | | | | | | | | | | | The comment said it was intentionally not emitting any diagnostic because the declaration itself was already diagnosed. However, everywhere else that wants to not emit a diagnostic without an extra note emits note_invalid_subexpr_in_const_expr instead, which gets suppressed later. This was the only place which did not emit a diagnostic note. Differential Revision: https://reviews.llvm.org/D52919 llvm-svn: 343867
* [clang-format] Java import sorting in clang-formatKrasimir Georgiev2018-10-051-4/+173
| | | | | | Contributed by SamMaier! llvm-svn: 343862
* [OPENMP][NVPTX] Fix emission of __kmpc_global_thread_num() for non-SPMDAlexey Bataev2018-10-051-4/+7
| | | | | | | | | mode. __kmpc_global_thread_num() should be called before initialization of the runtime. llvm-svn: 343857
* [OPENMP] Fix emission of the __kmpc_global_thread_num.Alexey Bataev2018-10-053-4/+44
| | | | | | | | | Fixed emission of the __kmpc_global_thread_num() so that it is not messed up with alloca instructions anymore. Plus, fixes emission of the __kmpc_global_thread_num() functions in the target outlined regions so that they are not called before runtime is initialized. llvm-svn: 343856
* Fix llvm-clang-x86_64-expensive-checks-win build by setting bigobj flag.Simon Pilgrim2018-10-051-0/+1
| | | | llvm-svn: 343846
* [WebAssembly] abs and sqrt builtinsThomas Lively2018-10-051-0/+12
| | | | | | | | | | | | Summary: Depends on D52910. Reviewers: aheejin, dschuff, craig.topper Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D52913 llvm-svn: 343838
* [WebAssembly] any_true and all_true builtinsThomas Lively2018-10-051-0/+29
| | | | | | | | | | | | Summary: Depends on D52858. Reviewers: aheejin, dschuff, craig.topper Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D52910 llvm-svn: 343837
* [WebAssembly] saturating arithmetic builtinsThomas Lively2018-10-051-0/+34
| | | | | | | | | | | | Summary: Depends on D52856. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D52858 llvm-svn: 343836
* [WebAssembly] __builtin_wasm_replace_lane_* builtinsThomas Lively2018-10-051-0/+28
| | | | | | | | | | | | Summary: Depends on D52852. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D52856 llvm-svn: 343835
* [WebAssembly] __builtin_wasm_extract_lane_* builtinsThomas Lively2018-10-051-0/+30
| | | | | | | | | | Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D52852 llvm-svn: 343834
* Thread safety analysis: Examine constructor argumentsAaron Puchert2018-10-041-51/+49
| | | | | | | | | | | | | | | | | | | | Summary: Instead of only examining call arguments, we also examine constructor arguments applying the same rules. That was an opportunity for refactoring the examination procedure to work with iterators instead of integer indices. For the case of CallExprs no functional change is intended. Reviewers: aaron.ballman, delesley Reviewed By: delesley Subscribers: JonasToth, cfe-commits Differential Revision: https://reviews.llvm.org/D52443 llvm-svn: 343831
* [COFF, ARM64] Add __getReg intrinsicMandeep Singh Grang2018-10-043-0/+27
| | | | | | | | | | | | Reviewers: rnk, mstorsjo, compnerd, TomTan, haripul, javed.absar, efriedma Reviewed By: efriedma Subscribers: peter.smith, efriedma, kristof.beyls, chrib, cfe-commits Differential Revision: https://reviews.llvm.org/D52838 llvm-svn: 343824
* [AST] Revert mangling changes from r339428Shoaib Meenai2018-10-041-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in https://reviews.llvm.org/D50144, we want Obj-C classes to have the same mangling as C++ structs, to support headers like the following: ``` @class I; struct I; void f(I *); ``` since the header can be used from both C++ and Obj-C++ TUs, and we want a consistent mangling across the two to prevent link errors. Itanium mangles both the same way, and so should the MS ABI. The main concern with having the same mangling for C++ structs and Obj-C classes was that we want to treat them differently for the purposes of exception handling, e.g. we don't want a C++ catch statement for a struct to be able to catch an Obj-C class with the same name as the struct. We can accomplish this by mangling Obj-C class names differently in their RTTI, which I'll do in a follow-up patch. Differential Revision: https://reviews.llvm.org/D52581 llvm-svn: 343808
* [NestedNameSpecifier] Add missing stream-specific dump methodsStephen Kelly2018-10-041-4/+11
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52870 llvm-svn: 343807
* [clang] Add the exclude_from_explicit_instantiation attributeLouis Dionne2018-10-043-6/+21
| | | | | | | | | | | | | | | | | | | | | | Summary: This attribute allows excluding a member of a class template from being part of an explicit template instantiation of that class template. This also makes sure that code using such a member will not take for granted that an external instantiation exists in another translation unit. The attribute was discussed on cfe-dev at [1] and is primarily motivated by the removal of always_inline in libc++ to control what's part of the ABI (see links in [1]). [1]: http://lists.llvm.org/pipermail/cfe-dev/2018-August/059024.html rdar://problem/43428125 Reviewers: rsmith Subscribers: dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D51789 llvm-svn: 343790
* [Index] Respect "IndexFunctionLocals" option for type loc.Haojian Wu2018-10-041-1/+2
| | | | | | | | | | | | | | | | Summary: Previously, clang index ignored local symbols defined in the function body even IndexFunctionLocals is true. Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, ioeric, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52877 llvm-svn: 343767
* [constexpr] Fix ICE when memcpy() is given a pointer to an incomplete arrayPetr Pavlu2018-10-041-0/+4
| | | | | | | | | | Fix code for constant evaluation of __builtin_memcpy() and __builtin_memmove() that would attempt to divide by zero when given two pointers to an incomplete array. Differential Revision: https://reviews.llvm.org/D51855 llvm-svn: 343761
* [AArch64][ARM] Context sensitive meaning of cryptoSjoerd Meijer2018-10-042-0/+101
| | | | | | | | | | | | | | For AArch64, crypto means: - sm4 + sha3 + sha2 + aes for Armv8.4-A and up, and - sha2 + aes for Armv8.3-A and earlier. For AArch32: Crypto means sha2 + aes, because the Armv8.2-A crypto instructions were added to AArch64 only. Differential Revision: https://reviews.llvm.org/D50179 llvm-svn: 343758
* [SEMA] split ExtWarn dupl-decl-spec's into Extension and ExtWarnNick Desaulniers2018-10-032-3/+4
| | | | | | | | | | | | | | | | | | | | | | | Summary: For types deduced from typedef's and typeof's, don't warn for duplicate declaration specifiers in C90 unless -pedantic. Create a third diagnostic type for duplicate declaration specifiers. Previously, we had an ExtWarn and a Warning. This change adds a third, Extension, which only warns when -pedantic is set, staying silent otherwise. Fixes PR32985. Reviewers: rsmith Reviewed By: rsmith Subscribers: srhines, cfe-commits Differential Revision: https://reviews.llvm.org/D52849 llvm-svn: 343740
* [analyzer] Do not crash if the assumption added in TrustNonNullChecker is ↵George Karpenkov2018-10-031-8/+14
| | | | | | | | | | enough to make the state unfeasible rdar://43541814 Differential Revision: https://reviews.llvm.org/D52848 llvm-svn: 343735
* Add matchers missing from dynamic AST registryStephen Kelly2018-10-031-0/+7
| | | | llvm-svn: 343717
* Sort list of matchersStephen Kelly2018-10-031-14/+14
| | | | llvm-svn: 343716
* [OPENMP] Add reverse_offload clause to requires directivePatrick Lyster2018-10-0310-0/+39
| | | | llvm-svn: 343711
* Add template type and value parameter metadata nodes to template variable ↵Matthew Voss2018-10-032-6/+59
| | | | | | | | | | | | | | | | | | specializations Summary: Add an optional attribute referring to a tuple of type and value template parameter nodes to the DIGlobalVariable node. This allows us to record the parameters of template variable specializations. Reviewers: dblaikie, aprantl, probinson, JDevlieghere, clayborg, jingham Reviewed By: JDevlieghere Subscribers: cfe-commits Tags: #debug-info Differential Revision: https://reviews.llvm.org/D52058 llvm-svn: 343707
* [COFF, ARM64] Add _ReadWriteBarrier intrinsicMandeep Singh Grang2018-10-031-0/+4
| | | | | | | | | | | | Reviewers: rnk, mstorsjo, compnerd, TomTan, haripul, javed.absar Reviewed By: rnk Subscribers: kristof.beyls, chrib, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D52809 llvm-svn: 343699
OpenPOWER on IntegriCloud