summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Relax unaligned access assertion when type is byte alignedDylan McKay2017-12-095-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This relaxes an assertion inside SelectionDAGBuilder which is overly restrictive on targets which have no concept of alignment (such as AVR). In these architectures, all types are aligned to 8-bits. After this, LLVM will only assert that accesses are aligned on targets which actually require alignment. This patch follows from a discussion on llvm-dev a few months ago http://llvm.1065342.n5.nabble.com/llvm-dev-Unaligned-atomic-load-store-td112815.html Reviewers: bogner, nemanjai, joerg, efriedma Reviewed By: efriedma Subscribers: efriedma, cactus, llvm-commits Differential Revision: https://reviews.llvm.org/D39946 llvm-svn: 320243
* Change uses of strncpy in debugserver to strlcpyJason Molenda2017-12-095-15/+15
| | | | | | | | for better safety. <rdar://problem/32906923> llvm-svn: 320242
* Change the ordering that we search for kexts and kernels on the localJason Molenda2017-12-091-7/+22
| | | | | | | | | | | | | | | | | | | | | computer. When doing kernel debugging, lldb scrapes around a few well-known locations to find kexts and kernels. It builds up two lists - kexts and kernels with dSYM, and kexts and kernels without dSYMs. After both lists have failed to provide a file, then we'll call out to things like the DebugSymbols framework to find a kext/kernel. This meant that when you had a kext/kernel on the local computer that did not have debug information, lldb wouldn't consult DebugSymbols etc once it'd locked on to one of these no-debug-info binaries on the local computer. Reorder this so we give DebugSymbols etc a shot at finding a debug-info file before we use any of the no-debug-info binaries that were found on the system. <rdar://problem/34434440> llvm-svn: 320241
* Update PlatformDarwin::GetDeveloperDir to handle the twoJason Molenda2017-12-091-8/+13
| | | | | | | | | | | | | | | | | most common cases where the Xcode.app bundle puts lldb - either as a default part of the bundle, or in a toolchain subdirectory, so the platform subclasses can find files relative to this directory. Dropped support for handling the case where the lldb framework was in /Library/PrivateFrameworks. I think this was intended to handle the case where lldb is installed in / (outside the Xcode.app bundle) - but in that case, we can look in the raw directory file paths to find anything. <rdar://problem/35285622> llvm-svn: 320240
* Revert r320230 to fix buildbots.Richard Trieu2017-12-0910-456/+49
| | | | llvm-svn: 320239
* Fix Driver/darwin-version.c testAlex Lorenz2017-12-091-1/+1
| | | | | | A target argument should be provided to avoid failures on non-Darwin llvm-svn: 320238
* [libFuzzer] make the stack depth signal less agressive, otherwise we are ↵Kostya Serebryany2017-12-091-1/+1
| | | | | | sometimes exploding the corpus size. This still needs more analysis and tuning llvm-svn: 320237
* Revert change in test/msan/textdomain.cc for NetBSDKamil Rytarowski2017-12-091-1/+1
| | | | | | | | SVN r. 320226 This breaks Linux. llvm-svn: 320236
* [driver][darwin] Refactor the target selection code, NFCAlex Lorenz2017-12-093-262/+384
| | | | | | | | | | | | | | | | | The simulator variant of Darwin's platforms is removed in favor of a new environment field. The code that selects the platform and the version is split into 4 different functions instead of being all in one function. This is an NFC commit, although it slightly improves the "invalid version number" diagnostic by displaying the environment variable instead of -m<os>-version-min if the OS version was derived from the environment. rdar://35813850 Differential Revision: https://reviews.llvm.org/D41035 llvm-svn: 320235
* Correct handling of the TLS/NetBSD block of the main programKamil Rytarowski2017-12-091-3/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Include <sys/tls.h> for: - struct tls_tcb - thread control block structure - __HAVE___LWP_GETTCB_FAST - __lwp_gettcb_fast() is available - __HAVE___LWP_GETPRIVATE_FAST - __lwp_getprivate_fast() is available - __HAVE_TLS_VARIANT_I - TLS Variant I for this architecture - __HAVE_TLS_VARIANT_II - TLS Variant II for this architecture Rename ThreadSelfSegbase() to ThreadSelfTlsTcb and switch it to retrieve in a portable way TCB. Switch ThreadSelf() to retrieve pthread from struct tcb_tls. Use dl_iterate_phdr() to find out the size of TLS block of the main program. Correct the index of the TLS block of the main program (dlpi_tls_modid); it's 1, not 2. New NetBSD code is now CPU (NetBSD port) agnostic. Stop sharing the same code with FreeBSD. Sponsored by <The NetBSD Foundation> Reviewers: dvyukov, joerg, vitalybuka Reviewed By: vitalybuka Subscribers: emaste, kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40159 llvm-svn: 320234
* Fix fsanitize-blacklist test on Windows.Evgeniy Stepanov2017-12-091-2/+2
| | | | | | Broken in r320232. llvm-svn: 320233
* Hardware-assisted AddressSanitizer (clang part).Evgeniy Stepanov2017-12-0922-21/+217
| | | | | | | | | | | | | | Summary: Driver, frontend and LLVM codegen for HWASan. A clone of ASan, basically. Reviewers: kcc, pcc, alekseyshl Subscribers: srhines, javed.absar, cfe-commits Differential Revision: https://reviews.llvm.org/D40936 llvm-svn: 320232
* Hardware-assisted AddressSanitizer (compiler-rt)Evgeniy Stepanov2017-12-0928-1/+2453
| | | | | | | | | | | | | | Summary: Runtime library for HWASan, initial commit. Does not randomize tags yet, does not handle stack or globals. Reviewers: kcc, pcc, alekseyshl Subscribers: srhines, kubamracek, dberris, mgorny, llvm-commits, krytarowski Differential Revision: https://reviews.llvm.org/D40935 llvm-svn: 320231
* [ODRHash] Support ODR violation detection in functions.Richard Trieu2017-12-0910-49/+456
| | | | | | | Extend the hashing to functions, which allows detection of function definition mismatches across modules. llvm-svn: 320230
* [MachineOutliner] Outline callsJessica Paquette2017-12-092-4/+134
| | | | | | | | | | | | | The outliner previously would never outline calls. Calls are pretty common in files, so it makes sense to outline them. In fact, in the LLVM test suite, if you count the number of instructions that the outliner misses when you outline calls vs when you don't, it turns out that, on average, around 6% of the instructions encountered are calls. So, if we outline calls, we can find more candidates, and thus save some more space. This commit adds that functionality and updates the mir test to reflect that. llvm-svn: 320229
* Fix test/msan/iconv.cc on NetBSDKamil Rytarowski2017-12-091-2/+2
| | | | | | | | | | | | | | | | | | | Summary: NetBSD still uses the old POSIX iconv(3) signature with the 2nd const argument. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41017 llvm-svn: 320228
* [NFC] Change the string offsets table tests to generate the object on the flyWolfgang Pieb2017-12-0920-211/+262
| | | | | | | | which enables us to remove the test scripts and object files from the repository. https://reviews.llvm.org/D40914 llvm-svn: 320227
* Fix test/msan/textdomain.cc on NetBSDKamil Rytarowski2017-12-091-1/+1
| | | | | | | | | | | | | | | | | | | Summary: This tests must be linked with -lintl for the gettext(3) features. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41013 llvm-svn: 320226
* Disable test/msan/tsearch.cc on NetBSDKamil Rytarowski2017-12-091-0/+3
| | | | | | | | | | | | | | | | | | | Summary: This test uses GNU-specific extension to libc: tdestroy() and as-is is not compatible with NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41011 llvm-svn: 320225
* Disable test/msan/pvalloc.cc on NetBSDKamil Rytarowski2017-12-091-1/+1
| | | | | | | | | | | | | | | | | | | Summary: The pvalloc(3) function is a non-standard extension missing on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41014 llvm-svn: 320224
* Fix test/msan/ifaddrs.cc for NetBSDKamil Rytarowski2017-12-091-1/+1
| | | | | | | | | | | | | | | | | | | Summary: NetBSD requires to include <sys/socket.h> for struct sockaddr. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41015 llvm-svn: 320223
* Disable test/msan/ftime.cc on NetBSDKamil Rytarowski2017-12-091-2/+2
| | | | | | | | | | | | | | | | | | | Summary: ftime(3) has been removed from libc/NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41018 llvm-svn: 320222
* NetBSD ships with POSIX strerror_r(3)Kamil Rytarowski2017-12-091-1/+1
| | | | | | | | | | | | | | | | | | | Summary: Switch NetBSD from GNU to the POSIX strerror_r(3) interceptor. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: srhines, kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41019 llvm-svn: 320221
* Don't link NetBSD programs with -ldl in linkXRayRuntimeDepsKamil Rytarowski2017-12-091-1/+2
| | | | | | | | | | | | | | | | | | | Summary: There is no such library on NetBSD, the corresponding functions like dlopen(3) are in libc. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis Reviewed By: vitalybuka Subscribers: dberris, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41021 llvm-svn: 320220
* Register NetBSD/x86_64 in MemorySanitizer.cppKamil Rytarowski2017-12-091-0/+22
| | | | | | | | | | | | | | | | | | | Summary: Reuse the Linux new mapping as it is. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41022 llvm-svn: 320219
* Add NetBSD/x86_64 mapping in MSanKamil Rytarowski2017-12-092-2/+3
| | | | | | | | | | | | | | | | | | | Summary: Reuse the Linux new mapping as it is. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41023 llvm-svn: 320218
* Hardware-assisted AddressSanitizer (llvm part).Evgeniy Stepanov2017-12-0930-17/+676
| | | | | | | | | | | | | | | | | | | | | Summary: This is LLVM instrumentation for the new HWASan tool. It is basically a stripped down copy of ASan at this point, w/o stack or global support. Instrumenation adds a global constructor + runtime callbacks for every load and store. HWASan comes with its own IR attribute. A brief design document can be found in clang/docs/HardwareAssistedAddressSanitizerDesign.rst (submitted earlier). Reviewers: kcc, pcc, alekseyshl Subscribers: srhines, mehdi_amini, mgorny, javed.absar, eraman, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D40932 llvm-svn: 320217
* Fix out-of-order stepping behavior in programs with sunk instructions.Paul Robinson2017-12-093-1/+116
| | | | | | | | | | | | | | | | | | | MachineSink attempts to place instructions near the basic blocks where they are needed. Once an instruction has been sunk, its location relative to other instructions no longer is consistent with the original source code. In order to ensure correct stepping in the debugger, the debug location for sunk instructions is either merged with the insertion point or erased if the target successor block is empty. Originally submitted as r318679, revised to fix sanitizer failure and improve testing. Patch by Matthew Voss! Differential Revision: https://reviews.llvm.org/D39933 llvm-svn: 320216
* [CodeGen][X86] Fix handling of __fp16 vectors.Akira Hatanaka2017-12-0912-63/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes a bug in IRGen where it generates completely broken code for __fp16 vectors on X86. For example when the following code is compiled: half4 hv0, hv1, hv2; // these are vectors of __fp16. void foo221() { hv0 = hv1 + hv2; } clang generates the following IR, in which two i16 vectors are added: @hv1 = common global <4 x i16> zeroinitializer, align 8 @hv2 = common global <4 x i16> zeroinitializer, align 8 @hv0 = common global <4 x i16> zeroinitializer, align 8 define void @foo221() { %0 = load <4 x i16>, <4 x i16>* @hv1, align 8 %1 = load <4 x i16>, <4 x i16>* @hv2, align 8 %add = add <4 x i16> %0, %1 store <4 x i16> %add, <4 x i16>* @hv0, align 8 ret void } To fix the bug, this commit uses the code committed in r314056, which modified clang to promote and truncate __fp16 vectors to and from float vectors in the AST. It also fixes another IRGen bug where a short value is assigned to an __fp16 variable without any integer-to-floating-point conversion, as shown in the following example: __fp16 a; short b; void foo1() { a = b; } @b = common global i16 0, align 2 @a = common global i16 0, align 2 define void @foo1() #0 { %0 = load i16, i16* @b, align 2 store i16 %0, i16* @a, align 2 ret void } rdar://problem/20625184 Differential Revision: https://reviews.llvm.org/D40112 llvm-svn: 320215
* dwarfdump: Add support for the --diff option.Adrian Prantl2017-12-087-21/+47
| | | | | | | | | --diff Emit the output in a diff-friendly way by omitting offsets and addresses. <rdar://problem/34502625> llvm-svn: 320214
* [X86][Mips] Remove unused method declaration from the X86 and Mips AsmPrinters.Craig Topper2017-12-082-7/+0
| | | | | | Both had a declaration of EmitXRayTable, but there is no method defined in either with that name. There is a emitXRayTable in the base class with a lower case 'e' and they both call that. llvm-svn: 320213
* Remove creation of out-of-bounds value of enumeration type (resulting in UB).Richard Smith2017-12-086-23/+18
| | | | | | | Also remove unnecessary initialization of out-parameters with this value, so that MSan is able to catch errors appropriately. llvm-svn: 320212
* Unify implementation of our two different flavours of -Wtautological-compare,Richard Smith2017-12-084-300/+333
| | | | | | | | | | | | | | | | | | | | | | | | | and fold together into a single function. In so doing, fix a handful of remaining bugs where we would report false positives or false negatives if we promote a signed value to an unsigned type for the comparison. This re-commits r320122 and r320124, minus two changes: * Comparisons between a constant and a non-constant expression of enumeration type never warn, not even if the constant is out of range. We should be warning about the creation of such a constant, not about its use. * We do not use more precise bit-widths for comparisons against bit-fields. The more precise diagnostics probably are the right thing, but we should consider moving them under their own warning flag. Other than the refactoring, this patch should only change the behavior for the buggy cases (where the warnings didn't take into account that promotion from signed to unsigned can leave a range of inaccessible values in the middle of the promoted type). llvm-svn: 320211
* [libFuzzer] Add support for Fuchsia OS.Matt Morehouse2017-12-086-2/+279
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds the initial support for Fuchsia. - LIBFUZZER_FUCHSIA is added as an OS type in FuzzerDefs.h - Fuchsia is, by design, not POSIX compliant. However, it does use ELF and supports common POSIX I/O functions. Thus, FuzzerExtFunctions.h and FuzzerIO.h are implemented by extending the header guards in FuzzerExtFunctionsWeak.cpp and FuzzerIOPosix.cpp to include LIBFUZZER_FUCHSIA. - The platform-specific portions of FuzzerUtil.h are implemented by FuzzerUtilFuchsia.cpp, which makes use of exception ports, syscalls, and the launchpad library. - The experimental equivalence server is not currently supported, so FuzzerShmem.h is implemented by stub methods in FuzzerShmemFuchsia.cpp. Any future implementation will likely involve VMOs. Tested with ASAN/SanCov on Fuchsia/x86-64 with the canonical toy fuzzer. Patch By: aarongreen Reviewers: kcc, morehouse, flowerhack, phosek Reviewed By: kcc, phosek, Eugene.Zelenko Subscribers: srhines, mgorny, Eugene.Zelenko Differential Revision: https://reviews.llvm.org/D40974 llvm-svn: 320210
* [CodeGen] Move printing MO_Immediate operands to MachineOperand::printFrancis Visoiu Mistrih2017-12-086-9/+76
| | | | | | | | | | | | Work towards the unification of MIR and debug output by refactoring the interfaces. Add support for operand subreg index as an immediate to debug printing and use ::print in the MIRPrinter. Differential Review: https://reviews.llvm.org/D40965 llvm-svn: 320209
* Revert part of "Cleanup some GraphTraits iteration code"Duncan P. N. Exon Smith2017-12-082-3/+28
| | | | | | | | | | | | | This reverts part of r300656, which caused a regression in propagateMassToSuccessors by counting edges n^2 times, where n is the number of edges from the source basic block to the same successor basic block. The result was both incorrect and very slow to compute for large values of n (e.g. switches with multiple cases that go to the same basic block). Patch by Andrew Scheidecker! llvm-svn: 320208
* [Lex] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-12-089-213/+278
| | | | | | minor fixes (NFC). llvm-svn: 320207
* Avoid constructing an out-of-range value for an enumeration (which results ↵Richard Smith2017-12-081-5/+4
| | | | | | in UB). llvm-svn: 320206
* [libFuzzer] honor -use_counters, sligntly change the meaning of ↵Kostya Serebryany2017-12-083-8/+18
| | | | | | -experimental_len_control, call UpdateFeatureFrequency only if instructed by the flag llvm-svn: 320205
* [AArch64] Rename AArch64VecorByElementOpt.cpp into AArch64SIMDInstrOpt.cpp ↵Abderrazek Zaafrani2017-12-082-1/+1
| | | | | | | | to reflect the recently added features. The name change is dicsussed in https://reviews.llvm.org/D38196 llvm-svn: 320204
* Generalize llvm::replaceDbgDeclare and actually support the use-case thatAdrian Prantl2017-12-0811-26/+55
| | | | | | is mentioned in the documentation (inserting a deref before the plus_uconst). llvm-svn: 320203
* [Debugify] Add a pass to test debug info preservationVedant Kumar2017-12-085-1/+287
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Debugify pass synthesizes debug info for IR. It's paired with a CheckDebugify pass which determines how much of the original debug info is preserved. These passes make it easier to create targeted tests for debug info preservation. Here is the Debugify algorithm: NextLine = 1 for (Instruction &I : M) attach DebugLoc(NextLine++) to I NextVar = 1 for (Instruction &I : M) if (canAttachDebugValue(I)) attach dbg.value(NextVar++) to I The CheckDebugify pass expects contiguous ranges of DILocations and DILocalVariables. If it fails to find all of the expected debug info, it prints a specific error to stderr which can be FileChecked. This was discussed on llvm-dev in the thread: "Passes to add/validate synthetic debug info" Differential Revision: https://reviews.llvm.org/D40512 llvm-svn: 320202
* [libc++] Unbreak Apple buildbotsShoaib Meenai2017-12-081-0/+1
| | | | | | | | These buildbots are using the deprecated target name install-libcxx-headers instead of the more up to date install-cxx-headers, so I need to add an install-libcxx-headers-stripped target to satisfy them. llvm-svn: 320201
* Make createSyntheticSections a static helper. NFC.Rafael Espindola2017-12-081-96/+95
| | | | llvm-svn: 320200
* [CodeExtractor] Add debug locations for new call and branch instrs.Florian Hahn2017-12-082-1/+128
| | | | | | | | | | | | | | | | | | | | | | | Summary: If a partially inlined function has debug info, we have to add debug locations to the call instruction calling the outlined function. We use the debug location of the first instruction in the outlined function, as the introduced call transfers control to this statement and there is no other equivalent line in the source code. We also use the same debug location for the branch instruction added to jump from artificial entry block for the outlined function, which just jumps to the first actual basic block of the outlined function. Reviewers: davide, aprantl, rriddle, dblaikie, danielcdh, wmi Reviewed By: aprantl, rriddle, danielcdh Subscribers: eraman, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D40413 llvm-svn: 320199
* Make findSection a static function. NFC.Rafael Espindola2017-12-081-9/+8
| | | | llvm-svn: 320198
* [WebAssembly] Reapply r319186: "Support bitcasted function addresses with ↵Dan Gohman2017-12-084-12/+51
| | | | | | | | | varargs." This puts the functionality under control of a command-line option which is off by default to avoid breaking existing setups. llvm-svn: 320197
* [WebAssemby] Re-apply r320041: "Support main functions with alternate ↵Dan Gohman2017-12-083-1/+87
| | | | | | | | | | signatures." This includes a fix so that it doesn't transform declarations, and it puts the functionality under control of a command-line option which is off by default to avoid breaking existing setups. llvm-svn: 320196
* [AArch64] Add Exynos to host detectionEvandro Menezes2017-12-082-0/+62
| | | | | | Differential revision: https://reviews.llvm.org/D40985 llvm-svn: 320195
* AMDGPU/GCN: Bring processors in sync with AMDGPUUsageKonstantin Zhuravlyov2017-12-0848-113/+81
| | | | | | | | | | | | - Add gfx704 - Change bonaire to gfx704 - Remove gfx804 - Remove gfx901 - Remove gfx903 Differential Revision: https://reviews.llvm.org/D40046 llvm-svn: 320194
OpenPOWER on IntegriCloud