summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang-tidy] ObjC ARC objects should not trigger ↵Ben Hamilton2018-02-024-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | performance-unnecessary-value-param Summary: The following Objective-C code currently incorrectly triggers clang-tidy's performance-unnecessary-value-param check: ``` % cat /tmp/performance-unnecessary-value-param-arc.m void foo(id object) { } clang-tidy /tmp/performance-unnecessary-value-param-arc.m -checks=-\*,performance-unnecessary-value-param -- -xobjective-c -fobjc-abi-version=2 -fobjc-arc 1 warning generated. /src/llvm/tools/clang/tools/extra/test/clang-tidy/performance-unnecessary-value-param-arc.m:10:13: warning: the parameter 'object' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param] void foo(id object) { } ~~ ^ const & ``` This is wrong for a few reasons: 1) Objective-C doesn't have references, so `const &` is not going to help 2) ARC heavily optimizes the "expensive" copy which triggers the warning This fixes the issue by disabling the warning for non-C++, as well as disabling it for objects under ARC memory management for Objective-C++. Fixes https://bugs.llvm.org/show_bug.cgi?id=32075 Test Plan: New tests added. Ran tests with `make -j12 check-clang-tools`. Reviewers: alexfh, hokein Reviewed By: hokein Subscribers: stephanemoore, klimek, xazax.hun, cfe-commits, Wizard Differential Revision: https://reviews.llvm.org/D42812 llvm-svn: 324097
* Fix type sizes that were causing incorrect string formattingJames Henderson2018-02-022-3/+3
| | | | llvm-svn: 324096
* [ThinLTO] - Add comment. NFC.George Rimar2018-02-021-0/+2
| | | | | | Was requested during review of D42798. llvm-svn: 324095
* [X86][SSE] Force double domain for SHUFPD stack folding testsSimon Pilgrim2018-02-022-3/+9
| | | | llvm-svn: 324094
* [Index] fix USR generation for namespace{extern{X}}Sam McCall2018-02-022-1/+10
| | | | llvm-svn: 324093
* [Analysis] Support aggregate access types in TBAAIvan A. Kosarev2018-02-023-96/+661
| | | | | | | | | This patch implements analysis for new-format TBAA access tags with aggregate types as their final access types. Differential Revision: https://reviews.llvm.org/D41501 llvm-svn: 324092
* Correct the return value of strlcat(3) in the interceptorKamil Rytarowski2018-02-021-5/+4
| | | | | | | | | Late fix for SVN r. 324034 Add new interceptors: strlcpy(3) and strlcat(3) There was forgotten an addition of len to the return value. llvm-svn: 324091
* [clang-tidy] Kill marco. No functionality change.Benjamin Kramer2018-02-027-9/+9
| | | | llvm-svn: 324084
* [clang-tidy] Widen anonymous namespace.Benjamin Kramer2018-02-021-2/+1
| | | | | | | The matchers in this check are prone to create ODR violations otherwise. No functionality change. llvm-svn: 324083
* [AST] namespace ns { extern "C" { int X; }} prints as "ns::X", not as "X"Sam McCall2018-02-022-3/+11
| | | | llvm-svn: 324081
* [clang-tidy] Remove global constructor. No functionality change intended.Benjamin Kramer2018-02-021-4/+8
| | | | llvm-svn: 324080
* [clang-tidy] Don't reinvent the wheel, use existing log2 functions.Benjamin Kramer2018-02-021-8/+1
| | | | | | | This also makes the code ready for int128, even though I think it's currently impossible to get an int128 into this code path. llvm-svn: 324079
* Add missing new files from r324077James Henderson2018-02-028-0/+660
| | | | | | Differential Revision: https://reviews.llvm.org/D42481 llvm-svn: 324078
* [DWARF v5] Add limited support for dumping .debug_rnglistsJames Henderson2018-02-028-59/+35
| | | | | | | | | | | | | | | | | | | | | This change adds support to llvm-dwarfdump for dumping DWARF5 .debug_rnglists sections in regular ELF files. It is not complete, in that several DW_RLE_* encodings are currently not supported, but does dump the headert and the basic ranges for DW_RLE_start_length and DW_RLE_start_end encodings. Obvious next steps are to add verbose dumping that dumps the raw encodings, rather than the interpreted contents, to add -verify support of the section (e.g. to show that the correct number of offsets are specified), add dumping of .debug_rnglists.dwo, and to add support for other encodings. Reviewed by: dblaikie, JDevlieghere Differential Revision: https://reviews.llvm.org/D42481 llvm-svn: 324077
* [LTO] - Simplify. NFC.George Rimar2018-02-021-3/+2
| | | | llvm-svn: 324076
* [ThinLTO] - Fix for "ThinLTO inlines variables that should be discarded".George Rimar2018-02-023-7/+50
| | | | | | | | | | | This fixes PR36187. Patch teaches ThinLTO to drop non-prevailing variables, just like we recently did for functions (in r323633). Differential revision: https://reviews.llvm.org/D42798 llvm-svn: 324075
* [ARM] fixed some tabs/whitespaces in test. NFC.Sjoerd Meijer2018-02-021-6/+6
| | | | llvm-svn: 324074
* [clangd] Remove a unused include. NFCEric Liu2018-02-021-1/+0
| | | | llvm-svn: 324073
* [ELF] - Reimplemented duplicated-synthetic-sym.s testcase.George Rimar2018-02-021-8/+13
| | | | | | | Was suggested during review of D42635, because linking an .s file as a binary file was confusing. llvm-svn: 324072
* [GlobalOpt] Include padding in debug fragmentsMikael Holmen2018-02-023-2/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When creating the debug fragments for a SRA'd variable, use the types' allocation sizes. This fixes issues where the pass would emit too small fragments, placed at the wrong offset, for padded types. An example of this is long double on x86. The type is represented using x86_fp80, which is 10 bytes, but the value is aligned to 12/16 bytes. The padding is included in the type's DW_AT_byte_size attribute; therefore, the fragments should also include that. Newer GCC releases (I tested 7.2.0) emit 12/16-byte pieces for long double. Earlier releases, e.g. GCC 5.5.0, behaved as LLVM did, i.e. by emitting a 10-byte piece, followed by an empty 2/6-byte piece for the padding. Failing to cover all `DW_AT_byte_size' bytes of a value with non-empty pieces results in the value being printed as <optimized out> by GDB. Patch by: David Stenberg Reviewers: aprantl, JDevlieghere Reviewed By: aprantl, JDevlieghere Subscribers: llvm-commits Tags: #debug-info Differential Revision: https://reviews.llvm.org/D42807 llvm-svn: 324066
* [clangd] Skip inline namespace when collecting scopes for index symbols.Eric Liu2018-02-022-5/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Some STL symbols are defined in inline namespaces. For example, ``` namespace std { inline namespace __cxx11 { typedef ... string; } } ``` Currently, this will be `std::__cxx11::string`; however, `std::string` is desired. Inline namespaces are treated as transparent scopes. This reflects the way they're most commonly used for lookup. Ideally we'd include them, but at query time it's hard to find all the inline namespaces to query: the preamble doesn't have a dedicated list. Reviewers: sammccall, hokein Reviewed By: sammccall Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D42796 llvm-svn: 324065
* [ELF][MIPS] Change format of output relocations to Elf_RelSimon Atanasyan2018-02-025-13/+12
| | | | | | | | | | | Initially LLD generates Elf_Rel relocations for O32 ABI and Elf_Rela relocations for N32 / N64 ABIs. In other words, format of input and output relocations was always the same. Now LLD generates all output relocations using Elf_Rel format only. It conforms to ABIs requirement. The patch suggested by Alexander Richardson. llvm-svn: 324064
* [SelectionDAG] Consider endianness in scalarizeVectorStore().Jonas Paulsson2018-02-023-66/+71
| | | | | | | | | | | | When handling vectors with non byte-sized elements, reverse the order of the elements in the built integer if the target is Big-Endian. SystemZ tests updated. Review: Eli Friedman, Ulrich Weigand. https://reviews.llvm.org/D42786 llvm-svn: 324063
* [Sema] Add implicit members even for invalid CXXRecordDeclsIlya Biryukov2018-02-023-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: It should be safe, since other code paths are already generating implicit members even in invalid CXXRecordDecls (e.g. lookup). If we don't generate implicit members on CXXRecordDecl's completion, they will be generated by next lookup of constructors. This causes a crash when the following conditions are met: - a CXXRecordDecl is invalid, - it is provided via ExternalASTSource (e.g. from PCH), - it has inherited constructors (they create ShadowDecls), - lookup of its constructors was not run before ASTWriter serialized it. This may require the ShadowDecls created for inherited constructors to be removed from the class, but that's no longer possible since class is provided by ExternalASTSource. See provided lit test for an example. Reviewers: bkramer Reviewed By: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D42810 llvm-svn: 324062
* [SelectionDAG] Add an assert in getNode() for EXTRACT_VECTOR_ELT.Jonas Paulsson2018-02-021-0/+4
| | | | | | | | When getNode() is called to create an EXTRACT_VECTOR_ELT, assert that the result VT is at least as wide as the vector element type. Review: Eli Friedman llvm-svn: 324061
* [SystemZ] Update test case (NFC)Jonas Paulsson2018-02-021-2/+2
| | | | | | | | | | test/CodeGen/SystemZ/vec-trunc-to-i1.ll was marked as a temporary FAIL when it was previously updated when it needed one more COPY. This was however wrong, since the loop body had been reduced significantly, and it was actually an improvement. Review: Ulrich Weigand. llvm-svn: 324060
* [MinGW] Emit typeinfo locally for dllimported classes without key functionsMartin Storsjo2018-02-023-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | This fixes building Qt as shared libraries with clang in MinGW mode; previously subclasses of the QObjectData class (in other DLLs than the base DLL) failed to find the typeinfo symbols (that neither were emitted in the base DLL nor in the DLL containing the subclass). If the virtual destructor in the newly added testcase wouldn't be pure (or if there'd be another non-pure virtual method), it'd be a key function and things would work out even before this change. Make sure to locally emit the typeinfo for these classes as well. This matches what GCC does in this specific testcase. This fixes the root issue that spawned PR35146. (The difference to GCC that is initially described in that bug still is present though.) Differential Revision: https://reviews.llvm.org/D42641 llvm-svn: 324059
* [RISCV] Add ELFObjectFileBase::getRISCVFeatures let llvm-objdump could get ↵Shiva Chen2018-02-0210-9/+24
| | | | | | | | | | | RISCV target feature llvm-objdump could get C feature by ELF::EF_RISCV_RVC e_flag, so then we don't have to add -mattr=+c on the command line. Differential Revision: https://reviews.llvm.org/D42629 llvm-svn: 324058
* [X86] Legalize (v64i1 (bitcast (i64 X))) on 32-bit targets by extracting ↵Craig Topper2018-02-023-3232/+132
| | | | | | | | 32-bit halves from i32, bitcasting each to v32i1, and concatenating. This prevents the scalarization that would otherwise occur. llvm-svn: 324057
* [X86] Legalize (i64 (bitcast (v64i1 X))) on 32-bit targets by extracting to ↵Craig Topper2018-02-024-490/+488
| | | | | | | | v32i1 and bitcasting to i32. This saves a trip through memory and seems to open up other combining opportunities. llvm-svn: 324056
* [RISCV] Fix c.addi and c.addi16sp immediate constraints which should be non-zeroShiva Chen2018-02-023-13/+43
| | | | | | Differential Revision: https://reviews.llvm.org/D42782 llvm-svn: 324055
* [RISCV] Define getSetCCResultType for setting vector setCC typeShiva Chen2018-02-023-0/+45
| | | | | | | | To avoid trigger "No default SetCC type for vectors!" Assertion Differential Revision: https://reviews.llvm.org/D42675 llvm-svn: 324054
* [analyzer] Fix transitions in check::PreStmt<MemberExpr> checker callback.Artem Dergachev2018-02-021-5/+4
| | | | | | | | | | | No in-tree checkers use this callback so far, hence no tests. But better fix this now than remember to fix this when the checkers actually appear. Patch by Henry Wong! Differential Revision: https://reviews.llvm.org/D42785 llvm-svn: 324053
* [analyzer] Expose return statement from CallExit program pointGeorge Karpenkov2018-02-025-5/+52
| | | | | | | | | | | | | | | | If the return statement is stored, we might as well allow querying against it. Also fix the bug where the return statement is not stored if there is no return value. This change un-merges two ExplodedNodes during call exit when the state is otherwise identical - the CallExitBegin node itself and the "Bind Return Value"-tagged node. And expose the return statement through getStatement helper function. Differential Revision: https://reviews.llvm.org/D42130 llvm-svn: 324052
* [AArch64][GlobalISel] Fix old use of % sigil in test.Amara Emerson2018-02-021-2/+2
| | | | | | My rebase had missed the new $ sigil we're using. llvm-svn: 324051
* Remove the change which accidentally crept in into the cherry-pickGeorge Karpenkov2018-02-021-1/+0
| | | | llvm-svn: 324050
* [analyzer] Expose exploration strategy through analyzer options.George Karpenkov2018-02-028-13/+74
| | | | | | Differential Revision: https://reviews.llvm.org/D42774 llvm-svn: 324049
* Fix debug spelling in ResetMachineFunction pass.Amara Emerson2018-02-021-2/+2
| | | | llvm-svn: 324048
* [GlobalISel] Constrain the dest reg of IMPLICT_DEF.Amara Emerson2018-02-022-0/+25
| | | | | | | | | | This fixes a crash where the user is a COPY, which deliberately does not constrain its source operands, resulting in a vreg without a reg class escaping selection. Differential Revision: https://reviews.llvm.org/D42697 llvm-svn: 324047
* [analyzer] Fix yet-another-crash in body-farming std::call_onceGeorge Karpenkov2018-02-022-2/+54
| | | | | | | | | | | | | | Crash occurs when parameters to the callback and to std::call_once mismatch, and C++ is supposed to auto-construct an argument. Filed by Alexander Kornienko in https://bugs.llvm.org/show_bug.cgi?id=36149 rdar://37034403 Differential Revision: https://reviews.llvm.org/D42777 llvm-svn: 324046
* [WebAssembly] Fix typo in test fileSam Clegg2018-02-021-1/+1
| | | | llvm-svn: 324045
* Remove non-modular header containing static utility functionsDavid Blaikie2018-02-022-203/+178
| | | | | | | | | | The one place that uses these functions isn't particularly long/complicated, so it's easier to just have these inline at that location than trying to split it out into a true header. (in part also because of the use of the DEBUG macros, which make this not really a standalone header even if the static functions were made inline instead) llvm-svn: 324044
* Fix typo: --nopie -> --no-pie.Rui Ueyama2018-02-023-4/+4
| | | | | | | | | --nopie was a typo. GNU gold doesn't recognize it. It is also inconsistent with other options that have --foo and --no-foo. Differential Revision: https://reviews.llvm.org/D42825 llvm-svn: 324043
* [WebAssembly] Fix signature mismatches in test codeSam Clegg2018-02-0231-100/+100
| | | | | | | | | Pass --check-signatures to test executions of lld and fix resulting errors. Differential Revision: https://reviews.llvm.org/D42661 llvm-svn: 324042
* Don't accept unsuitable ELF files such as executables or core files.Rui Ueyama2018-02-024-6/+14
| | | | | | Differential Revision: https://reviews.llvm.org/D42827 llvm-svn: 324041
* Add missing includesDavid Blaikie2018-02-021-0/+3
| | | | llvm-svn: 324040
* SplitKit: Fix liveness recomputation in some remat cases.Matthias Braun2018-02-023-11/+293
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example situation: ``` BB0: %0 = ... use %0 ; ... condjump BB1 jmp BB2 BB1: %0 = ... ; rematerialized def from above (from earlier split step) jmp BB2 BB2: ; ... use %0 ``` %0 will have a live interval with 3 value numbers (for the BB0, BB1 and BB2 parts). Now SplitKit tries and succeeds in rematerializing the value number in BB2 (This only works because it is a secondary split so SplitKit is can trace this back to a single original def). We need to recompute all live ranges affected by a value number that we rematerialize. The case that we missed before is that when the value that is rematerialized is at a join (Phi VNI) then we also have to recompute liveness for the predecessor VNIs. rdar://35699130 Differential Revision: https://reviews.llvm.org/D42667 llvm-svn: 324039
* Fix broken builds due to mismatched min/max typesVlad Tsyrklevich2018-02-021-2/+2
| | | | llvm-svn: 324038
* [coroutines] Fix application of NRVO to Coroutine "Gro" or return object.Eric Fiselier2018-02-013-5/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Fix NRVO for Gro variable. Previously, we only marked the GRO declaration as an NRVO variable when its QualType and the function return's QualType matched exactly (using operator==). However, this was incorrect for two reasons: 1. We were marking non-class types, such as ints, as being NRVO variables. 2. We failed to handle cases where the canonical types were the same, but the actual `QualType` objects were different. For example, if one was represented by a typedef. (Example: https://godbolt.org/g/3UFgsL) This patch fixes these bugs by marking the Gro variable as supporting NRVO only when `BuildReturnStmt` marks the Gro variable as a coroutine candidate. Reviewers: rsmith, GorNishanov, nicholas Reviewed By: GorNishanov Subscribers: majnemer, cfe-commits Differential Revision: https://reviews.llvm.org/D42343 llvm-svn: 324037
* Relax the grammar of the version script.Rui Ueyama2018-02-012-8/+9
| | | | | | | | | In GNU linkers, the last semicolon is optional. We can't link libstdc++ with lld because of that difference. Differential Revision: https://reviews.llvm.org/D42820 llvm-svn: 324036
OpenPOWER on IntegriCloud