summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [Driver] Update GCC libraries detection logic for Gentoo.Manoj Gupta2018-04-0716-23/+145
| | | | | | | | | | | | | | | | | Summary: 1. Find GCC's LDPATH from the actual GCC config file. 2. Avoid picking libraries from a similar named tuple if the exact tuple is installed. Reviewers: mgorny, chandlerc, thakis, rnk Reviewed By: mgorny, rnk Subscribers: cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D45233 llvm-svn: 329512
* Allow equality comparisons between block pointers andJohn McCall2018-04-072-0/+64
| | | | | | | | block-pointer-compatible ObjC object pointer types. Patch by Dustin Howett! llvm-svn: 329508
* [Sema] Extend -Wself-assign and -Wself-assign-field to warn on overloaded ↵Roman Lebedev2018-04-078-56/+505
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | self-assignment (classes) Summary: This has just bit me, so i though it would be nice to avoid that next time :) Motivational case: https://godbolt.org/g/cq9UNk Basically, it's likely to happen if you don't like shadowing issues, and use `-Wshadow` and friends. And it won't be diagnosed by clang. The reason is, these self-assign diagnostics only work for builtin assignment operators. Which makes sense, one could have a very special operator=, that does something unusual in case of self-assignment, so it may make sense to not warn on that. But while it may be intentional in some cases, it may be a bug in other cases, so it would be really great to have some diagnostic about it... Reviewers: aaron.ballman, rsmith, rtrieu, nikola, rjmccall, dblaikie Reviewed By: rjmccall Subscribers: EricWF, lebedev.ri, thakis, Quuxplusone, cfe-commits Differential Revision: https://reviews.llvm.org/D44883 llvm-svn: 329493
* Sort source lists in lib/StaticAnalyzer.Nico Weber2018-04-072-2/+2
| | | | llvm-svn: 329481
* Make CodeGen depend just once on clangAnalysis.Nico Weber2018-04-071-1/+0
| | | | llvm-svn: 329477
* Remove another unnecessary -I flag passed to clang-tblgen.Nico Weber2018-04-072-2/+1
| | | | llvm-svn: 329476
* Generalize test for 32-bit targets.Richard Smith2018-04-071-2/+2
| | | | llvm-svn: 329467
* Recommit r329442: Generate Libclang invocation reproducers using a newAlex Lorenz2018-04-078-14/+267
| | | | | | | | | | | | | | | | | | | | | | | | | | -cc1gen-reproducer driver option The recommit fixes: - An MSAN failure (CCPrintOptions wasn't initialized in the Driver) - Ensures that the strings in the libclang invocation files are escaped Original message: This commit is a follow up to the previous work that recorded Libclang invocations into temporary files: r319702. It adds a new -cc1 mode to clang: -cc1gen-reproducer. The goal of this mode is to generate Clang reproducer files for Libclang tool invocation. The JSON format in the invocation files is not really intended to be stable, so Libclang and Clang should be of the same version when generating reproducers. The new mode emits the information about the temporary files and Libclang-specific information to stdout using JSON. rdar://35322614 Differential Revision: https://reviews.llvm.org/D40983 llvm-svn: 329465
* Remove two unnecessary -I flags passed to clang-tblgen.Nico Weber2018-04-061-2/+0
| | | | llvm-svn: 329464
* Don't assume constructors return void.Richard Smith2018-04-061-2/+2
| | | | | | Should fix ARM buildbot. llvm-svn: 329449
* Revert r329442 "Generate Libclang invocation reproducers using a newAlex Lorenz2018-04-067-258/+6
| | | | | | | | -cc1gen-reproducer driver option" The tests are failing on some bots llvm-svn: 329447
* Revert "[analyzer] Remove an unused variable"George Karpenkov2018-04-061-1/+1
| | | | | | | | This reverts commit 2fa3e3edc4ed6547cc4ce46a8c79d1891a5b3b36. Removed the wrong variable. llvm-svn: 329445
* [analyzer] Remove an unused variableGeorge Karpenkov2018-04-061-1/+1
| | | | llvm-svn: 329444
* Generate Libclang invocation reproducers using a new -cc1gen-reproducerAlex Lorenz2018-04-067-6/+258
| | | | | | | | | | | | | | | | | | | | driver option This commit is a follow up to the previous work that recorded Libclang invocations into temporary files: r319702. It adds a new -cc1 mode to clang: -cc1gen-reproducer. The goal of this mode is to generate Clang reproducer files for Libclang tool invocation. The JSON format in the invocation files is not really intended to be stable, so Libclang and Clang should be of the same version when generating reproducers. The new mode emits the information about the temporary files and Libclang-specific information to stdout using JSON. rdar://35322614 Differential Revision: https://reviews.llvm.org/D40983 llvm-svn: 329442
* [HIP] define __CUDA_ARCH_=1 for amdgcn targetsYaxun Liu2018-04-061-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D45277 llvm-svn: 329420
* [OPENMP, NVPTX] Fix codegen for the teams reduction.Alexey Bataev2018-04-066-92/+86
| | | | | | | Added NUW flags for all the add|mul|sub operations + replaced sdiv by udiv as we operate on unsigned values only (addresses, converted to integers) llvm-svn: 329411
* Fix typos in clangAlexander Kornienko2018-04-06231-349/+349
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of: archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.) Differential revision: https://reviews.llvm.org/D44188 llvm-svn: 329399
* [Hexagon] Remove default values from lambda parametersKrzysztof Parzyszek2018-04-061-24/+24
| | | | llvm-svn: 329394
* Allow the creation of human-friendly ASTDumper to arbitrary output streamAlexander Kornienko2018-04-066-12/+20
| | | | | | | | | | | | | | | | | | | | | Summary: `ASTPrinter` allows setting the ouput to any O-Stream, but that printer creates source-code-like syntax (and is also marked with a `FIXME`). The nice, colourful, mostly human-readable `ASTDumper` only works on the standard output, which is not feasible in case a user wants to see the AST of a file through a code navigation/comprehension tool. This small addition of an overload solves generating a nice colourful AST block for the users of a tool I'm working on, [[ http://github.com/Ericsson/CodeCompass | CodeCompass ]], as opposed to having to duplicate the behaviour of definitions that only exist in the anonymous namespace of implementation TUs related to this module. Reviewers: alexfh, klimek, rsmith Reviewed By: alexfh Subscribers: rnkovacs, dkrupp, gsd, xazax.hun, cfe-commits, #clang Tags: #clang Patch by Whisperity! Differential Revision: https://reviews.llvm.org/D45096 llvm-svn: 329391
* [XRay][clang] Only run driver test for Linux and FreeBSDDean Michael Berris2018-04-061-0/+2
| | | | | | | | | This is a follow-up to D45354, which we should have only been running on Linux and FreeBSD for specific targets. Differential Revision: https://reviews.llvm.org/D45354 llvm-svn: 329378
* [XRay][clang] Add a flag to enable/disable linking XRay deps explicitlyDean Michael Berris2018-04-064-1/+18
| | | | | | | | | | | | | | | | | | | | Summary: This change introduces `-fxray-link-deps` and `-fnoxray-link-deps`. The `-fnoxray-link-deps` allows for directly controlling which specific XRay runtime to link. The default is for clang to link the XRay runtime that is shipped with the compiler (if there are any), but users may want to explicitly add the XRay dependencies from other locations or other means. Reviewers: eizan, echristo, chandlerc Reviewed By: eizan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45354 llvm-svn: 329376
* [XRay][clang] Consolidate runtime and link-time flag processing (NFC)Dean Michael Berris2018-04-066-81/+39
| | | | | | | | | | | | | | | | | | | Summary: This change fixes http://llvm.org/PR36985 to define a single place in CommonArgs.{h,cpp} where XRay runtime flags and link-time dependencies are processed for all toolchains that support XRay instrumentation. This is a refactoring of the same functionality spread across multiple toolchain definitions. Reviewers: echristo, devnexen, eizan Reviewed By: eizan Subscribers: emaste, cfe-commits Differential Revision: https://reviews.llvm.org/D45243 llvm-svn: 329372
* CMake option to allow enabling experimental new pass manager by defaultPetr Hosek2018-04-064-2/+8
| | | | | | | | | This CMake flag allows setting the default value for the -f[no]-experimental-new-pass-manager flag. Differential Revision: https://reviews.llvm.org/D44330 llvm-svn: 329366
* Fix test added in r329301 to work properly with Windows paths.Douglas Yung2018-04-051-4/+4
| | | | llvm-svn: 329361
* [Sema] Revert r329346 because of memory sanitizer failures.Eugene Zelenko2018-04-058-384/+228
| | | | llvm-svn: 329357
* Add a couple more tests for DR372.Richard Smith2018-04-051-0/+19
| | | | llvm-svn: 329352
* [Sema] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-04-058-228/+384
| | | | | | other minor fixes (NFC). llvm-svn: 329346
* PR36992: do not store beyond the dsize of a class object unless we knowRichard Smith2018-04-0516-115/+260
| | | | | | | | | | | | | | the tail padding is not reused. We track on the AggValueSlot (and through a couple of other initialization actions) whether we're dealing with an object that might share its tail padding with some other object, so that we can avoid emitting stores into the tail padding if that's the case. We still widen stores into tail padding when we can do so. Differential Revision: https://reviews.llvm.org/D45306 llvm-svn: 329342
* DR1672, DR1813, DR1881, DR2120: Implement recent fixes to "standardRichard Smith2018-04-0517-63/+419
| | | | | | | | | | | | | | | | | layout" rules. The new rules say that a standard-layout struct has its first non-static data member and all base classes at offset 0, and consider a class to not be standard-layout if that would result in multiple subobjects of a single type having the same address. We track "is C++11 standard-layout class" separately from "is standard-layout class" so that the ABIs that need this information can still use it. Differential Revision: https://reviews.llvm.org/D45176 llvm-svn: 329332
* Remove the temporary availability checking workaround forAlex Lorenz2018-04-052-24/+2
| | | | | | | | the nested declarations in @interface. rdar://28825862 llvm-svn: 329324
* Fix typo in comment -fmath-errno=0 -> -fno-math-errnoSam Clegg2018-04-051-1/+1
| | | | | | | | The former is not a valid clang argument Differential Revision: https://reviews.llvm.org/D45102 llvm-svn: 329323
* [ASTImporter] Fix for importing unnamed structsAleksei Sidorin2018-04-055-4/+139
| | | | | | | | Patch by Peter Szecsi! Differential Revision: https://reviews.llvm.org/D30876 llvm-svn: 329301
* Disable -fmerge-all-constants as default.Manoj Gupta2018-04-0511-19/+28
| | | | | | | | | | | | | | | | | | | Summary: "-fmerge-all-constants" is a non-conforming optimization and should not be the default. It is also causing miscompiles when building Linux Kernel (https://lkml.org/lkml/2018/3/20/872). Fixes PR18538. Reviewers: rjmccall, rsmith, chandlerc Reviewed By: rsmith, chandlerc Subscribers: srhines, cfe-commits Differential Revision: https://reviews.llvm.org/D45289 llvm-svn: 329300
* [clang-format] Support lightweight Objective-C genericsBen Hamilton2018-04-052-3/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, `clang-format` didn't understand lightweight Objective-C generics, which have the form: ``` @interface Foo <KeyType, ValueTypeWithConstraint : Foo, AnotherValueTypeWithGenericConstraint: Bar<Baz>, ... > ... ``` The lightweight generic specifier list appears before the base class, if present, but because it starts with < like the protocol specifier list, `UnwrappedLineParser` was getting confused and failed to parse interfaces with both generics and protocol lists: ``` @interface Foo <KeyType> : NSObject <NSCopying> ``` Since the parsed line would be incomplete, the format result would be very confused (e.g., https://bugs.llvm.org/show_bug.cgi?id=24381). This fixes the issue by explicitly parsing the ObjC lightweight generic conformance list, so the line is fully parsed. Fixes: https://bugs.llvm.org/show_bug.cgi?id=24381 Test Plan: New tests added. Ran tests with: % make -j16 FormatTests && ./tools/clang/unittests/Format/FormatTests Reviewers: djasper, jolesiak Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D45185 llvm-svn: 329298
* [clang-format] Ensure ObjC selectors with 0 args are annotated correctlyBen Hamilton2018-04-052-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, clang-format would incorrectly annotate 0-argument Objective-C selector names as TT_TrailingAnnotation: ``` % echo "-(void)foo;" > /tmp/test.m % ./bin/clang-format -debug /tmp/test.m Language: Objective-C ---- Line(0, FSC=0): minus[T=68, OC=0] l_paren[T=68, OC=1] void[T=68, OC=2] r_paren[T=68, OC=6] identifier[T=68, OC=7] semi[T=68, OC=10] Line(0, FSC=0): eof[T=68, OC=0] Run 0... AnnotatedTokens(L=0): M=0 C=0 T=ObjCMethodSpecifier S=1 B=0 BK=0 P=0 Name=minus L=1 PPK=2 FakeLParens= FakeRParens=0 Text='-' M=0 C=1 T=Unknown S=1 B=0 BK=0 P=33 Name=l_paren L=3 PPK=2 FakeLParens= FakeRParens=0 Text='(' M=0 C=1 T=Unknown S=0 B=0 BK=0 P=140 Name=void L=7 PPK=2 FakeLParens= FakeRParens=0 Text='void' M=0 C=0 T=CastRParen S=0 B=0 BK=0 P=43 Name=r_paren L=8 PPK=2 FakeLParens= FakeRParens=0 Text=')' M=0 C=1 T=TrailingAnnotation S=0 B=0 BK=0 P=120 Name=identifier L=11 PPK=2 FakeLParens= FakeRParens=0 Text='foo' M=0 C=0 T=Unknown S=0 B=0 BK=0 P=23 Name=semi L=12 PPK=2 FakeLParens= FakeRParens=0 Text=';' ``` This caused us to incorrectly indent 0-argument wrapped selectors when Style.IndentWrappedFunctionNames was false, as we thought the 0-argument ObjC selector name was actually a trailing annotation (which is always indented). This diff fixes the issue and adds tests. Test Plan: New tests added. Confirmed tests failed before diff. After diff, tests passed. Ran tests with: % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests Reviewers: djasper, jolesiak Reviewed By: djasper, jolesiak Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D44996 llvm-svn: 329297
* [ObjC] Make C++ triviality type traits available to non-trivial CAkira Hatanaka2018-04-053-10/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | structs. r326307 and r327870 made changes that allowed using non-trivial C structs with fields qualified with __strong or __weak. This commit makes the following C++ triviality type traits available to non-trivial C structs: __has_trivial_assign __has_trivial_move_assign __has_trivial_copy __has_trivial_move_constructor __has_trivial_constructor __has_trivial_destructor This reapplies r328680. This commit fixes a bug where the copy/move __has_trivial_* traits would return false when a volatile type was being passed. Thanks to Richard Smith for pointing out the mistake. rdar://problem/33599681 Differential Revision: https://reviews.llvm.org/D44913 llvm-svn: 329289
* [PATCH] [RISCV] Extend getTargetDefines for RISCVTargetInfoShiva Chen2018-04-055-1/+158
| | | | | | | | | | | | | | Summary: This patch extend getTargetDefines and implement handleTargetFeatures and hasFeature. and define corresponding marco for those features. Reviewers: asb, apazos, eli.friedman Differential Revision: https://reviews.llvm.org/D44727 Patch by Kito Cheng. llvm-svn: 329278
* [clang-format] Preserve spaces before a percent in (text) protosKrasimir Georgiev2018-04-053-2/+10
| | | | | | | This makes sure that we do not change the meaning of pieces of text with format specifiers. llvm-svn: 329263
* Revert r328680 ("[ObjC] Make C++ triviality type traits available to ↵Richard Smith2018-04-053-43/+6
| | | | | | | | | non-trivial C structs.") It unintentionally caused the values of the __has_* type traits to change in C++ for trivially-copyable classes with volatile members. llvm-svn: 329247
* [AST] Don't track lambda captures when checking a potential constant expression.Erik Pilkington2018-04-052-6/+52
| | | | | | | | Fixes PR36054. Differential revision: https://reviews.llvm.org/D45194 llvm-svn: 329244
* Enable msan unconditionally on Linux.Evgeniy Stepanov2018-04-042-5/+1
| | | | | | | | | | | | | | | | | | Memory sanitizer compatibility are already done in MemorySanitizer::doInitialization. It verifies whether the necessary offsets exist and bails out if not. For this reason it is no good to duplicate two checks in two projects. This patch removes clang check and postpones msan compatibility validation till MemorySanitizer::doInitialization. Another reason for this patch is to allow using msan with any CPU (given compatible runtime) and custom mapping provided via the arguments added by https://reviews.llvm.org/D44926. Patch by vit9696. Differential Revision: https://reviews.llvm.org/D44927 llvm-svn: 329241
* AArch64: Implement support for the shadowcallstack attribute.Peter Collingbourne2018-04-044-22/+89
| | | | | | | | | | | | The implementation of shadow call stack on aarch64 is quite different to the implementation on x86_64. Instead of reserving a segment register for the shadow call stack, we reserve the platform register, x18. Any function that spills lr to sp also spills it to the shadow call stack, a pointer to which is stored in x18. Differential Revision: https://reviews.llvm.org/D45239 llvm-svn: 329236
* [Driver] Include the Android multiarch includes.Dan Albert2018-04-0414-1/+47
| | | | | | | | | | | | | | | | Summary: Most Android headers live in a single directory, but a small handful live in multiarch directories. Reviewers: srhines Reviewed By: srhines Subscribers: javed.absar, cfe-commits Differential Revision: https://reviews.llvm.org/D44995 llvm-svn: 329234
* [CUDA] Add amdgpu sub archsYaxun Liu2018-04-048-42/+205
| | | | | | | | | Patch by Greg Rodgers. Revised and lit tests added by Yaxun Liu. Differential Revision: https://reviews.llvm.org/D45277 llvm-svn: 329232
* [clang-format] In tests, expected code should be format-stableMark Zeren2018-04-047-0/+11
| | | | | | | | | | | | | | | | | | | | | | Summary: Extend various verifyFormat helper functions to check that the expected text is "stable". This provides some protection against bugs where formatting results are ocilating between two forms, or continually change in some other way. Testing Done: * Ran unit tests. * Reproduced a known instability in preprocessor indentation which was caught by this new check. Reviewers: krasimir Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D42034 llvm-svn: 329231
* Revert "[CUDA] Check initializers of instantiated template variables."Artem Belevich2018-04-045-85/+52
| | | | | | | This (temporarily) reverts commit r329127 due to the problems it exposed in TensorFlow. llvm-svn: 329229
* [analyzer][test] Set C++14 as language standard for test depending on newJan Korous2018-04-041-1/+1
| | | | | | features llvm-svn: 329225
* Fixes errors with FS iterators caused by https://reviews.llvm.org/D44960Max Moroz2018-04-042-15/+25
| | | | | | | | | | | | | | | | | | | | Summary: In https://reviews.llvm.org/D44960, file status check is executed every time a real file system directory iterator is constructed or incremented, and emits an error code. This change list fixes the errors in VirtualFileSystem caused by https://reviews.llvm.org/D44960. Patch by Yuke Liao (@liaoyuke). Reviewers: vsk, pcc, zturner, liaoyuke Reviewed By: vsk Subscribers: mgrang, cfe-commits Differential Revision: https://reviews.llvm.org/D45178 llvm-svn: 329223
* [XRay][clang] Allow clang to build XRay instrumented binaries in OpenBSDDean Michael Berris2018-04-042-1/+30
| | | | | | | | | | | | | | | | | | | Summary: This patch was originally reviewed in D45126. It enables clang to add the XRay runtime and the link-time dependencies for XRay instrumentation in OpenBSD. Landing for devnexen. Reviewers: brad, dberris Subscribers: dberris, krytarowski, cfe-commits Author: devnexen Differential Revision: https://reviews.llvm.org/D45126 llvm-svn: 329183
* Make helpers static. NFC.Benjamin Kramer2018-04-042-5/+4
| | | | llvm-svn: 329170
OpenPOWER on IntegriCloud