summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [OPENMP][NVPTX]Reduce memory usage in target region.Alexey Bataev2018-10-122-12/+20
| | | | | | | Additional reduction of the global memory usage in the target regions without parallel regions. llvm-svn: 344413
* [MinGW] Allow using LTO when lld is used as linkerMartin Storsjo2018-10-122-0/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D53195 llvm-svn: 344412
* [clang-format] Fix BraceWrapping AfterFunction for ObjC methodsBen Hamilton2018-10-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: > clang-format --version > clang-format version 7.0.0 (tags/RELEASE_700/final) > echo "@implementation Foo\n- (void)foo:(id)bar\n{\n}\n@end\n" |clang-format -style='{BreakBeforeBraces: Custom, BraceWrapping: {AfterFunction: true}}' ``` @implementation Foo - (void)foo:(id)bar { } @end ``` with patch: > bin/clang-format --version > clang-format version 8.0.0 (trunk 344285) > echo "@implementation Foo\n- (void)foo:(id)bar\n{\n}\n@end\n" |bin/clang-format -style='{BreakBeforeBraces: Custom, BraceWrapping: {AfterFunction: true}}' ``` @implementation Foo - (void)foo:(id)bar { } @end ``` Contributed by hultman@. Reviewers: benhamilton, jolesiak, klimek, Wizard Reviewed By: benhamilton Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53197 llvm-svn: 344406
* Consistently make llvm::opt::ArgStringList usage explicit to try and appease ↵Simon Pilgrim2018-10-122-7/+7
| | | | | | MSVC 2015 buildbots. NFCI. llvm-svn: 344398
* Revert r344375 "[Driver] check for exit code from SIGPIPE"Reid Kleckner2018-10-121-16/+7
| | | | | | This doesn't build on Windows. llvm-svn: 344389
* [Driver] check for exit code from SIGPIPENick Desaulniers2018-10-121-7/+16
| | | | | | | | | | | | | | | | | | | | Summary: D53000 adds a special exit code for SIGPIPE (writing to a closed reader), and rather than print a fatal warning, skips printing the error. This can be seen commonly from piping into head, tee, or split. Fixes PR25349, rdar://problem/14285346, b/77310947. Reviewers: jfb Reviewed By: jfb Subscribers: cfe-commits, thakis, srhines Differential Revision: https://reviews.llvm.org/D53001 llvm-svn: 344375
* [CodeGen] Handle extern references to OBJC_CLASS_$_*Erik Pilkington2018-10-121-6/+12
| | | | | | | | | | | | | | | | | | | | | | Some ObjC users declare a extern variable named OBJC_CLASS_$_Foo, then use it's address as a Class. I.e., one could define isInstanceOfF: BOOL isInstanceOfF(id c) { extern void OBJC_CLASS_$_F; return [c class] == (Class)&OBJC_CLASS_$_F; } This leads to asserts in clang CodeGen if there is an @implementation of F in the same TU as an instance of this pattern, because CodeGen assumes that a variable named OBJC_CLASS_$_* has the right type. This commit fixes the problem by RAUWing the old (incorrectly typed) global with a new global, then removing the old global. rdar://45077269 Differential revision: https://reviews.llvm.org/D53154 llvm-svn: 344373
* [Driver] Add defaults for Android ARM FPUs.Dan Albert2018-10-121-0/+7
| | | | | | | | | | | | | | | | | Summary: Android mandates that devices have at least vfpv3-d16 until Marshmallow and NEON after that. Still honor the user's decision, but raise the defaults for Android targets. Reviewers: srhines, pirama, javed.absar, kristof.beyls, peter.smith Reviewed By: peter.smith Subscribers: peter.smith, rengolin, kristof.beyls, chrib, cfe-commits Differential Revision: https://reviews.llvm.org/D53121 llvm-svn: 344367
* [OPENMP][NVPTX]Reduce memory usage in orphaned functions.Alexey Bataev2018-10-122-9/+74
| | | | | | | | | | | | if the function has globalized variables and called in context of target/teams/distribute regions, it does not need to globalize 32 copies of the same variables for memory coalescing, it is enough to have just one copy, because there is parallel region. Patch does this by adding call for `__kmpc_parallel_level` function and checking its return value. If the code sees that the parallel level is 0, then only one variable is allocated, not 32. llvm-svn: 344356
* Fix MSVC 2015 ambiguous symbol warning introduced by rL344337. NFCI.Simon Pilgrim2018-10-121-1/+1
| | | | llvm-svn: 344352
* Remove top-level using declaration from header files, as these aliases leak.Sam McCall2018-10-122-3/+1
| | | | | | | | | | Reviewers: ilya-biryukov Subscribers: arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D53135 llvm-svn: 344337
* [Tooling] Expose ExecutorName option.Eric Liu2018-10-121-1/+1
| | | | llvm-svn: 344335
* [analyzer] Fix a bug in unexplored_first_location_queue iteration order.George Karpenkov2018-10-121-2/+2
| | | | | | Pointed out by Artem in post-commit review for https://reviews.llvm.org/D53058 llvm-svn: 344322
* [analyzer] Experiment with an iteration order only based on location, and ↵George Karpenkov2018-10-113-2/+67
| | | | | | | | not using the stack frame Differential Revision: https://reviews.llvm.org/D53058 llvm-svn: 344313
* [analyzer] Avoid unneeded invalidation in RetainCountCheckerGeorge Karpenkov2018-10-111-19/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D53168 llvm-svn: 344312
* [analyzer] Retain count checker for OSObject: recognize OSDynamicCastGeorge Karpenkov2018-10-111-1/+12
| | | | | | | | | | | For now, tresting the cast as a no-op, and disregarding the case where the output becomes null due to the type mismatch. rdar://45174557 Differential Revision: https://reviews.llvm.org/D53156 llvm-svn: 344311
* Revert "[Driver] Default Android toolchains to libc++."Dan Albert2018-10-112-7/+0
| | | | | | | | | Breaks some of the Android bots because they aren't expecting to need to explicitly set -stdlib. This reverts commit 031072f5048654b01a40f639633de1ff4e2f3dc8. llvm-svn: 344297
* [Driver] Default Android toolchains to libc++.Dan Albert2018-10-112-0/+7
| | | | | | | | | | | | Reviewers: srhines, pirama, EricWF Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53109 llvm-svn: 344296
* [Driver] Default to `-z now` and `-z relro` on Android.Dan Albert2018-10-111-2/+3
| | | | | | | | | | | | | | | | | | Summary: RTLD_LAZY is not supported on Android (though failing to use `-z now` will work since it is assumed by the loader). RelRO is required. Reviewers: srhines, pirama Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53117 llvm-svn: 344295
* [Driver] Fix --hash-style choice for Android.Dan Albert2018-10-111-5/+8
| | | | | | | | | | | | | | | | | Summary: Android supports GNU style hashes as of Marshmallow, so we should be generating both styles for pre-M targets and GNU hashes for newer targets. Reviewers: srhines, pirama Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53118 llvm-svn: 344293
* [HIP] Replace irif library with hip.amdgcn.bcAaron Enye Shi2018-10-111-2/+2
| | | | | | No longer use irif amdgcn library, instead we will use the previous fence functions from new hip.amdgcn.bc bitcode library. Update hip-device-libs.hip test as well. llvm-svn: 344281
* Revert "clang-cl: Add /showFilenames option (PR31957)"Sean Fertile2018-10-112-13/+0
| | | | | | | This reverts https://reviews.llvm.org/rL344234 which is causing failures on several bots due to invalid llvm.linker.options. llvm-svn: 344276
* [OPENMP][NVPTX]Reduce memory use for globalized vars inAlexey Bataev2018-10-111-7/+15
| | | | | | | | | | | target/teams/distribute regions. Previously introduced globalization scheme that uses memory coalescing scheme may increase memory usage fr the variables that are devlared in target/teams/distribute contexts. We don't need 32 copies of such variables, just 1. Patch reduces memory use in this case. llvm-svn: 344273
* Revert "[Lex] TokenConcatenation now takes const Preprocessor"Eric Liu2018-10-111-3/+3
| | | | | | This reverts commit r344262. This was an unintentional commit. llvm-svn: 344267
* [Lex] TokenConcatenation now takes const PreprocessorEric Liu2018-10-111-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D52502 llvm-svn: 344262
* Improve -Wshadow warnings with enumerators.Aaron Ballman2018-10-111-2/+9
| | | | | | | | | | | Addresses PR24718 by checking for enumerators that shadow other enumerators. Catches issues like: enum E1{e1}; void f(void) { enum E2{e1}; } llvm-svn: 344259
* Some improvements to the OpenBSD driver.Brad Smith2018-10-112-34/+38
| | | | | | | | - OpenBSD has switched to compiler_rt / libcxx - Fix sysroot and lib path handling - Some cleaning up llvm-svn: 344257
* Add support for 'dynamic_allocators' clause on 'requires' directive. ↵Patrick Lyster2018-10-1110-0/+45
| | | | | | Differential Revision: https://reviews.llvm.org/D53079 llvm-svn: 344249
* [Sema][OpenCL] Improve diagnostics for not viable overloadable function ↵Andrew Savonichev2018-10-112-1/+30
| | | | | | | | | | | | | | | | | | | candidates Summary: Allowed extension name (that ought to be disabled) printing in the note message. This diagnostic was proposed here: https://reviews.llvm.org/D51341 Reviewers: Anastasia, yaxunl Reviewed By: Anastasia Subscribers: cfe-commits, asavonic, bader Differential Revision: https://reviews.llvm.org/D52292 llvm-svn: 344246
* [analyzer][UninitializedObjectChecker] Reports Loc fields pointing to themselvesKristof Umann2018-10-111-19/+49
| | | | | | | | | | | I've added a new functionality, the checker is now able to detect and report fields pointing to themselves. I figured this would fit well into the checker as there's no reason for a pointer to point to itself instead of being nullptr. Differential Revision: https://reviews.llvm.org/D51305 llvm-svn: 344242
* clang-cl: Add /showFilenames option (PR31957)Hans Wennborg2018-10-112-0/+13
| | | | | | | | | | | Add a /showFilenames option for users who want clang to echo the currently compiled filename. MSVC does this echoing by default, and it's useful for showing progress in build systems that doesn't otherwise provide any progress report, such as MSBuild. Differential Revision: https://reviews.llvm.org/D52773 llvm-svn: 344234
* [clang][ubsan] Split Implicit Integer Truncation Sanitizer into unsigned and ↵Roman Lebedev2018-10-111-7/+27
| | | | | | | | | | | | | | | | | | | | signed checks Summary: As per IRC disscussion, it seems we really want to have more fine-grained `-fsanitize=implicit-integer-truncation`: * A check when both of the types are unsigned. * Another check for the other cases (either one of the types is signed, or both of the types is signed). This is clang part. Compiler-rt part is D50902. Reviewers: rsmith, vsk, Sanitizers Reviewed by: rsmith Differential Revision: https://reviews.llvm.org/D50901 llvm-svn: 344230
* [WebAssembly] Saturating float-to-int builtinsThomas Lively2018-10-111-0/+24
| | | | | | | | | | | | Summary: Depends on D53007 and D53004. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D53009 llvm-svn: 344205
* Add a flag to remap manglings when reading profile data information.Richard Smith2018-10-104-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | This can be used to preserve profiling information across codebase changes that have widespread impact on mangled names, but across which most profiling data should still be usable. For example, when switching from libstdc++ to libc++, or from the old libstdc++ ABI to the new ABI, or even from a 32-bit to a 64-bit build. The user can provide a remapping file specifying parts of mangled names that should be treated as equivalent (eg, std::__1 should be treated as equivalent to std::__cxx11), and profile data will be treated as applying to a particular function if its name is equivalent to the name of a function in the profile data under the provided equivalences. See the documentation change for a description of how this is configured. Remapping is supported for both sample-based profiling and instruction profiling. We do not support remapping indirect branch target information, but all other profile data should be remapped appropriately. Support is only added for the new pass manager. If someone wants to also add support for this for the old pass manager, doing so should be straightforward. llvm-svn: 344199
* [AST] Use -fvisibility value when ignoring -fv-i-h* inline static localsReid Kleckner2018-10-101-7/+17
| | | | | | | | | | | | | | | | | | | | | | Summary: In r340386 we added code to give static locals in inline functions default visibility. Instead, we should use the "default" visibility passed on the command line, which could be hidden or protected, as GCC does. Some code bases use both -fvisibility=hidden and -fvisibility-inlines-hidden to hide inline functions of classes that are explicitly marked with default visibility. Fixes PR39236 Reviewers: hans, thakis Subscribers: eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D53052 llvm-svn: 344190
* [Sema] Fix a multiple definition bug with friends and templatesErik Pilkington2018-10-102-2/+44
| | | | | | | | | | | | | | The problem was that MergeFunctionDecl sometimes needs the injected template arguments of a FunctionTemplateDecl, but is called before adding the new template to the redecl chain. This leads to multiple common pointers in the same redecl chain, each with their own identical instantiation. Fix this by merging the the common state before inserting the new template into the redecl chain. rdar://44810129 Differential revision: https://reviews.llvm.org/D53046 llvm-svn: 344157
* [CodeGenCXX] Treat 'this' as noalias in constructorsAnton Bikineev2018-10-101-0/+16
| | | | | | | | | This is currently a clang extension and a resolution of the defect report in the C++ Standard. Differential Revision: https://reviews.llvm.org/D46441 llvm-svn: 344150
* [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
OpenPOWER on IntegriCloud