summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [Sema] Fix crash in getConstructorName.Ilya Biryukov2018-07-042-0/+13
| | | | | | | | | | | | | | | | Summary: Can happen when getConstructorName is called on invalid decls, specifically the ones that do not have the injected class name. Reviewers: bkramer, rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D48880 llvm-svn: 336244
* NFC - typo fix in test/CodeGen/avx512f-builtins.cGabor Buella2018-07-041-2/+2
| | | | llvm-svn: 336243
* PR33924: merge local declarations that have linkage of some kind withinRichard Smith2018-07-049-26/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | merged function definitions; also merge functions with deduced return types. This seems like two independent fixes, but unfortunately they are hard to separate because it's challenging to reliably test either one of them without also testing the other. A complication arises with deduced return type support: we need the type of the function in order to know how to merge it, but we can't load the actual type of the function because it might reference an entity declared within the function (and we need to have already merged the function to correctly merge that entity, which we would need to do to determine if the function types match). So we instead compare the declared function type when merging functions, and defer loading the actual type of a function with a deduced type until we've finished loading and merging the function. This reverts r336175, reinstating r336021, with one change (for PR38015): we look at the TypeSourceInfo of the first-so-far declaration of each function when considering whether to merge two functions. This works around a problem where the calling convention in the TypeSourceInfo for subsequent redeclarations may not match if it was implicitly adjusted. llvm-svn: 336240
* [Sema] Consider all format_arg attributes.Michael Kruse2018-07-042-6/+32
| | | | | | | | | | | | | | | | If a function has multiple format_arg attributes, clang only considers the first it finds (because AttributeLists are in reverse order, not necessarily the textually first) and ignores all others. Loop over all FormatArgAttr to print warnings for all declared format_arg attributes. For instance, libintl's ngettext (select plural or singular version of format string) has two __format_arg__ attributes. Differential Revision: https://reviews.llvm.org/D48734 llvm-svn: 336239
* [Sema] Discarded statment should be an evaluatable context.Erik Pilkington2018-07-032-1/+14
| | | | | | | | | | The constexpr evaluator was erroring out because these templates weren't defined. Despite being used in a discarded statement, we still need to constexpr evaluate them, which means that we need to instantiate them. Fixes PR37585. Differential revision: https://reviews.llvm.org/D48322 llvm-svn: 336233
* Factor out Clang's desired 8MB stack size constant from the variousRichard Smith2018-07-035-20/+40
| | | | | | places we hardcode it. llvm-svn: 336231
* Fix allocation of Nullability attribute.Erich Keane2018-07-031-9/+7
| | | | | | | | | | | Existing code always allocates for on the declarator's attribute pool, but sometimes adds it to the declspec. This patch ensures that the correct pool is used. Discovered while testing: https://reviews.llvm.org/D48788 llvm-svn: 336225
* Fix crash in clang.Zachary Turner2018-07-031-1/+3
| | | | | | | | | | This happened during a recent refactor. toStringRefArray() returns a vector<StringRef>, which was being implicitly converted to an ArrayRef<StringRef>, and then the vector was immediately being destroyed, so the ArrayRef<> was losing its backing storage. Fix this by making sure the vector gets permanent storage. llvm-svn: 336219
* [Driver] Add PPC64 as supported for ScudoKostya Kortchinsky2018-07-032-1/+4
| | | | | | | | | | | | | | | | | | Summary: Scudo works on PPC64 as is, so mark the architecture as supported for it. This will also require a change to config-ix.cmake on the compiler-rt side. Update the tests accordingly. Reviewers: eugenis, alekseyshl Reviewed By: alekseyshl Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D48833 llvm-svn: 336202
* Revert r336021 "PR33924: merge local declarations that have linkage of some ↵Hans Wennborg2018-07-036-203/+26
| | | | | | | | | | | | | | | | | | | | | | | | | kind within" This caused test failures in 32-bit builds (PR38015). > merged function definitions; also merge functions with deduced return > types. > > This seems like two independent fixes, but unfortunately they are hard > to separate because it's challenging to reliably test either one of them > without also testing the other. > > A complication arises with deduced return type support: we need the type > of the function in order to know how to merge it, but we can't load the > actual type of the function because it might reference an entity > declared within the function (and we need to have already merged the > function to correctly merge that entity, which we would need to do to > determine if the function types match). So we instead compare the > declared function type when merging functions, and defer loading the > actual type of a function with a deduced type until we've finished > loading and merging the function. llvm-svn: 336175
* [Driver][Darwin] Use Host Triple to infer target os versionSteven Wu2018-07-033-4/+10
| | | | | | | | | | | | | | | | | | | | Summary: When clang required to infer target os version from --target option and the os version is not specified in targets, check the host triple. If the host and target are both macOS, use host triple to infer target os version. rdar://problem/41651999 Reviewers: arphaman, dexonsmith Reviewed By: arphaman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D48849 llvm-svn: 336168
* Per C++ [over.match.copy]p1, direct-initialization of a reference canRichard Smith2018-07-022-4/+15
| | | | | | only invoke converting constructors of the reference's underlying type. llvm-svn: 336153
* [CodeGenCXX] Emit strip.invariant.group with -fstrict-vtable-pointersPiotr Padlewski2018-07-026-20/+376
| | | | | | | | | | | | | | | Summary: Emmiting new intrinsic that strips invariant.groups to make devirtulization sound, as described in RFC: Devirtualization v2. Reviewers: rjmccall, rsmith, amharc, kuhar Subscribers: llvm-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D47299 Co-authored-by: Krzysztof Pszeniczny <krzysztof.pszeniczny@gmail.com> llvm-svn: 336137
* [analyzer] [tests] Pass clang executable path to prefix-less executor scripts.George Karpenkov2018-07-021-0/+1
| | | | llvm-svn: 336124
* Test commit accessBalazs Keri2018-07-021-1/+1
| | | | llvm-svn: 336108
* [ms] Fix mangling of char16_t and char32_t to be compatible with MSVC.Nico Weber2018-07-022-10/+36
| | | | | | | | | | MSVC limits char16_t and char32_t string literal names to 32 bytes of character data, not to 32 characters. wchar_t string literal names on the other hand can get up to 64 bytes of character data. https://reviews.llvm.org/D48781 llvm-svn: 336097
* Add expected fail triple x86_64-pc-windows-gnu to test as x86_64-w64-mingw32 ↵Yaron Keren2018-06-301-1/+1
| | | | | | is already there llvm-svn: 336047
* [X86] Correct the width of mask arguments in intrinsic headers and tests.Craig Topper2018-06-306-102/+100
| | | | | | | | | | | | | All of these found by grepping through IR from the builtin tests for extra trunc and zext/sext instructions that shouldn't have been there. Some of these were real bugs where we lost bits from the user input: _mm512_mask_broadcast_f32x8 _mm512_maskz_broadcast_f32x8 _mm512_mask_broadcast_i32x8 _mm512_maskz_broadcast_i32x8 _mm256_mask_cvtusepi16_storeu_epi8 llvm-svn: 336042
* Driver: Add an explicit target to testcase from r336037Tom Stellard2018-06-301-0/+1
| | | | llvm-svn: 336039
* Driver: Don't mix system tools with devtoolset tools on RHELTom Stellard2018-06-302-0/+18
| | | | | | | | | | | | | | | | | Summary: On RHEL, devtoolset provides a more up-to-date toolchain than the base install, and we want to make sure all the tools use are from the same toolchain. Reviewers: rsmith, bruno Reviewed By: bruno Subscribers: bruno, cfe-commits Differential Revision: https://reviews.llvm.org/D34848 llvm-svn: 336037
* [X86] Remove masking from the avx512 rotate builtins. Use a select builtin ↵Craig Topper2018-06-306-402/+345
| | | | | | instead. llvm-svn: 336036
* Add protocol redefinition to the current scope/contextBruno Cardoso Lopes2018-06-306-0/+28
| | | | | | | | | | | | Not doing so causes the AST writter to assert since the decl in question never gets emitted. This is fine when modules is not used, but otherwise we need to serialize something other than garbage. rdar://problem/39844933 Differential Revision: https://reviews.llvm.org/D47297 llvm-svn: 336031
* [CUDA] Make __host__/__device__ min/max overloads constexpr in C++14.Justin Lebar2018-06-291-4/+13
| | | | | | | | | | | | Summary: Tests in a separate change to the test-suite. Reviewers: rsmith, tra Subscribers: lahwaacz, sanjoy, cfe-commits Differential Revision: https://reviews.llvm.org/D48151 llvm-svn: 336026
* [CUDA] Make min/max shims host+device.Justin Lebar2018-06-291-4/+4
| | | | | | | | | | | | | | | | Summary: Fixes PR37753: min/max can't be called from __host__ __device__ functions in C++14 mode. Testcase in a separate test-suite commit. Reviewers: rsmith Subscribers: sanjoy, lahwaacz, cfe-commits Differential Revision: https://reviews.llvm.org/D48036 llvm-svn: 336025
* [analyzer] [tests] Allow the tested project to specify it's own analyzer wrapperGeorge Karpenkov2018-06-291-0/+14
| | | | llvm-svn: 336023
* [analyzer] [tests] Fix 80 column violation in SATestBuild.pyGeorge Karpenkov2018-06-291-5/+5
| | | | llvm-svn: 336022
* PR33924: merge local declarations that have linkage of some kind withinRichard Smith2018-06-296-26/+203
| | | | | | | | | | | | | | | | | | | | | merged function definitions; also merge functions with deduced return types. This seems like two independent fixes, but unfortunately they are hard to separate because it's challenging to reliably test either one of them without also testing the other. A complication arises with deduced return type support: we need the type of the function in order to know how to merge it, but we can't load the actual type of the function because it might reference an entity declared within the function (and we need to have already merged the function to correctly merge that entity, which we would need to do to determine if the function types match). So we instead compare the declared function type when merging functions, and defer loading the actual type of a function with a deduced type until we've finished loading and merging the function. llvm-svn: 336021
* Spurious commit just to help Richard, because git is weird.David Blaikie2018-06-291-0/+1
| | | | llvm-svn: 336020
* [modules] Emit the type of the TypeSourceInfo for a DeclaratorDecl (butRichard Smith2018-06-296-18/+36
| | | | | | | | | | | not the corresponding location information) earlier. We need the type as written in order to properly merge functions with deduced return types, so we need to load that early. But we don't want to load the location information early, because that contains problematic things such as the function parameters. llvm-svn: 336016
* Specify an explicit underlying type for this enum to fix WindowsRichard Smith2018-06-291-1/+1
| | | | | | | | | | buildbots. On Windows targets, enums always get an underlying type of 'int', even if they have wider enumerators. (This is non-conforming, but it's effectively part of the target ABI.) llvm-svn: 336013
* Request init/fini array on FreeBSD 12 and laterDimitry Andric2018-06-292-0/+10
| | | | | | | | | | | | | | | | | | | | | | | Summary: It seems a bad idea to change the default in the middle of a release branch due to possible changes in global ctor / dtor ordering between .ctors and .init_array. With FreeBSD 11.0's release imminent lets change the default now for FreeBSD 12 (the current development stream) and later. FreeBSD rtld has supported .init_array / .fini_array for many years. As of Jan 1 2017 all supported FreeBSD releases and branches will have support. Reviewers: dim, brooks, arichardson Reviewed By: dim, brooks, arichardson Subscribers: bsdjhb, krytarowski, emaste, cfe-commits Differential Revision: https://reviews.llvm.org/D24867 llvm-svn: 336008
* [mips][ias] Enable IAS by default for OpenBSD / FreeBSD mips64/mips64el.Brad Smith2018-06-293-4/+20
| | | | | | | | Reviewers: atanasyan Differential Revision: https://reviews.llvm.org/D48515 llvm-svn: 336004
* [analyzer] Replace the vector of ConstraintSets by a single ConstraintSet ↵Mikhail R. Gadelha2018-06-292-18/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and a function to merge ConstraintSets Now, instead of adding the constraints when they are removed, this patch adds them when they first appear and, since we walk the bug report backward, it should be the last set of ranges generated by the CSA for a given symbol. These are the number before and after the patch: ``` Project | current | patch | tmux | 283.222 | 123.052 | redis | 614.858 | 400.347 | openssl | 308.292 | 307.149 | twin | 274.478 | 245.411 | git | 547.687 | 477.335 | postgresql | 2927.495 | 2002.526 | sqlite3 | 3264.305 | 1028.416 | ``` Major speedups in tmux and sqlite (less than half of the time), redis and postgresql were about 25% faster while the rest are basically the same. Reviewers: NoQ, george.karpenkov Reviewed By: george.karpenkov Subscribers: rnkovacs, xazax.hun, szepet, a.sidorin Differential Revision: https://reviews.llvm.org/D48565 llvm-svn: 336002
* [MachineOutliner] Make -mno-outline use -enable-machine-outliner=neverJessica Paquette2018-06-292-16/+23
| | | | | | | | This updates -mno-outline so that it passes -enable-machine-outliner=never instead of nothing. This puts it in sync with the behaviour in llc and other tools. llvm-svn: 336001
* [Fixed Point Arithmetic] Rename `-fsame-fbits` flagLeonard Chan2018-06-299-31/+33
| | | | | | | | | | | - Rename the `-fsame-fbits` flag to `-fpadding-on-unsigned-fixed-point` - Move the flag from a driver option to a cc1 option - Rename the `SameFBits` member in TargetInfo to `PaddingOnUnsignedFixedPoint` - Updated descriptions Differential Revision: https://reviews.llvm.org/D48727 llvm-svn: 335993
* [clang-format/ObjC] Fix NS_SWIFT_NAME(foo(bar:baz:)) after ObjC method declBen Hamilton2018-06-292-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In D44638, I partially fixed `NS_SWIFT_NAME(foo(bar:baz:))`-style annotations on C functions, but didn't add a test for Objective-C method declarations. For ObjC method declarations which are annotated with `NS_SWIFT_NAME(...)`, we currently fail to annotate the final component of the selector name as `TT_SelectorName`. Because the token type is left unknown, clang-format will happily cause a compilation error when it changes the following: ``` @interface Foo - (void)doStuffWithFoo:(id)name bar:(id)bar baz:(id)baz NS_SWIFT_NAME(doStuff(withFoo:bar:baz:)); @end ``` to: ``` @interface Foo - (void)doStuffWithFoo:(id)name bar:(id)bar baz:(id)baz NS_SWIFT_NAME(doStuff(withFoo:bar:baz :)); @end ``` (note the linebreak before the final `:`). The logic which decides whether or not to annotate the token before a `:` with `TT_SelectorName` is pretty fragile, and has to handle some pretty odd cases like pair-parameters: ``` [I drawRectOn:surface ofSize:aa:bbb atOrigin:cc:dd]; ``` So, to minimize the effect of this change, I decided to only annotate unknown identifiers before a `:` as `TT_SelectorName` for Objective-C declaration lines. Test Plan: New tests included. Confirmed tests failed before change and passed after change. Ran tests with: % make -j16 FormatTests && ./tools/clang/unittests/Format/FormatTests Reviewers: djasper, krasimir, jolesiak Reviewed By: krasimir Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D48679 llvm-svn: 335983
* [clang-format] Support additional common functions for text proto formattingKrasimir Georgiev2018-06-291-1/+4
| | | | | | | | | | | | | | Summary: This adds a few more common function names expecting a text proto argument. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D48760 llvm-svn: 335978
* [ASTImporter] Added import of CXXStdInitializerListExprGabor Marton2018-06-293-0/+26
| | | | | | | | | | | | | | Reviewers: a.sidorin Reviewed By: a.sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D48631 Patch by Balazs Keri! llvm-svn: 335968
* [analyzer][UninitializedObjectChecker] Added a NotesAsWarnings flagKristof Umann2018-06-292-21/+68
| | | | | | | | | | In order to better support consumers of the plist output that don't parse note entries just yet, a 'NotesAsWarnings' flag was added. If it's set to true, all notes will be converted to warnings. Differential Revision: https://reviews.llvm.org/D48285 llvm-svn: 335964
* [ASTImporter] Eliminated some unittest warnings.Gabor Marton2018-06-291-415/+326
| | | | | | | | | | | | | | | | | | | Summary: When running the ASTTests test, warnings produced by the compiler can be distracting when looking for test errors. A part of the warnings is removed by setting extra compiler options. Reviewers: a.sidorin Reviewed By: a.sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D47459 Patch by Balazs Keri! llvm-svn: 335959
* [X86] Remove masking from the avx512 packed sqrt builtins. Use select ↵Craig Topper2018-06-295-81/+66
| | | | | | builtins instead. llvm-svn: 335945
* [frontend] Don't include the C++ stdlib for -x assembler-with-cppAlex Lorenz2018-06-282-2/+7
| | | | | | | | | | | | | | The new C++ stdlib warning added in r335081 gets triggered when compiling an assembly file with -x assembler-with-cpp. This commit ensures that the C++ stdlib is not included when compiling assembly. In general, it's not really useful to include the C++ stdlib search path when compiling assembly source. rdar://41359632 Differential Revision: https://reviews.llvm.org/D48736 llvm-svn: 335940
* DebugInfo: Add -gno-gnu-pubnames to allow disabling gnu-pubnames later in ↵David Blaikie2018-06-283-1/+6
| | | | | | the command line llvm-svn: 335938
* [analyzer] fix test case expected warningMikhail R. Gadelha2018-06-281-8/+0
| | | | | | | | | After r335814, the constraint manager is no longer generating a false bug report about the division by zero in the test case. This patch removes the expected false bug report. llvm-svn: 335932
* [analyzer] Move test to the correct directoryMikhail R. Gadelha2018-06-281-0/+0
| | | | | | It was accidentaly pushed in r335926 llvm-svn: 335929
* [Parse] Make -Wgcc-compat complain about for loop inits in C89George Burgess IV2018-06-283-1/+21
| | | | | | | | | | While clang allows declarations in for loop init statements in c89 and gnu89, gcc does not. So, we should probably warn if users care about gcc compatibility. Differential Revision: https://reviews.llvm.org/D47840 llvm-svn: 335927
* [analyzer] Fix wrong comparison generation of the ranges generated by the ↵Mikhail R. Gadelha2018-06-282-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | refutation manager The refutation manager is removing a true bug from the test in this patch. The problem is that the following constraint: ``` (conj_$1{struct o *}) - (reg_$3<int * r>): [-9223372036854775808, 0] ``` is encoded as: ``` (and (bvuge (bvsub $1 $3) #x8000000000000000) (bvule (bvsub $1 $3) #x0000000000000000)) ``` The issue is that unsigned comparisons (bvuge and bvule) are being generated instead of signed comparisons (bvsge and bvsle). When generating the expressions: ``` (conj_$1{p *}) - (reg_$3<int * r>) >= -9223372036854775808 ``` and ``` (conj_$1{p *}) - (reg_$3<int * r>) <= 0 ``` both -9223372036854775808 and 0 are casted to pointer type and `LTy->isSignedIntegerOrEnumerationType()` in `Z3ConstraintManager::getZ3BinExpr` only checks if the type is signed, not if it's a pointer. Reviewers: NoQ, george.karpenkov, ddcc Subscribers: rnkovacs, NoQ, george.karpenkov, ddcc, xazax.hun, szepet, a.sidorin Differential Revision: https://reviews.llvm.org/D48324 llvm-svn: 335926
* PR37979: integral promotions in C++ treat enum bit-fields like enums,Richard Smith2018-06-283-1/+41
| | | | | | | | | | | | | | | | | not like bit-fields. We used to get this right "by accident", because conversions for the selected built-in overloaded operator would convert the enum bit-field to its corresponding underlying type early. But after DR1687 that no longer happens. Technically this change should also apply to C, where bit-fields only have special promotion rules if the bit-field's declared type is _Bool, int, signed int, or unsigned int, but for GCC compatibility we only look at the bit-width and not the underlying type when performing bit-field integral promotions in C. llvm-svn: 335925
* [CMake] Don't build Linux targets on Darwin in Fuchsia toolchainPetr Hosek2018-06-282-29/+29
| | | | | | | | | This is currently breaking because Linux target sysroots rely on case sensitive filesystem which is not by default enabled on macOS. Differential Revision: https://reviews.llvm.org/D48710 llvm-svn: 335919
* [CMake] Build static runtimes for host in Fuchsia first stagePetr Hosek2018-06-281-0/+12
| | | | | | | | | | First stage build is only a minimal build where we don't need a complete multiarch support, but we need enough to build the second stage. Differential Revision: https://reviews.llvm.org/D48707 llvm-svn: 335917
OpenPOWER on IntegriCloud