summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert part of r. 325746 D43378Kamil Rytarowski2018-02-221-1/+1
| | | | | | test/Driver/XRay/xray-shared-noxray.cpp fails on !Linux hosts. llvm-svn: 325748
* FreeBSD driver / Xray flags moving pthread to compile flags.Kamil Rytarowski2018-02-225-9/+16
| | | | | | | | | | | | | | | | | | Summary: - Using -lpthread instead, with -pthread the linkage does not work. -Warning about the -fxray-instrument usage outside of the working cases. Patch by: David CARLIER Reviewers: krytarowski, vitalybuka, dberris, emaste Reviewed By: krytarowski, emaste Subscribers: srhines, emaste, cfe-commits Differential Revision: https://reviews.llvm.org/D43378 llvm-svn: 325746
* [ODRHash] Fix hashing for friend functions.Richard Trieu2018-02-226-7/+120
| | | | | | | When hashing a templated function, use the hash of the function it was instantiated from. llvm-svn: 325742
* [ODRHash] Handle some template weirdness.Richard Trieu2018-02-223-21/+46
| | | | | | | | Build the index off of DeclarationName instead of Decl pointers. When finding an UnresolvedLookupExprClass, hash it as if it were a DeclRefExpr. This will allow methods to be hashed. llvm-svn: 325741
* [Driver] Generate .eh_frame_hdr for static executables too.Dan Albert2018-02-212-4/+2
| | | | | | | | | | | | | | Summary: libgcc won't unwind without an .eh_frame_hdr section. Reviewers: srhines, chandlerc Reviewed By: chandlerc Subscribers: chandlerc, cfe-commits Differential Revision: https://reviews.llvm.org/D43203 llvm-svn: 325733
* CodeGen: handle blocks correctly when inalloca'edSaleem Abdulrasool2018-02-212-2/+16
| | | | | | | | | | When using blocks with C++ on Windows x86, it is possible to have the block literal be pushed into the inalloca'ed parameters. Teach IRGen to handle the case properly by extracting the block literal from the inalloca parameter. This fixes the use of blocks with C++ on Windows x86. llvm-svn: 325724
* [clang-format] Fix regression when getStyle() called with empty filenameBen Hamilton2018-02-212-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: D43522 caused an assertion failure when getStyle() was called with an empty filename: P8065 This adds a test to reproduce the failure and fixes the issue by ensuring we never pass an empty filename to Environment::CreateVirtualEnvironment(). Test Plan: New test added. Ran test with: % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests Before diff, test failed with P8065. Now, test passes. Reviewers: vsapsai, jolesiak, krasimir Reviewed By: vsapsai Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D43590 llvm-svn: 325722
* Replace incorrect usage of isInvalidDecl with intended setInvalidDecl Erich Keane2018-02-211-1/+1
| | | | | | | This typo would cause an attempt to multiversion 'main' to issue an error, but not mark the function as invalid. This patch fixes it. llvm-svn: 325716
* [analyzer] Prevent AnalyzerStatsChecker from crashPeter Szecsi2018-02-212-1/+19
| | | | | | | | | | | | The checker marks the locations where the analyzer creates sinks. However, it can happen that the sink was created because of a loop which does not contain condition statement, only breaks in the body. The exhausted block is the block which should contain the condition but empty, in this case. This change only emits this marking in order to avoid the undefined behavior. Differential Revision: https://reviews.llvm.org/D42266 llvm-svn: 325693
* Remove use of the 'gmlt' term from the -fsplit-dwarf-inlining flag ↵David Blaikie2018-02-211-1/+1
| | | | | | description to make it more readily legible llvm-svn: 325692
* [clang-format] New API guessLanguage()Ben Hamilton2018-02-213-11/+52
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: For clients which don't have a filesystem, calling getStyle() doesn't make much sense (there's no .clang-format files to search for). In this diff, I hoist out the language-guessing logic from getStyle() and move it into a new API guessLanguage(). I also added support for guessing the language of files which have no extension (they could be C++ or ObjC). Test Plan: New tests added. Ran tests with: % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests Reviewers: jolesiak, krasimir Reviewed By: jolesiak, krasimir Subscribers: klimek, cfe-commits, sammccall Differential Revision: https://reviews.llvm.org/D43522 llvm-svn: 325691
* [ASTMatchers] Regenerate documentation after r325678Eric Liu2018-02-211-0/+6
| | | | llvm-svn: 325682
* [ASTMatchers] isTemplateInstantiation: also match explicit instantiation ↵Eric Liu2018-02-212-1/+15
| | | | | | | | | | | | | | | | | | declaration. Summary: Example: template <typename T> class X {}; class A {}; // Explicit instantiation declaration. extern template class X<A>; Reviewers: bkramer Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D43567 llvm-svn: 325678
* [Sema] Classify conversions from enum to float as narrowingMikhail Maltsev2018-02-212-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: According to [dcl.init.list]p7: A narrowing conversion is an implicit conversion - ... - from an integer type or unscoped enumeration type to a floating-point type, except where the source is a constant expression and the actual value after conversion will fit into the target type and will produce the original value when converted back to the original type, or - ... Currently clang does not handle the 'unscoped enumeration' case. This patch fixes the corresponding check. Reviewers: faisalv, rsmith, rogfer01 Reviewed By: rogfer01 Subscribers: rogfer01, cfe-commits Differential Revision: https://reviews.llvm.org/D42545 llvm-svn: 325668
* [Fuchsia] Include libClang and clang-include-fixer in the toolchainPetr Hosek2018-02-211-0/+2
| | | | | | | | | libClang is used by other Clang based tools such as cquery while clang-include-fixer is generally a useful tool. Differential Revision: https://reviews.llvm.org/D43404 llvm-svn: 325665
* In C++14 onwards, it is permitted to read mutable members in constantRichard Smith2018-02-212-10/+45
| | | | | | | | | expressions, if their lifetime began during the evaluation of the expression. This is technically not allowed in C++11, though we could consider permitting it there too, as an extension. llvm-svn: 325663
* Clean up use of C allocation functionsSerge Pavlov2018-02-219-13/+29
| | | | | | | | | | | | | | | | If the value returned by `malloc`, `calloc` or `realloc` is not checked for null pointer, this change replaces them for `safe_malloc`, `safe_calloc` or `safe_realloc`, which are defined in the namespace `llvm`. These function report fatal error on out of memory. In the plain C files, assertion statements are added to ensure that memory is successfully allocated. The aim of this change is to get better diagnostics of OOM on Windows. Differential Revision: https://reviews.llvm.org/D43017 llvm-svn: 325661
* [Sema] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-02-217-250/+485
| | | | | | other minor fixes (NFC). llvm-svn: 325659
* [X86] Disable CLWB in Cannon LakeCraig Topper2018-02-212-3/+4
| | | | | | | | | | | Cannon Lake does not support CLWB, therefore it does not include all features listed under SKX. Patch by Gabor Buella Differential Revision: https://reviews.llvm.org/D43459 llvm-svn: 325655
* [mips] Spectre variant two mitigation for MIPSR2Simon Dardis2018-02-217-1/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch provides mitigation for CVE-2017-5715, Spectre variant two, which affects the P5600 and P6600. It provides the option -mindirect-jump=hazard, which instructs the LLVM backend to replace indirect branches with their hazard barrier variants. This option is accepted when targeting MIPS revision two or later. The migitation strategy suggested by MIPS for these processors is to use two hazard barrier instructions. 'jalr.hb' and 'jr.hb' are hazard barrier variants of the 'jalr' and 'jr' instructions respectively. These instructions impede the execution of instruction stream until architecturally defined hazards (changes to the instruction stream, privileged registers which may affect execution) are cleared. These instructions in MIPS' designs are not speculated past. These instructions are used with the option -mindirect-jump=hazard when branching indirectly and for indirect function calls. These instructions are defined by the MIPS32R2 ISA, so this mitigation method is not compatible with processors which implement an earlier revision of the MIPS ISA. Implementation note: I've opted to provide this as an -mindirect-jump={hazard,...} style option in case alternative mitigation methods are required for other implementations of the MIPS ISA in future, e.g. retpoline style solutions. Reviewers: atanasyan Differential Revision: https://reviews.llvm.org/D43487 llvm-svn: 325651
* Fix assert when template argument deduction's original call arg checking ↵Richard Smith2018-02-202-1/+9
| | | | | | triggers class template instantiation. llvm-svn: 325646
* When multiple sanitizers are enabled (ubsan + something else), use all ↵Richard Smith2018-02-202-37/+33
| | | | | | | | | | relevant blacklists. Ideally, we'd only use the ubsan blacklist for ubsan sanitizers, and only use the other-sanitizer blacklist for its sanitizers, but this at least enables the intended suppressions. llvm-svn: 325640
* [NFC] In Multiversion Check function, switch to return DiagErich Keane2018-02-201-67/+47
| | | | | | | | This function did a lot of 'Diag, return true' stuff. This resulted in needing to introduce scopes in quite a few places. This patch replaces useages of a single "S.Diag" followed by return true with simply "return S.Diag". llvm-svn: 325633
* [CUDA] Added missing __threadfence_system() function for CUDA9.Artem Belevich2018-02-201-0/+1
| | | | llvm-svn: 325626
* Correct multiversion unsupported target behavior, add a test.Erich Keane2018-02-202-0/+14
| | | | | | | | | | Multiversioning SEMA failed to set the declaration as invalid on unsupported targets. This patch does that. Additionally, I noticed that there is no test to validate this error message. This patch adds one, and uses 'mips' as the test architecture. llvm-svn: 325610
* PR36442: Correct description of -fsplit-dwarf-inliningDavid Blaikie2018-02-201-1/+1
| | | | llvm-svn: 325594
* Stop linking sanitized applications with -lutil and -lkvm on NetBSDKamil Rytarowski2018-02-201-6/+0
| | | | | | | | | The proper approach is to rebuild libutil and libkvm with a desired sanitizer. An alternative approach to reimplement these functions (and other ones like curses(3), editline(3) etc) does not scale and enforces linkage every single binary with these libraries. llvm-svn: 325593
* Revert r325375 "[MS] Make constexpr static data members implicitly inline"Hans Wennborg2018-02-202-37/+5
| | | | | | | | | | | | | | | | This broke Clang bootstrap on Windows, PR36453. > This handles them exactly the same way that we handle const integral > static data members with inline definitions, which is what MSVC does. > > As a follow-up, now that we have a way to mark variables inline in the > AST, we should consider marking them implicitly inline there instead of > only treating them as inline in CodeGen. Unfortunately, this breaks a > lot of dllimport test cases, so that is future work for now. > > Fixes PR36125. llvm-svn: 325576
* [CodeGen] Fix generation of TBAA tags for may-alias accessesIvan A. Kosarev2018-02-204-32/+64
| | | | | | | | | | | This patch fixes creating TBAA access descriptors for may_alias-marked access types. Currently, for such types we generate ordinary descriptors with char as its access type. The patch changes this to produce proper may-alias descriptors. Differential Revision: https://reviews.llvm.org/D42366 llvm-svn: 325575
* clang-cl: Make /d1PP an alias for -dD (PR36446)Hans Wennborg2018-02-202-0/+5
| | | | llvm-svn: 325571
* clang-format plugin: Add missing semicolon in list of file extensions (PR36383)Hans Wennborg2018-02-201-1/+1
| | | | llvm-svn: 325566
* [X86] Remove mask from 512 bit pmulhrsw/pmulhw/pmulhuw builtins.Craig Topper2018-02-203-58/+47
| | | | | | We now use a vselect node in IR around an unmasked builtin. This makes it consistent with the 128 and 256 bit versions. llvm-svn: 325560
* [Sema] Fix -Wunused-variableSam McCall2018-02-201-1/+0
| | | | llvm-svn: 325553
* Fix some -Wexceptions false positives.Richard Smith2018-02-202-73/+106
| | | | | | | | | Reimplement the "noexcept function actually throws" warning to properly handle nested try-blocks. In passing, change 'throw;' handling to treat any enclosing try block as being sufficient to suppress the warning rather than requiring a 'catch (...)'; the warning is intended to be conservatively-correct. llvm-svn: 325545
* [Sema] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-02-205-257/+370
| | | | | | other minor fixes (NFC). llvm-svn: 325544
* Fix test failure on target where size_t is long long.Richard Smith2018-02-191-3/+6
| | | | llvm-svn: 325540
* Add several more attributes to be parsed in C with [[]] when ↵Aaron Ballman2018-02-192-39/+72
| | | | | | | | -fdouble-square-bracket-attributes is specified. Also flags a few attributes that should not be available with the C spelling as they only matter in C++. llvm-svn: 325520
* [clang-format] Fix text proto extension scope opening detectionKrasimir Georgiev2018-02-192-0/+9
| | | | | | | | | | | | | | | | | | | | Summary: This fixes the detection of scope openers in text proto extensions; previously they were not detected correctly leading to instances like: ``` msg { [aa.bb ] { key: value } } ``` Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D43469 llvm-svn: 325513
* [clang-format] Fixup a case of text proto message attributesKrasimir Georgiev2018-02-192-0/+16
| | | | | | | | | | Summary: This patch fixes a case where a proto message attribute is wrongly identified as an text proto extension. Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D43465 llvm-svn: 325509
* [CodeComplete] Avoid name clashes of 'Kind' inside CodeCompletionContext. NFCIlya Biryukov2018-02-192-13/+12
| | | | | | | | | | CodeCompletionContext had declarations of field and enum inside, both named 'Kind'. It caused gcc 4.8 to give an incorrent warning when refering to enum as `enum CodeCompletionContext::Kind`. Avoid that warning by renaming the private field to CCKind. llvm-svn: 325496
* [ARM] disable FPU features when using soft floating point.Keith Walker2018-02-195-68/+458
| | | | | | | | | | | | | | | | | | | | | | | | | | | To be compatible with GCC if soft floating point is in effect any FPU specified is effectively ignored, eg, -mfloat-abi=soft -fpu=neon If any floating point features which require FPU hardware are enabled they must be disable. There was some support for doing this for NEON, but it did not handle VFP, nor did it prevent the backend from emitting the build attribute Tag_FP_arch describing the generated code as using the floating point hardware if a FPU was specified (even though soft float does not use the FPU). Disabling the hardware floating point features for targets which are compiling for soft float has meant that some tests which were incorrectly checking for hardware support also needed to be updated. In such cases, where appropriate the tests have been updated to check compiling for soft float and a non-soft float variant (usually softfp). This was usually because the target specified in the test defaulted to soft float. Differential Revision: https://reviews.llvm.org/D42569 llvm-svn: 325492
* [CodeComplete] Add a helper to print CodeCompletionContext::KindIlya Biryukov2018-02-192-0/+78
| | | | | | | | | | | | | | Summary: Will be used in clangd. See D43377. Reviewers: sammccall Reviewed By: sammccall Subscribers: ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D43379 llvm-svn: 325490
* clang-format: [JS] fix `of` detection.Martin Probst2018-02-192-1/+2
| | | | | | | | | | | | | | | | | | | Summary: `of` is only a keyword when after an identifier, but not when after an actual keyword. Before: return of (a, b, c); After: return of(a, b, c); Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D43440 llvm-svn: 325489
* [AVR] Set the program address space in the data layoutDylan McKay2018-02-191-1/+1
| | | | | | This is accompanied by r325481 in LLVM. llvm-svn: 325483
* [CodeGen] Initialize large arrays by copying from a globalIvan A. Kosarev2018-02-192-11/+48
| | | | | | | | | | | | | | Currently, clang compiles explicit initializers for array elements into series of store instructions. For large arrays of built-in types this results in bloated output code and significant amount of time spent on the instruction selection phase. This patch fixes the issue by initializing such arrays with global constants that store the binary image of the initializer. Differential Revision: https://reviews.llvm.org/D43181 llvm-svn: 325478
* [cxx_dr_status] Tests for CWG issues 641-687.Richard Smith2018-02-192-41/+708
| | | | llvm-svn: 325475
* [Analyzer] Move UnexploredFirstStack into an anonymous namespace.Benjamin Kramer2018-02-181-0/+2
| | | | | | No functionality change intended. llvm-svn: 325468
* [X86] Add 'sahf' CPU feature to frontendDimitry Andric2018-02-174-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Make clang accept `-msahf` (and `-mno-sahf`) flags to activate the `+sahf` feature for the backend, for bug 36028 (Incorrect use of pushf/popf enables/disables interrupts on amd64 kernels). This was originally submitted in bug 36037 by Jonathan Looney <jonlooney@gmail.com>. As described there, GCC also uses `-msahf` for this feature, and the backend already recognizes the `+sahf` feature. All that is needed is to teach clang to pass this on to the backend. The mapping of feature support onto CPUs may not be complete; rather, it was chosen to match LLVM's idea of which CPUs support this feature (see lib/Target/X86/X86.td). I also updated the affected test case (CodeGen/attr-target-x86.c) to match the emitted output. Reviewers: craig.topper, coby, efriedma, rsmith Reviewed By: craig.topper Subscribers: emaste, cfe-commits Differential Revision: https://reviews.llvm.org/D43394 llvm-svn: 325446
* [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-02-1610-216/+342
| | | | | | other minor fixes (NFC). llvm-svn: 325412
* [ThinLTO] Allow indexing to request backend to ignore the moduleVitaly Buka2018-02-163-5/+38
| | | | | | | | | | | | | | | | | | Summary: Gold plugin does not add pass to ThinLTO modules without useful symbols. In this case ThinLTO can't create corresponding index file and some features, like CFI, cannot be processes by backed correctly without index. Given that we don't need the backed output we can request it to avoid processing the module. This is implemented by this patch using new "SkipModuleByDistributedBackend" flag. Reviewers: pcc, tejohnson Subscribers: mehdi_amini, inglorion, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D42995 llvm-svn: 325411
OpenPOWER on IntegriCloud