summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [Tooling] Optimize memory usage in InMemoryToolResults.Haojian Wu2018-04-113-6/+27
| | | | | | | | | | | | | | Avoid storing duplicated "std::string"s. clangd's global-symbol-builder takes 20+GB memory running across LLVM repository. With this patch, the used memory is ~10GB (running on 48 threads, most of meory are AST-related). Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D45479 llvm-svn: 329784
* [Analyzer] SValBuilder Comparison Rearrangement (with Restrictions and ↵Adam Balogh2018-04-116-12/+1223
| | | | | | | | | | | | | | | | Analyzer Option) Since the range-based constraint manager (default) is weak in handling comparisons where symbols are on both sides it is wise to rearrange them to have symbols only on the left side. Thus e.g. A + n >= B + m becomes A - B >= m - n which enables the constraint manager to store a range m - n .. MAX_VALUE for the symbolic expression A - B. This can be used later to check whether e.g. A + k == B + l can be true, which is also rearranged to A - B == l - k so the constraint manager can check whether l - k is in the range (thus greater than or equal to m - n). The restriction in this version is the the rearrangement happens only if both the symbols and the concrete integers are within the range [min/4 .. max/4] where min and max are the minimal and maximal values of their type. The rearrangement is not enabled by default. It has to be enabled by using -analyzer-config aggressive-relational-comparison-simplification=true. Co-author of this patch is Artem Dergachev (NoQ). Differential Revision: https://reviews.llvm.org/D41938 llvm-svn: 329780
* Adding fuzzer flags support to OpenBSD driverDean Michael Berris2018-04-111-1/+4
| | | | | | | | | | | | | | Summary: - Following-up the sanitizer's part commit https://reviews.llvm.org/rCRT329631, we enable fuzzer flags. Reviewers: brad, thakis, dberris Reviewed By: dberris Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D44878 llvm-svn: 329779
* [X86] Fix typo in intrinsic header file __mask16->__mmask16 from r329775.Craig Topper2018-04-111-2/+2
| | | | llvm-svn: 329777
* [X86] Replace 512-bit masked pmaddubsw and pmaddwd intrinsic with unmasked ↵Craig Topper2018-04-113-40/+33
| | | | | | | | | | intrinsic and a select. This makes it consistent with the 128/256-bit functions. Someday maybe we'll have all the masking moved to selects. llvm-svn: 329775
* [XRay][clang] Only enable test for supported platformsDean Michael Berris2018-04-111-0/+2
| | | | | | This is a follow-up to D45474. llvm-svn: 329773
* [XRay][clang+compiler-rt] Support build-time mode selectionDean Michael Berris2018-04-115-6/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-105-143/+239
| | | | | | warnings; other minor fixes (NFC). llvm-svn: 329766
* Introduce a new builtin, __builtin_dump_struct, that is useful for dumping ↵Aaron Ballman2018-04-105-0/+591
| | | | | | | | 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-108-95/+133
| | | | | | 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-106-12/+136
| | | | | | | | | | 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-1019-234/+55
| | | | | | https://reviews.llvm.org/D43578. llvm-svn: 329739
* [X86] Add test case for llvm change r329734Craig Topper2018-04-101-0/+7
| | | | | | This test ensures the popfd instruction in MS inline assembly can properly find a clobber name for the dirflag register. Previously the register was named 'DF', but it needs to be named 'dirflag' to match the name in the GCC register name list. llvm-svn: 329738
* [CUDA] Added --[no-]cuda-include-ptx=sm_XX|all option.Artem Belevich2018-04-104-0/+78
| | | | | | | | | | | | | | 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-102-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* I removed the failed test.Andrew V. Tischenko2018-04-101-147/+0
| | | | llvm-svn: 329714
* [X86] Disable SGX for Skylake Server - CPP testGabor Buella2018-04-101-2/+2
| | | | | | | | | | | | | | Summary: Fix test case - corresponding to r329701 Reviewers: craig.topper, davezarzycki Reviewed By: davezarzycki Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45488 llvm-svn: 329710
* 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
* The test was fixed.Andrew V. Tischenko2018-04-101-1/+1
| | | | llvm-svn: 329693
* CodeGen tests - typo fixes NFCGabor Buella2018-04-102-15/+15
| | | | llvm-svn: 329689
* [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-1020-55/+381
| | | | | | | | | | 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-105-85/+299
| | | | | | | | | | | | | | | 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
* [AST] Attempt to fix buildbot warnings + appease MSVC; NFCIGeorge Burgess IV2018-04-101-5/+8
| | | | | | | | | | | | | | | | GCC 4.8.4 on a bot was warning about `ArgPassingKind` not fitting in `ArgPassingRestrictions`, which appears to be incorrect, since `ArgPassingKind` only has three potential values: "warning: 'clang::RecordDecl::ArgPassingRestrictions' is too small to hold all values of 'enum clang::RecordDecl::ArgPassingKind'" Additionally, I remember hearing (though my knowledge may be outdated) that MSVC won't merge adjacent bitfields if their types are different. Try to fix both issues by turning these into `uint8_t`s. llvm-svn: 329652
* [ObjC++] Never pass structs that transitively contain __weak fields inAkira Hatanaka2018-04-0911-47/+102
| | | | | | | | | | | | | | | | | | | | 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-094-274/+233
| | | | llvm-svn: 329630
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2018-04-092-426/+432
| | | | | | minor fixes (NFC). llvm-svn: 329628
* Revert "[ObjC++] Never pass structs that transitively contain __weak fields in"Akira Hatanaka2018-04-0911-102/+47
| | | | | | | | 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-0911-47/+102
| | | | | | | | | | | | | | 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-094-93/+63
| | | | | | | | | | | | | | | | | -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-093-64/+10
| | | | | | | | | | | | | 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-096-18/+108
| | | | | | | | 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-094-0/+576
| | | | | | | | | | | | 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-096-46/+31
| | | | | | | | | | | | | | | | | | 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
* Try to fix libclang reproducer tests after r329465Hans Wennborg2018-04-091-2/+2
| | | | | | | | | | | | | | | | | | | | They were failing on Windows because the output YAML didn't parse: YAML:1:664: error: Unrecognized escape code! {"toolchain":"D:\\buildslave\\clang-x64-ninja-win7\\stage1", "libclang.operation":"complete", "libclang.opts":1, "args":["clang", "-fno-spell-checking", "D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\test\Index\create-libclang-completion-reproducer.c", "-Xclang", "-detailed-preprocessing-record", "-fallow-editor-placeholders"], "invocation-args":["-code-completion-at=D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\test\Index\create-libclang-completion-reproducer.c:10:1"], "unsaved_file_hashes":[{"name":"D:\\buildslave\\clang-x64-ninja-win7\\llvm\\tools\\clang\\test\\Index\\create-libclang-completion-reproducer.c", "md5":"aee23773de90e665992b48209351d70e"}]} This adds some more escaping to try to make it work. llvm-svn: 329558
* [XRay][llvm+clang] Consolidate attribute list filesDean Michael Berris2018-04-0912-13/+111
| | | | | | | | | | | | | | | | | | | | | | | | 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-083-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-082-20/+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-082-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-083-6/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [libclang] Add clang_File_tryGetRealPathNameFangrui Song2018-04-074-0/+31
| | | | | | | | | | | | | | | | | | | | | Summary: clang_getFileName() may return a path relative to WorkingDir. On Arch Linux, during clang_indexTranslationUnit(), clang_getFileName() on CXIdxIncludedIncludedFileInfo::file may return "/../lib64/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/string", for `#include <string>`. I presume WorkingDir is somehow changed to /usr/lib or /usr/include and clang_getFileName() returns a path relative to WorkingDir. clang_File_tryGetRealPathName() returns "/usr/include/c++/7.3.0/string" which is more useful for the indexer in this case. Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D42893 llvm-svn: 329515
* Generalize the swiftcall API since being passed indirectly isn'tJohn McCall2018-04-072-10/+14
| | | | | | C++-specific anymore. llvm-svn: 329513
OpenPOWER on IntegriCloud