- Apr 12, 2018
-
-
Lei Huang authored
Legalize and emit code for: * xscvsdqp * xscvudqp Differential Revision: https://reviews.llvm.org/D45230 llvm-svn: 329931
-
Aaron Ballman authored
Fix the try_acquire_capability attribute to behave like the other try-lock functions. Fixes PR32954. llvm-svn: 329930
-
Benjamin Kramer authored
This is a layering violation. LTO shouldn't depend on MCJIT. The right fix for this is moving the class somewhere else. llvm-svn: 329929
-
Joachim Protze authored
llvm-svn: 329928
-
Eugene Zelenko authored
llvm-svn: 329927
-
Petar Jovanovic authored
Remove superfluous #includes. Minor code style change in MipsCallLowering::lowerFormalArguments(). llvm-svn: 329926
-
Kostya Kortchinsky authored
Summary: Now that common options are propagated again for runtimes build with D45507, the -f{data,function}-sections flags are now duplicates, remove them. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: mgorny, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D45575 llvm-svn: 329925
-
Aaron Ballman authored
Correctly diagnose when a conversion function is declared with a type qualifier in the declaration specifiers rather than in the conversion type id. Fixes PR30595. llvm-svn: 329924
-
Krzysztof Parzyszek authored
llvm-svn: 329923
-
Jessica Paquette authored
AFI->setRedZone(false) was put in the wrong place before, and so it only fired on functions that didn't have stack frames. This moves that to the top of emitPrologue to make sure that every function without a redzone has it set correctly. This also adds a function representing one of the early exit cases (GHC calling convention) to the MachineOutliner noredzone test to ensure that we can outline from functions like these, where we never use a redzone. llvm-svn: 329922
-
Ben Hamilton authored
I broke this test in D45498 when I changed the formatter to remove spaces before Objective-C lightweight generics. This fixes the test. Test Plan: % make -j16 check-llvm-tools-llvm-lit && ./bin/llvm-lit -sv ../llvm/tools/clang/test/Index/comment-objc-parameterized-classes.m llvm-svn: 329921
-
Sanjay Patel authored
This change is exposing UB in source code - as was warned/predicted. :) See D44909 for discussion. Reverting while we figure out how to fix things. llvm-svn: 329920
-
Ben Hamilton authored
Summary: Previously, `clang-format` would break Objective-C category extensions after the opening parenthesis to avoid breaking the protocol list: ``` % echo "@interface ccccccccccccc (ccccccccccc) <ccccccccccccc> { }" | \ clang-format -assume-filename=foo.h -style="{BasedOnStyle: llvm, \ ColumnLimit: 40}" @interface ccccccccccccc ( ccccccccccc) <ccccccccccccc> { } ``` This looks fairly odd, as we could have kept the category extension on the previous line. Category extensions are a single item, so they are generally very short compared to protocol lists. We should prefer breaking after the opening `<` of the protocol list over breaking after the opening `(` of the category extension. With this diff, we now avoid breaking after the category extension's open paren, which causes us to break after the protocol list's open angle bracket: ``` % echo "@interface ccccccccccccc (ccccccccccc) <ccccccccccccc> { }" | \ ./bin/clang-format -assume-filename=foo.h -style="{BasedOnStyle: llvm, \ ColumnLimit: 40}" @interface ccccccccccccc (ccccccccccc) < ccccccccccccc> { } ``` Test Plan: New test added. Confirmed test failed before diff and passed after diff by running: % make -j16 FormatTests && ./tools/clang/unittests/Format/FormatTests Reviewers: djasper, jolesiak Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D45526 llvm-svn: 329919
-
Ben Hamilton authored
Summary: This diff improves the Objective-C guessing heuristic by replacing the hard-coded list of a subset of Objective-C @keywords with a general check which supports all @keywords. I also added a few more Foundation keywords which were missing from the heuristic. Test Plan: Unit tests updated. 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/D45521 llvm-svn: 329918
-
Ben Hamilton authored
Summary: In D45185, I added clang-format parser support for Objective-C generics. However, I didn't touch the whitespace logic, so they got the same space logic as Objective-C protocol lists. In every example in the Apple SDK and in the documentation, there is no space between the class name and the opening `<` for the lightweight generic specification, so this diff removes the space and updates the tests. Test Plan: Tests updated. 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/D45498 llvm-svn: 329917
-
Ben Hamilton authored
Summary: Currently, indentation of Objective-C method names which are wrapped onto the next line due to a long return type is controlled by the style option `IndentWrappedFunctionNames`. This diff changes the behavior so we always indent wrapped Objective-C selector names. NOTE: I partially reverted https://github.com/llvm-mirror/clang/commit/6159c0fbd1876c7f5f984b4830c664cc78f16e2e / rL242484, as it was causing wrapped selectors to be double-indented. Its tests in FormatTestObjC.cpp still pass. Test Plan: Tests updated. Ran tests with: % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests Reviewers: djasper, jolesiak, stephanemoore, thakis Reviewed By: djasper Subscribers: stephanemoore, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D45004 llvm-svn: 329916
-
Krzysztof Parzyszek authored
There are cases when individual NodeSets can be equal with respect to the ordering criteria. Since they are stored in an ordered container, use stable_sort to preserve the relative order of equal NodeSets. This should remove non-determinism discovered by shuffling done in llvm::sort with expensive checks enabled. llvm-svn: 329915
-
Malcolm Parsons authored
Summary: This patch adds two new diagnostics, which are off by default: **-Wreturn-std-move** This diagnostic is enabled by `-Wreturn-std-move`, `-Wmove`, or `-Wall`. Diagnose cases of `return x` or `throw x`, where `x` is the name of a local variable or parameter, in which a copy operation is performed when a move operation would have been available. The user probably expected a move, but they're not getting a move, perhaps because the type of "x" is different from the return type of the function. A place where this comes up in the wild is `stdext::inplace_function<Sig, N>` which implements conversion via a conversion operator rather than a converting constructor; see https://github.com/WG21-SG14/SG14/issues/125#issue-297201412 Another place where this has come up in the wild, but where the fix ended up being different, was try { ... } catch (ExceptionType ex) { throw ex; } where the appropriate fix in that case was to replace `throw ex;` with `throw;`, and incidentally to catch by reference instead of by value. (But one could contrive a scenario where the slicing was intentional, in which case throw-by-move would have been the appropriate fix after all.) Another example (intentional slicing to a base class) is dissected in https://github.com/accuBayArea/Slides/blob/master/slides/2018-03-07.pdf **-Wreturn-std-move-in-c++11** This diagnostic is enabled only by the exact spelling `-Wreturn-std-move-in-c++11`. Diagnose cases of "return x;" or "throw x;" which in this version of Clang *do* produce moves, but which prior to Clang 3.9 / GCC 5.1 produced copies instead. This is useful in codebases which care about portability to those older compilers. The name "-in-c++11" is not technically correct; what caused the version-to-version change in behavior here was actually CWG 1579, not C++14. I think it's likely that codebases that need portability to GCC 4.9-and-earlier may understand "C++11" as a colloquialism for "older compilers." The wording of this diagnostic is based on feedback from @rsmith. **Discussion** Notice that this patch is kind of a negative-space version of Richard Trieu's `-Wpessimizing-move`. That diagnostic warns about cases of `return std::move(x)` that should be `return x` for speed. These diagnostics warn about cases of `return x` that should be `return std::move(x)` for speed. (The two diagnostics' bailiwicks do not overlap: we don't have to worry about a `return` statement flipping between the two states indefinitely.) I propose to write a paper for San Diego that would relax the implicit-move rules so that in C++2a the user //would// see the moves they expect, and the diagnostic could be re-worded in a later version of Clang to suggest explicit `std::move` only "in C++17 and earlier." But in the meantime (and/or forever if that proposal is not well received), this diagnostic will be useful to detect accidental copy operations. Reviewers: rtrieu, rsmith Reviewed By: rsmith Subscribers: lebedev.ri, Rakete1111, rsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D43322 Patch by Arthur O'Dwyer. llvm-svn: 329914
-
Simon Dardis authored
llvm-svn: 329913
-
Simon Pilgrim authored
llvm-svn: 329912
-
Anastasia Stulova authored
This is std option for OpenCL C++ v1.0. Differential Revision: https://reviews.llvm.org/D45363 llvm-svn: 329911
-
Benjamin Kramer authored
This reverts commit r329865. Causes stage2/stage3 miscompare. llvm-svn: 329910
-
Sander de Smalen authored
Summary: Merged 'addVectorList64Operands' and 'addVectorList128Operands' into a generic 'addVectorListOperands', which can be easily extended to work for SVE vectors. This is patch [4/6] in a series to add assembler/disassembler support for SVE's contiguous ST1 (scalar+imm) instructions. Reviewers: fhahn, rengolin, javed.absar, huntergr, SjoerdMeijer, t.p.northover, echristo, evandro Reviewed By: rengolin Subscribers: kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D45430 llvm-svn: 329909
-
Francis Visoiu Mistrih authored
Don't assume SelectionDAG is non-null as the targets can use it with a null pointer. Differential Revision: https://reviews.llvm.org/D44611 llvm-svn: 329908
-
Sam Parker authored
Created a helper function to query for non negative SCEVs. Uses the SGE predicate to catch constants that could be interpreted as negative. Differential Revision: https://reviews.llvm.org/D45481 llvm-svn: 329907
-
Simon Pilgrim authored
llvm-svn: 329906
-
Simon Dardis authored
Reviewers: atanasyan, abeserminji Differential Revision: https://reviews.llvm.org/D44436 llvm-svn: 329905
-
Aaron Ballman authored
Allow [[maybe_unused]] on static data members; these are considered variables and the attribute should appertain to them. Patch by S. B. Tam. llvm-svn: 329904
-
Simon Pilgrim authored
llvm-svn: 329903
-
Roman Lebedev authored
Summary: Pretty straight-forward, just count all the variable declarations in the function's body, and if more than the configured threshold - do complain. Note that this continues perverse practice of disabling the new option by default. I'm not certain where is the balance point between not being too noisy, and actually enforcing the good practice. If we really want to not disable this by default, but also to not cause too many new warnings, we could default to 50 or so. But that is a lot of variables too... I was able to find one coding style referencing variable count: - https://www.kernel.org/doc/html/v4.15/process/coding-style.html#functions > Another measure of the function is the number of local variables. They shouldn’t exceed 5-10, or you’re doing something wrong. Reviewers: hokein, xazax.hun, JonasToth, aaron.ballman, alexfh Reviewed By: aaron.ballman Subscribers: kimgr, Eugene.Zelenko, rnkovacs, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D44602 llvm-svn: 329902
-
Roman Lebedev authored
Summary: The fold added in D45108 did not account for the fact that the and instruction is commutative, and if the mask is a variable, the mask variable and the fold variable may be swapped. I have noticed this by accident when looking into [[ https://bugs.llvm.org/show_bug.cgi?id=6773 | PR6773 ]] Reviewers: spatel, craig.topper Reviewed By: spatel Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45538 llvm-svn: 329901
-
Sander de Smalen authored
Summary: Added 'RegisterKind' to the VectorListOp structure, so that this operand type can be reused for SVE vector lists in a later patch. It also refactors the 'tryParseVectorList' function so it can be used directly in the ParserMethod of an operand. The parsing can now parse multiple kinds of vectors and recover if there is no match. This is patch [3/6] in a series to add assembler/disassembler support for SVE's contiguous ST1 (scalar+imm) instructions. Reviewers: fhahn, rengolin, javed.absar, huntergr, SjoerdMeijer, t.p.northover, echristo, evandro Reviewed By: rengolin Subscribers: kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D45429 llvm-svn: 329900
-
Shiva Chen authored
Summary: According RISC-V ELF psABI specification, base RV32 and RV64 ISAs only allow 32-bit instruction alignment, but instruction allow to be aligned to 16-bit boundaries for C-extension. So we just align to 4 bytes and 2 bytes for C-extension is enough. Reviewers: asb, apazos Differential Revision: https://reviews.llvm.org/D45560 Patch by Kito Cheng. llvm-svn: 329899
-
Simon Pilgrim authored
llvm-svn: 329898
-
Jonas Devlieghere authored
This reverts r329891 because the test case is timing out on linux: http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/21834 llvm-svn: 329897
-
Simon Pilgrim authored
llvm-svn: 329896
-
Andrea Di Biagio authored
llvm-svn: 329895
-
Benjamin Kramer authored
The cleanup logic reads from this for cleanups even if reformatting is not requested. Found by msan. llvm-svn: 329894
-
Simon Pilgrim authored
First of a number of commits to remove x86 schedule itineraries entirely - approved off-line with @craig.topper llvm-svn: 329893
-
Roman Lebedev authored
Fixes build: [1/3] Linking CXX shared library lib/libclangApplyReplacements.so.7svn FAILED: lib/libclangApplyReplacements.so.7svn <...> /usr/local/bin/ld.lld: error: undefined symbol: clang::tooling::AtomicChange::replace(clang::SourceManager const&, clang::SourceLocation, unsigned int, llvm::StringRef) >>> referenced by ApplyReplacements.cpp >>> tools/clang/tools/extra/clang-apply-replacements/CMakeFiles/clangApplyReplacements.dir/lib/Tooling/ApplyReplacements.cpp.o:(clang::replace::mergeAndDeduplicate(std::vector<clang::tooling::TranslationUnitReplacements, std::allocator<clang::tooling::TranslationUnitReplacements> > const&, std::vector<clang::tooling::TranslationUnitDiagnostics, std::allocator<clang::tooling::TranslationUnitDiagnostics> > const&, llvm::DenseMap<clang::FileEntry const*, std::vector<clang::tooling::AtomicChange, std::allocator<clang::tooling::AtomicChange> >, llvm::DenseMapInfo<clang::FileEntry const*>, llvm::detail::DenseMapPair<clang::FileEntry const*, std::vector<clang::tooling::AtomicChange, std::allocator<clang::tooling::AtomicChange> > > >&, clang::SourceManager&)) /usr/local/bin/ld.lld: error: undefined symbol: clang::tooling::applyAtomicChanges[abi:cxx11](llvm::StringRef, llvm::StringRef, llvm::ArrayRef<clang::tooling::AtomicChange>, clang::tooling::ApplyChangesSpec const&) >>> referenced by ApplyReplacements.cpp >>> tools/clang/tools/extra/clang-apply-replacements/CMakeFiles/clangApplyReplacements.dir/lib/Tooling/ApplyReplacements.cpp.o:(clang::replace::applyChanges[abi:cxx11](llvm::StringRef, std::vector<clang::tooling::AtomicChange, std::allocator<clang::tooling::AtomicChange> > const&, clang::tooling::ApplyChangesSpec const&, clang::DiagnosticsEngine&)) clang: error: linker command failed with exit code 1 (use -v to see invocation) Refs. D43764, rL329813 llvm-svn: 329892
-