summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [XRay][clang+compiler-rt] Support build-time mode selectionDean Michael Berris2018-04-112-6/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements the `-fxray-modes=` flag which allows users building with XRay instrumentation to decide which modes to pre-package into the binary being linked. The default is the status quo, which will link all the available modes. For this to work we're also breaking apart the mode implementations (xray-fdr and xray-basic) from the main xray runtime. This gives more granular control of which modes are pre-packaged, and picked from clang's invocation. This fixes llvm.org/PR37066. Note that in the future, we may change the default for clang to only contain the profiling implementation under development in D44620, when that implementation is ready. Reviewers: echristo, eizan, chandlerc Reviewed By: echristo Subscribers: mgorny, mgrang, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D45474 llvm-svn: 329772
* [AST] Fix some Clang-tidy modernize-use-auto and Include What You Use ↵Eugene Zelenko2018-04-104-137/+233
| | | | | | warnings; other minor fixes (NFC). llvm-svn: 329766
* Introduce a new builtin, __builtin_dump_struct, that is useful for dumping ↵Aaron Ballman2018-04-102-0/+157
| | | | | | | | structure contents at runtime in circumstances where debuggers may not be easily available (such as in kernel work). Patch by Paul Semel. llvm-svn: 329762
* Revert "Handle the default case"Petr Hosek2018-04-101-2/+0
| | | | | | This reverts commit r329758. llvm-svn: 329760
* Handle the default casePetr Hosek2018-04-101-0/+2
| | | | | | | | This was omitted in D45422 resulting in a warning. Differential Revision: https://reviews.llvm.org/D45499 llvm-svn: 329758
* [Driver] Handle the default case missed in r329748.Chad Rosier2018-04-101-0/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D45499 llvm-svn: 329754
* [OPENMP] Additional attributes for the pointer parameters.Alexey Bataev2018-04-105-59/+97
| | | | | | Added attributes for better optimization of the OpenMP code. llvm-svn: 329751
* [Driver] Allow drivers to add multiple libc++ include pathsPetr Hosek2018-04-1021-59/+89
| | | | | | | | | | | This allows toolchain drivers to add multiple libc++ include paths akin to libstdc++. This is useful in multiarch setup when some headers might be in target specific include directory. There should be no functional change. Differential Revision: https://reviews.llvm.org/D45422 llvm-svn: 329748
* [X86] Split up -march=icelake to -client & -serverGabor Buella2018-04-101-2/+4
| | | | | | | | | | Reviewers: craig.topper, zvi, echristo Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D45056 llvm-svn: 329741
* Revert r329684 (and follow-ups 329693, 329714). See discussion on ↵Nico Weber2018-04-1015-221/+54
| | | | | | https://reviews.llvm.org/D43578. llvm-svn: 329739
* [CUDA] Added --[no-]cuda-include-ptx=sm_XX|all option.Artem Belevich2018-04-101-0/+19
| | | | | | | | | | | | | | Currently we always include PTX into the fatbin along with the GPU code.It about doubles the size of the GPU binary we need to carry in the executable. These options allow control inclusion of PTX into GPU binary. This patch does not change the defaults, though we may consider making no-PTX the default in the future. Differential Revision: https://reviews.llvm.org/D45495 llvm-svn: 329737
* [Parser] Fix assertion-on-invalid for unexpected typename.Volodymyr Sapsai2018-04-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | In `ParseDeclarationSpecifiers` for the code class A typename A; we were able to annotate token `kw_typename` because it refers to existing type. But later during processing token `annot_typename` we failed to `SetTypeSpecType` and exited switch statement leaving annotation token unconsumed. The code after the switch statement failed because it didn't expect a special token. The fix is not to assume that switch statement consumes all special tokens and consume any token, not just non-special. rdar://problem/37099386 Reviewers: rsmith, arphaman Reviewed By: rsmith Subscribers: jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D44449 llvm-svn: 329735
* Attempt to fix Windows build after r329698.Nico Weber2018-04-101-1/+1
| | | | llvm-svn: 329702
* [X86] Disable SGX for Skylake ServerGabor Buella2018-04-101-1/+2
| | | | | | | | | | Reviewers: craig.topper, zvi, echristo Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D45058 llvm-svn: 329701
* Use llvm::sys::fs::real_path() in clang.Nico Weber2018-04-102-37/+5
| | | | | | | No expected behavior change. https://reviews.llvm.org/D45165 llvm-svn: 329698
* [Tooling] fix UB when interpolating compile commands with an empty indexSam McCall2018-04-101-2/+2
| | | | llvm-svn: 329685
* -ftime-report switch support in Clang.Andrew V. Tischenko2018-04-1015-54/+221
| | | | | | | | | | The current support of the feature produces only 2 lines in report: -Some general Code Generation Time; -Total time of Backend Consumer actions. This patch extends Clang time report with new lines related to Preprocessor, Include Filea Search, Parsing, etc. Differential Revision: https://reviews.llvm.org/D43578 llvm-svn: 329684
* [ExprConstant] Use an AST node and a version number as a key to createAkira Hatanaka2018-04-102-75/+190
| | | | | | | | | | | | | | | an APValue and retrieve it from map Temporaries. The version number is needed when a single AST node is visited multiple times and is used to create APValues that are required to be distinct from each other (for example, MaterializeTemporaryExprs in default arguments and VarDecls in loops). rdar://problem/36505742 Differential Revision: https://reviews.llvm.org/D42776 llvm-svn: 329671
* [ObjC++] Never pass structs that transitively contain __weak fields inAkira Hatanaka2018-04-098-35/+38
| | | | | | | | | | | | | | | | | | | | registers. This patch fixes a bug in r328731 that caused structs transitively containing __weak fields to be passed in registers. The patch replaces the flag RecordDecl::CanPassInRegisters with a 2-bit enum that indicates whether the struct or structs containing the struct are forced to be passed indirectly. This reapplies r329617. r329617 didn't specify the underlying type for enum ArgPassingKind, which caused regression tests to fail on a windows bot. rdar://problem/39194693 Differential Revision: https://reviews.llvm.org/D45384 llvm-svn: 329635
* [AST] Fix some Clang-tidy modernize-use-auto warnings; other minor fixes (NFC).Eugene Zelenko2018-04-093-270/+228
| | | | llvm-svn: 329630
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2018-04-091-407/+405
| | | | | | minor fixes (NFC). llvm-svn: 329628
* Revert "[ObjC++] Never pass structs that transitively contain __weak fields in"Akira Hatanaka2018-04-098-38/+35
| | | | | | | | This reverts commit r329617. It broke a windows bot. http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/16372/steps/test/logs/stdio llvm-svn: 329627
* [ObjC++] Never pass structs that transitively contain __weak fields inAkira Hatanaka2018-04-098-35/+38
| | | | | | | | | | | | | | registers. This patch fixes a bug in r328731 that caused structs transitively containing __weak fields to be passed in registers. The patch replaces the flag RecordDecl::CanPassInRegisters with a 2-bit enum that indicates whether the struct or structs containing the struct are forced to be passed indirectly. rdar://problem/39194693 llvm-svn: 329617
* asan: kernel: make no_sanitize("address") attribute work with ↵Vitaly Buka2018-04-091-2/+8
| | | | | | | | | | | | | | | | | -fsanitize=kernel-address Summary: Right now to disable -fsanitize=kernel-address instrumentation, one needs to use no_sanitize("kernel-address"). Make either no_sanitize("address") or no_sanitize("kernel-address") disable both ASan and KASan instrumentation. Also remove redundant test. Patch by Andrey Konovalov Reviewers: eugenis, kcc, glider, dvyukov, vitalybuka Reviewed By: eugenis, vitalybuka Differential Revision: https://reviews.llvm.org/D44981 llvm-svn: 329612
* Revert "[ObjC] Make C++ triviality type traits available to non-trivial C"Akira Hatanaka2018-04-091-26/+4
| | | | | | | | | | | | | This reverts commit r329289. It was decided that we shouldn't expose the __has_* traits to C since they are deprecated and useless. See the discussion here: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180402/thread.html#223921 llvm-svn: 329608
* [X86] Emit native IR for pmuldq/pmuludq builtins.Craig Topper2018-04-091-0/+36
| | | | | | | | I believe all the pieces are now in place in the backend to make this work correctly. We can either mask the input to 32 bits for pmuludg or shl/ashr for pmuldq and use a regular mul instruction. The backend should combine this to PMULUDQ/PMULDQ and then SimplifyDemandedBits will remove the and/shifts. Differential Revision: https://reviews.llvm.org/D45421 llvm-svn: 329605
* [CUDA] Revert defining __CUDA_ARCH__ for amdgcn targetsYaxun Liu2018-04-095-69/+55
| | | | | | | | | | amdgcn targets only support HIP, which does not define __CUDA_ARCH__. this is a partial unroll of r329232 / D45277. Differential Revision: https://reviews.llvm.org/D45387 llvm-svn: 329584
* [Tooling] A CompilationDatabase wrapper that infers header commands.Sam McCall2018-04-092-0/+459
| | | | | | | | | | | | Summary: The wrapper finds the closest matching compile command using filename heuristics and makes minimal tweaks so it can be used with the header. Subscribers: klimek, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D45006 llvm-svn: 329580
* [Index] Return SourceLocation to consumers, not FileID/Offset pair.Sam McCall2018-04-092-22/+11
| | | | | | | | | | | | | | | | | | Summary: The FileID/Offset conversion is lossy. The code takes the fileLoc, which loses e.g. the spelling location in some macro cases. Instead, pass the original SourceLocation which preserves all information, and update consumers to match current behavior. This allows us to fix two bugs in clangd that need the spelling location. Reviewers: akyrtzi, arphaman Subscribers: ilya-biryukov, ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D45014 llvm-svn: 329570
* [XRay][llvm+clang] Consolidate attribute list filesDean Michael Berris2018-04-094-8/+35
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This change consolidates the always/never lists that may be provided to clang to externally control which functions should be XRay instrumented by imbuing attributes. The files follow the same format as defined in https://clang.llvm.org/docs/SanitizerSpecialCaseList.html for the sanitizer blacklist. We also deprecate the existing `-fxray-instrument-always=` and `-fxray-instrument-never=` flags, in favour of `-fxray-attr-list=`. This fixes http://llvm.org/PR34721. Reviewers: echristo, vlad.tsyrklevich, eugenis Reviewed By: vlad.tsyrklevich Subscribers: llvm-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D45357 llvm-svn: 329543
* [Sema] Fix PR35832 - Ambiguity accessing anonymous struct/union with ↵Eric Fiselier2018-04-082-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | multiple bases. Summary: Currently clang doesn't do qualified lookup when building indirect field decl references. This causes ambiguity when the field is in a base class to which there are multiple valid paths even though a qualified name is used. For example: ``` class B { protected: int i; union { int j; }; }; class X : public B { }; class Y : public B { }; class Z : public X, public Y { int a() { return X::i; } // works int b() { return X::j; } // fails }; ``` Reviewers: rsmith, aaron.ballman, rjmccall Reviewed By: rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45411 llvm-svn: 329521
* Revert "[Sema] Fix PR35832 - Ambiguity accessing anonymous struct/union with ↵Eric Fiselier2018-04-081-1/+1
| | | | | | | | multiple bases." This reverts commit r329519. There are some unaddressed test failures. llvm-svn: 329520
* [Sema] Fix PR35832 - Ambiguity accessing anonymous struct/union with ↵Eric Fiselier2018-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | multiple bases. Summary: Currently clang doesn't do qualified lookup when building indirect field decl references. This causes ambiguity when the field is in a base class to which there are multiple valid paths even though a qualified name is used. For example: ``` class B { protected: int i; union { int j; }; }; class X : public B { }; class Y : public B { }; class Z : public X, public Y { int a() { return X::i; } // works int b() { return X::j; } // fails }; ``` Reviewers: rsmith, aaron.ballman, rjmccall Reviewed By: rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45411 llvm-svn: 329519
* [Sema] Remove dead code in BuildAnonymousStructUnionMemberReference. NFCIEric Fiselier2018-04-081-54/+20
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch cleans up a bunch of dead or unused code in BuildAnonymousStructUnionMemberReference. The dead code was a branch that built a new CXXThisExpr when we weren't given a base object expression or base variable. However, BuildAnonymousFoo has only two callers. One of which always builds a base object expression first, the second only calls when the IndirectFieldDecl is not a C++ class member. Even within C this branch seems entirely unused. I tried diligently to write a test which hit it with no success. This patch removes the branch and replaces it with an assertion that we were given either a base object expression or a base variable. Reviewers: rsmith, aaron.ballman, majnemer, rjmccall Reviewed By: rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45410 llvm-svn: 329518
* [Sema] Fix PR22637 - IndirectFieldDecl's discard qualifiers during template ↵Eric Fiselier2018-04-081-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instantiation. Summary: Currently Clang fails to propagate qualifiers from the `CXXThisExpr` to the rebuilt `FieldDecl` for IndirectFieldDecls. For example: ``` template <class T> struct Foo { struct { int x; }; int y; void foo() const { static_assert(__is_same(int const&, decltype((y)))); static_assert(__is_same(int const&, decltype((x)))); // assertion fails } }; template struct Foo<int>; ``` The fix is to delegate rebuilding of the MemberExpr to `BuildFieldReferenceExpr` which correctly propagates the qualifiers. Reviewers: rsmith, lebedev.ri, aaron.ballman, bkramer, rjmccall Reviewed By: rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45412 llvm-svn: 329517
* Generalize the swiftcall API since being passed indirectly isn'tJohn McCall2018-04-071-6/+4
| | | | | | C++-specific anymore. llvm-svn: 329513
* [Driver] Update GCC libraries detection logic for Gentoo.Manoj Gupta2018-04-072-23/+80
| | | | | | | | | | | | | | | | | 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-071-0/+13
| | | | | | | | 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-071-5/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Recommit r329442: Generate Libclang invocation reproducers using a newAlex Lorenz2018-04-071-9/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | -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
* Revert r329442 "Generate Libclang invocation reproducers using a newAlex Lorenz2018-04-061-10/+2
| | | | | | | | -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-061-2/+10
| | | | | | | | | | | | | | | | | | | | 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-061-25/+19
| | | | | | | 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-0696-152/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud