summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Clean up some things in the WindowsResource changes.Eric Beckmann2017-06-164-130/+99
| | | | llvm-svn: 305596
* [Object] Remove redundant std::move.Benjamin Kramer2017-06-161-1/+1
| | | | | | Found by -Wpessimizing-move. llvm-svn: 305595
* Fix the CMake files for the new InstrumentationRuntime plugins.Kuba Mracek2017-06-162-2/+22
| | | | llvm-svn: 305594
* Call cmake_minimum_required at the top of CMakeLists.txtPirama Arumuga Nainar2017-06-161-2/+2
| | | | | | | | | | | | | | | | | | | Summary: Since r298413, the NEW behavior of the CMake policy CMP0056 is followed. However, it is only effective after the call to cmake_minimum_required. This causes CMAKE_EXE_LINKER_FLAGS etc. to be unused when CMake tries to check compilers for languages specified in the 'project' declaration. Set cmake_minimum_required(VERSION) at the top of the file and ahead of the project declaration. Reviewers: beanz Subscribers: mgorny, srhines, llvm-commits Differential Revision: https://reviews.llvm.org/D34282 llvm-svn: 305593
* Switch external cvtres.exe for llvm's own resource library.Eric Beckmann2017-06-1612-93/+65
| | | | | | | | | | | | | | | | | | | | | | | | In this patch, I flip the switch in DriverUtils from using the external cvtres.exe tool to using the Windows Resource library in llvm. I also fixed a bug where .rsrc sections were marked as discardable memory and therefore were placed in the wrong order in the final PE. Furthermore, I modified WindowsResource to write the coff directly to a memory buffer instead of to file, also had it use the machine types already declared in COFF.h instead creating my own enum. Finally, I flipped the switch to allow all unit tests that had previously run only on windows due to a winres dependency to run cross-platform. Reviewers: zturner, ruiu Subscribers: llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D34265 llvm-svn: 305592
* [InstCombine] Set correct insertion point for selects generated while ↵Anna Thomas2017-06-162-1/+40
| | | | | | | | | | | | | | | | | | | | | | folding phis Summary: When we fold vector constants that are operands of phi's that feed into select, we need to set the correct insertion point for the *new* selects that get generated. The correct insertion point is the incoming block for the phi. Such cases can occur with patch r298845, which fixed folding of vector constants, but the new selects could be inserted incorrectly (as the added test case shows). Reviewers: majnemer, spatel, sanjoy Reviewed by: spatel Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34162 llvm-svn: 305591
* [Sanitizer] Remove CombinedAllocator::Allocate's 'cleared' parameterAlex Shlyapnikov2017-06-165-17/+9
| | | | | | | | | | | | | | Summary: CombinedAllocator::Allocate cleared parameter is not used anywhere and seem to be obsolete. Reviewers: eugenis Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D34289 llvm-svn: 305590
* Upstreaming the UndefinedBehaviorSanitizerRuntime and ↵Kuba Mracek2017-06-1617-16/+941
| | | | | | MainThreadCheckerRuntime plugins. llvm-svn: 305589
* [index] Fix typo: inferface -> interfaceMarc-Andre Laperle2017-06-162-2/+2
| | | | | | | | | | | | Reviewers: arphaman Reviewed By: arphaman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33253 llvm-svn: 305588
* Killing a tab and some other spurious whitespace; NFC.Aaron Ballman2017-06-161-1/+1
| | | | llvm-svn: 305586
* Give associative-comdat lld test a tripleReid Kleckner2017-06-161-2/+2
| | | | llvm-svn: 305585
* Change YAML traits for vector<string> to flow_vector.Evgeniy Stepanov2017-06-162-8/+3
| | | | | | | This is a workaround for an ODR conflict with the definition in AMDGPUCodeObjectMetadata.cpp. llvm-svn: 305584
* [SCCP] Simplify the code a bit. NFCI.Davide Italiano2017-06-161-7/+3
| | | | llvm-svn: 305583
* [COFF] Drop unused comdat sections when GC is turned offReid Kleckner2017-06-166-6/+98
| | | | | | | | | | | | | | | | | Summary: Adds a "Discarded" bool to SectionChunk to indicate if the section was discarded by COMDAT deduplication. The Writer still just checks `isLive()`. Fixes PR33446 Reviewers: ruiu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34288 llvm-svn: 305582
* [WinASan] Fix hotpatching new Win 10 build 1703 x64 strnlen prologueReid Kleckner2017-06-162-1/+17
| | | | | | | | | | | The first instruction of the new ucrtbase!strnlen implementation loads a global, presumably to dispatch between SSE and non-SSE optimized strnlen implementations. Fixes PR32895 and probably https://github.com/google/sanitizers/issues/818 llvm-svn: 305581
* [Sanitizers] Fix allocator OOM test on Windows.Alex Shlyapnikov2017-06-161-1/+1
| | | | | | | | | | | | | | Summary: Point of failure is different after D34243, hence the change of the message. Reviewers: eugenis Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D34292 llvm-svn: 305580
* [SCCP] Clarify a comment about unhandled instructions.Davide Italiano2017-06-161-2/+3
| | | | llvm-svn: 305579
* [GVN] Recommit the patch "Add phi-translate support in scalarpre".Wei Mi2017-06-165-34/+321
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recommit fixes two bugs: The first one is to use CurrentBlock instead of PREInstr's Parent as param of performScalarPREInsertion because the Parent of a clone instruction may be uninitialized. The second one is stop PRE when CurrentBlock to its predecessor is a backedge and an operand of CurInst is defined inside of CurrentBlock. The same value defined inside of loop in last iteration can not be regarded as available. Right now scalarpre doesn't have phi-translate support, so it will miss some simple pre opportunities. Like the following testcase, current scalarpre cannot recognize the last "a * b" is fully redundent because a and b used by the last "a * b" expr are both defined by phis. long a[100], b[100], g1, g2, g3; __attribute__((pure)) long goo(); void foo(long a, long b, long c, long d) { g1 = a * b; if (__builtin_expect(g2 > 3, 0)) { a = c; b = d; g2 = a * b; } g3 = a * b; // fully redundant. } The patch adds phi-translate support in scalarpre. This is only a temporary solution before the newpre based on newgvn is available. Differential Revision: https://reviews.llvm.org/D32252 llvm-svn: 305578
* Do not use make<> to allocate TargetInfo. NFC.Rui Ueyama2017-06-1612-50/+70
| | | | llvm-svn: 305577
* [PR33394] Avoid lexing editor placeholders when Clang is used onlyAlex Lorenz2017-06-164-41/+64
| | | | | | | | | | | | | | | | for preprocessing r300667 added support for editor placeholder to Clang. That commit didn’t take into account that users who use Clang for preprocessing only (-E) will get the "editor placeholder in source file" error when preprocessing their source (PR33394). This commit ensures that Clang doesn't lex editor placeholders when running a preprocessor only action. rdar://32718000 Differential Revision: https://reviews.llvm.org/D34256 llvm-svn: 305576
* [SCCP] Remove redundant instruction visitors.Davide Italiano2017-06-161-11/+0
| | | | | | | Whenever we don't know what to do with an instruction, we send it to overdefined anyway. llvm-svn: 305575
* Ignore return value in test.Daniel Jasper2017-06-161-1/+1
| | | | llvm-svn: 305574
* [DWARF] Replaced mem-initializers with non-static data member initializers ↵Spyridoula Gravani2017-06-161-5/+4
| | | | | | in DWARFVerifier class. llvm-svn: 305570
* [Sanitizers] Secondary allocator respects allocator_may_return_null=1.Alex Shlyapnikov2017-06-165-2/+116
| | | | | | | | | | | | | | | | | | Summary: Context: https://github.com/google/sanitizers/issues/740. Making secondary allocator to respect allocator_may_return_null=1 flag and return nullptr when "out of memory" happens. More changes in primary allocator and operator new will follow. Reviewers: eugenis Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D34243 llvm-svn: 305569
* [ubsan] docs: Add a note about pointers to volatileVedant Kumar2017-06-161-0/+6
| | | | llvm-svn: 305568
* Add comments for AVR support.Rui Ueyama2017-06-161-0/+19
| | | | | | | | | AVR support is somewhat exotic as generated ELF executables are not directly consumed but objcopy'ed to write it to on-chip flush memory. This comment describes it for those why a full-fledged ELF linker is used to link programs for the 8-bit microcontroller. llvm-svn: 305567
* Revert "RegScavenging: Add scavengeRegisterBackwards()"Matthias Braun2017-06-1614-514/+233
| | | | | | | | | Revert because of reports of some PPC input starting to spill when it was predicted that it wouldn't and no spillslot was reserved. This reverts commit r305516. llvm-svn: 305566
* Split Target.cpp into small files.Rui Ueyama2017-06-1612-2341/+2572
| | | | | | | | | | | | Target.cpp contains code for all the targets that LLD supports. It was simple and easy, but as the number of supported targets increased, it got messy. This patch splits the file into per-target files under ELF/arch directory. Differential Revision: https://reviews.llvm.org/D34222 llvm-svn: 305565
* Fix function name /NFCXinliang David Li2017-06-161-3/+3
| | | | llvm-svn: 305564
* [InstCombine] Add test cases to show missed opportunities due to overly ↵Craig Topper2017-06-162-0/+77
| | | | | | conservative single use checks. NFC llvm-svn: 305562
* Fix a bug that warnings generated with -M or -MM flagsYuka Takahashi2017-06-162-0/+15
| | | | | | | | | This is a patch for bug: https://bugs.llvm.org/show_bug.cgi?id=6817 Warnings should not be emitted with -M and -MM flags, because this mode is only used for generate MakeFiles. llvm-svn: 305561
* bpf: avoid load from read-only sectionsYonghong Song2017-06-165-7/+420
| | | | | | | | | | | | | | | | | | | | | | | | | | | If users tried to have a structure decl/init code like below struct test_t t = { .memeber1 = 45 }; It is very likely that compiler will generate a readonly section to hold up the init values for variable t. Later load of t members, e.g., t.member1 will result in a read from readonly section. BPF program cannot handle relocation. This will force users to write: struct test_t t = {}; t.member1 = 45; This is just inconvenient and unintuitive. This patch addresses this issue by implementing BPF PreprocessISelDAG. For any load from a global constant structure or an global array of constant struct, it attempts to translate it into a constant directly. The traversal of the constant struct and other constant data structures are similar to where the assembler emits read-only sections. Four different unit test cases are also added to cover different scenarios. Signed-off-by: Yonghong Song <yhs@fb.com> llvm-svn: 305560
* bpf: set missing types in insn tablegen fileYonghong Song2017-06-161-7/+7
| | | | | | | | | | | | o This is discovered during my study of 32-bit subregister support. o This is no impact on current functionality since we only support 64-bit registers. o Searching the web, looks like the issue has been discovered before, so fix it now. Signed-off-by: Yonghong Song <yhs@fb.com> llvm-svn: 305559
* [Atomics] Rename and change prototype for atomic memcpy intrinsicDaniel Neilson2017-06-1617-249/+348
| | | | | | | | | | | | | | | | | | Summary: Background: http://lists.llvm.org/pipermail/llvm-dev/2017-May/112779.html This change is to alter the prototype for the atomic memcpy intrinsic. The prototype itself is being changed to more closely resemble the semantics and parameters of the llvm.memcpy intrinsic -- to ease later combination of the llvm.memcpy and atomic memcpy intrinsics. Furthermore, the name of the atomic memcpy intrinsic is being changed to make it clear that it is not a generic atomic memcpy, but specifically a memcpy is unordered atomic. Reviewers: reames, sanjoy, efriedma Reviewed By: reames Subscribers: mzolotukhin, anna, llvm-commits, skatkov Differential Revision: https://reviews.llvm.org/D33240 llvm-svn: 305558
* Revert "[mips][microMIPS] Extending size reduction pass with ADDIUSP and ↵Simon Dardis2017-06-162-114/+12
| | | | | | | | | ADDIUR1SP" This reverts commit r305455. This commit was reported as breaking one of the sanitizer buildbots. Reverting until lab.llvm.org comes back online. llvm-svn: 305557
* [TableGen] Do not assume that the first variant is the original patternKrzysztof Parzyszek2017-06-161-3/+1
| | | | | | | | | The variant generation for commutative/associative patterns would simply delete the first output from the list assuming that it was identical to the original pattern. This does not have to be the case, and a legitimate variant could actually be removed that way. llvm-svn: 305556
* [ELF] Enable createThunks to be called more than once.Peter Smith2017-06-163-10/+38
| | | | | | | | | | | | In preparation for supporting range extension thunks we now continually call createThunks() until no more thunks are added. This requires us to record the thunks we add on each pass and only merge the new ones into the OutputSection. We also need to check if a Relocation is targeting a thunk to prevent us from infinitely creating more thunks. Differential Revision: https://reviews.llvm.org/D34034 llvm-svn: 305555
* [clang-tidy] readability-function-size: fix nesting level calculationRoman Lebedev2017-06-162-13/+69
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: A followup for D32942. Malcolm Parsons has provided a valid testcase that the initial version of the check complained about nested `if`'s. As it turns out, the culprit is the **partially** un-intentional `switch` fallthrough. So rewrite the NestingThreshold logic without ab-using+mis-using that switch with fallthrough, and add testcases with nested `if`' where there should be a warning and shouldn't be a warning. This results in a cleaner, simpler code, too. I guess, now it would be actually possible to pick some reasonable default for `NestingThreshold` setting. Fixes PR33454. Reviewers: malcolm.parsons, alexfh Reviewed By: malcolm.parsons Subscribers: sbenza, xazax.hun, cfe-commits, aaron.ballman Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D34202 llvm-svn: 305554
* [Hexagon] Don't kill live registers when creating mux out of tfrKrzysztof Parzyszek2017-06-162-1/+48
| | | | | | | | | The second part of r305300: when placing the mux at the later location, make sure that it won't use any register that was killed between the two original instructions. Remove any such kills and transfer them to the mux. llvm-svn: 305553
* [MachineBlockPlacement] trivial fix in comments, NFCHiroshi Inoue2017-06-161-5/+5
| | | | | | | | - Topologocal is abbreviated as "topo" in comments, but "top" is used in only one comment. Modify it for consistency. - Capitalize "succ" and "pred" for consistency in one figure. - Other trivial fixes. llvm-svn: 305552
* Expand vector oparation to as IR constants, PR28129.Dinar Temirbulatov2017-06-162-0/+69
| | | | llvm-svn: 305551
* Fix potential bug by casting to the POSIX specified typeEric Fiselier2017-06-161-1/+1
| | | | llvm-svn: 305549
* [InstCombine] Fold (!iszero(A & K1) & !iszero(A & K2)) -> (A & (K1 | K2)) ↵Craig Topper2017-06-163-44/+69
| | | | | | | | | | | | | | | | == (K1 | K2) if K1 and K2 are a 1-bit mask Summary: This is the demorganed version of the case we already handle for the OR of iszero. Reviewers: spatel Reviewed By: spatel Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34244 llvm-svn: 305548
* Change the code I added to LocateDSYMInVincinityOfExecutable to useJason Molenda2017-06-161-20/+34
| | | | | | | | | the FileSpec methods for adding/removing file path components instead of using std::strings; feedback from Sean on the change I added in r305441. <rdar://problem/31825940> llvm-svn: 305547
* [ubsan] PR33081: Skip the standard type checks for volatileVedant Kumar2017-06-162-0/+12
| | | | | | | | | | Skip checks for null dereference, alignment violation, object size violation, and dynamic type violation if the pointer points to volatile data. Differential Revision: https://reviews.llvm.org/D34262 llvm-svn: 305546
* Add test for logging the implicit "this" argument for C++ member functions.Dean Michael Berris2017-06-161-0/+31
| | | | | | | | | | | | | | | | Summary: This allows us to do more interesting things with the data available to C++ methods, to log the `this` pointer. Depends on D34050. Reviewers: pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34051 llvm-svn: 305545
* [XRay][clang] Support capturing the implicit `this` argument to C++ class ↵Dean Michael Berris2017-06-162-6/+15
| | | | | | | | | | | | | | | | | | member functions Summary: Before this change, we couldn't capture the `this` pointer that's implicitly the first argument of class member functions. There are some interesting things we can do with capturing even just this single argument for zero-argument member functions. Reviewers: rnk, pelikan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D34052 llvm-svn: 305544
* [ODRHash] Hash VarDecl members.Richard Trieu2017-06-164-8/+326
| | | | | | | These VarDecl's are static data members of classes. Since the initializers are also hashed, this also provides checking for default arguments to methods. llvm-svn: 305543
* Fix buildbots.Rui Ueyama2017-06-161-1/+2
| | | | llvm-svn: 305542
* Fix msan buildbot.Rui Ueyama2017-06-161-1/+2
| | | | | | | | | | | This patch should fix sanitizer-x86_64-linux-fast bot. The problem was that the contents of this stream are aligned to 4 byte, and the paddings were created just by incrementing `Offset`, so paddings had undefined values. When the entire stream is written to an output, it triggered msan. llvm-svn: 305541
OpenPOWER on IntegriCloud