Commit Graph

340810 Commits

Author SHA1 Message Date
Alex Lorenz f96f64d0f2 [driver][Darwin] Add an -ibuiltininc flag that lets Darwin driver
include Clang builtin headers even with -nostdinc

Some projects use -nostdinc, but need to access some intrinsics files when building specific files.
The new -ibuiltininc flag lets them use this flag when compiling these files to ensure they can
find Clang's builtin headers.

The use of -nobuiltininc after the -ibuiltininc flag does not add the builtin header
search path to the list of header search paths.

Differential Revision: https://reviews.llvm.org/D73500
2020-01-28 18:18:43 -08:00
Benjamin Kramer cd87e207ec Make bugpoint work with gcc5 again. 2020-01-29 03:11:00 +01:00
Benjamin Kramer bd31243a34 Fix more implicit conversions. Getting closer to having clang working with gcc 5 again 2020-01-29 02:57:59 +01:00
Benjamin Kramer bb39b52950 Fix conversions in clang and examples 2020-01-29 02:48:15 +01:00
Benjamin Kramer 2b36e85542 GCC5 buildbot made it to clang. Fix implicit conversions it found. 2020-01-29 02:19:49 +01:00
Nate Voorhies a40b3e3b61 [NFC] Fix unused variable warning.
Reviewers: dschuff

Reviewed By: dschuff

Subscribers: hiraditya, aheejin, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73591
2020-01-28 17:19:23 -08:00
Vedant Kumar 8359511c62 [CodeExtractor] Remove stale llvm.assume calls from extracted region
During extraction, stale llvm.assume handles may be retained in the
original function. The setup is:

1) CodeExtractor unregisters assumptions in the blocks that are to be
   extracted.

2) Extraction happens. There are now two functions: f1 and f1.extracted.

3) Leftover assumptions in f1 (/not/ removed as they were not in the set of
   blocks to be extracted) now have affected-value llvm.assume handles in
   f1.extracted.

When assumptions for a value used in f1 are looked up, ValueTracking can assert
as some of the handles are in the wrong function. To fix this, simply erase the
llvm.assume calls in the extracted function.

Alternatives include flushing the assumption cache in the original function, or
walking all values used in the original function to prune stale affected-value
handles. Both seem more expensive.

Testing: check-llvm, LNT run with -mllvm -hot-cold-split enabled

rdar://58460728
2020-01-28 17:18:01 -08:00
Benjamin Kramer 2d92336db0 Another stab at making the gold plugin compile again 2020-01-29 02:12:53 +01:00
Jonas Devlieghere ede5cd9a45 [lldb/API] Fix bogus copy assignment operator
The copy assignment operator is supposed to return the class and not
void. Fix the methods and the reproducer instrumentation macros.
2020-01-28 17:11:12 -08:00
Benjamin Kramer a9bc7b83a4 Another round of GCC5 fixes. 2020-01-29 02:09:24 +01:00
Sam McCall 9a5c448a31 [clangd] Fix null check in FindTarget.
I've hit this stack trace a few times but don't have a good reproducer.
The code is unsafe by inspection, though.
2020-01-29 02:01:42 +01:00
Derek Schuff d966bf830f [WebAssembly] Preserve debug frame base information through register coloring
2 fixes:

Register coloring can re-assign virtual registers. When the frame base register
is colored, update the DwarfFrameBase accordingly When the frame base register
is stackified, do not attempt to encode DW_AT_frame_base as a local In the
future we will presumably want to handle this case better but for now we can
emit worse debug info rather than crashing.

Differential Revision: https://reviews.llvm.org/D73581
2020-01-28 16:58:15 -08:00
Benjamin Kramer 735f90fe42 Fix one round of implicit conversions found by g++5. 2020-01-29 01:52:48 +01:00
Nico Weber 0eb64fcb89 Fix clangd-xpc-test-client build after 777180a32b 2020-01-28 19:48:31 -05:00
Jonas Devlieghere 1dfe7b5be6 [lldb/API] Implement the copy (assignment) constructor for SBLaunchInfo
Currently the constructor is compiler generated which means it doesn't
get instrumented for the reproducers.
2020-01-28 16:44:58 -08:00
Nico Weber 95cb22d0f9 Fix xpc build after 777180a32b 2020-01-28 19:35:11 -05:00
Craig Topper ca2abea29a [X86] Use SelectionDAG::getZExtOrTrunc to simplify some code. NFCI 2020-01-28 16:27:59 -08:00
Craig Topper 92ecc306af [X86] Add test case for llvm.flt.rounds 2020-01-28 16:27:59 -08:00
Jonas Devlieghere 66dc467228 [lldb/API] Implement the copy (assignment) constructor for SBPlatform
Currently the constructor is compiler generated which means it doesn't
get instrumented for the reproducers.
2020-01-28 16:23:03 -08:00
Nico Weber ce70eb76ea Fix AVR build after 777180a32b 2020-01-28 19:22:22 -05:00
Alex Langford 71b022ee55 [lldb] Remove unused header from ValueObject.cpp
In commit 5eaf44f99f I removed the last
instance of TypeSystemClang from ValueObject, so the header is no longer
needed.
2020-01-28 16:13:21 -08:00
Benjamin Kramer 8b6320c79d Address implicit conversions detected by g++ 5 only. 2020-01-29 01:01:09 +01:00
Benjamin Kramer ddf77f10a3 One more batch of things found by g++ 6 2020-01-29 00:50:34 +01:00
Eli Friedman 2f6b9edfa8 [AliasAnalysis] Add missing FMRB_* enums.
Previously, the enums didn't account for all the possible cases, which
could cause misleading results (particularly for a "switch" on
FunctionModRefBehavior).

Fixes regression in polly from recent patch to add writeonly to memset.

While I'm here, also fix a few dubious uses of the FMRB_* enum values.

Differential Revision: https://reviews.llvm.org/D73154
2020-01-28 15:47:08 -08:00
Benjamin Kramer 0d401fa36b Fix a couple more implicit conversions that Clang doesn't diagnose. 2020-01-29 00:42:56 +01:00
Benjamin Kramer 5976067d2c A bunch more implicit string conversions that my Clang didn't detect. 2020-01-29 00:30:16 +01:00
Nate Voorhies 84118fac3a [NFC] Removing experimental designation for ninja in docs.
Summary:
Ninja is no longer an experimental tool, documentation changed to
reflect this.

Reviewers: nikola

Reviewed By: nikola

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73567
2020-01-28 15:28:40 -08:00
Jonas Devlieghere 43a1c80508 Fix another implicit conversion in the directory watcher 2020-01-28 15:28:22 -08:00
Benjamin Kramer 05c19705d8 [tblgen] Fix implicit conversion only diagnosed by g++ 6 2020-01-29 00:25:44 +01:00
Francis Visoiu Mistrih b1a8189d7d [NFC] Fix comment typo 2020-01-28 15:23:28 -08:00
Jonas Devlieghere 00d834e087 Fix more implicit conversions 2020-01-28 15:19:27 -08:00
Benjamin Kramer a153d78c7e [Driver] Fix implicit conversion guarded by #ifdef _WIN32 2020-01-29 00:18:45 +01:00
Benjamin Kramer c9909c22fe Fix implicit conversions in example code. 2020-01-29 00:17:35 +01:00
Jonas Devlieghere 9a8d42e608 [lldb/Plugin] Fix implicit conversion in GDBRemote 2020-01-28 15:16:56 -08:00
Jonas Devlieghere e9326ed906 [lldb/Reproducer] s/nullptr_t/std::nullptr_t/
Fixes error: unknown type name 'nullptr_t'; did you mean
'std::nullptr_t'.
2020-01-28 15:15:13 -08:00
Benjamin Kramer 19580c3755 Fix implicit conversion in the lldb Python plugin 2020-01-29 00:07:50 +01:00
Jonas Devlieghere 620f5faf1f [lldb/Reproducer] Include result in recording statements
Include the return value in the recording log statements. This helps
diagnose uninstrumented (copy assignment) constructors.
2020-01-28 15:03:13 -08:00
Benjamin Kramer 159709f04f [Support] Fix implicit std::string conversions on Win32. 2020-01-29 00:02:26 +01:00
Benjamin Kramer 777180a32b [ADT] Make StringRef's std::string conversion operator explicit
This has the same behavior as converting std::string_view to
std::string. This is an expensive conversion, so explicit conversions
are helpful for avoiding unneccessary string copies.
2020-01-28 23:47:07 +01:00
Shoaib Meenai 076da521f3 [libcxx] Link against android_support when needed
libc++ on Android needs to be linked against libandroid_support on API
levels less than 21 to provide needed functions that aren't in the libc
on those platforms (e.g. posix_memalign for libcxxabi). libc++ from the
NDK is a linker script that pulls in libandroid_support, but for
building libc++ itself, we need to explicitly add libandroid_support as
a dependency. Moreover, libc++ headers reference the functions provided
by libandroid_support, so it needs to be added as a public dependency.

Differential Revision: https://reviews.llvm.org/D73516
2020-01-28 14:36:24 -08:00
Shoaib Meenai d8f6950828 [asan] Fix test compilation on Android API <= 17
mlockall and munlockall were introduced in Android API 17, so avoid
referencing them on prior versions.

Differential Revision: https://reviews.llvm.org/D73515
2020-01-28 14:36:19 -08:00
Shoaib Meenai 2e745ba6b0 [runtimes] Fix passing lists to runtimes configures
We have to replace the ";" with "|" (since LLVMExternalProjectUtils uses
"|" as the `LIST_SEPARATOR` when invoking `ExternalProject_Add`) in
order for lists to be passed correctly to the runtimes CMake configures.
Remove the special case for `LLVM_ENABLE_RUNTIMES`, since it'll just get
handled by the general logic now.

Differential Revision: https://reviews.llvm.org/D73512
2020-01-28 14:36:14 -08:00
Benjamin Kramer adcd026838 Make llvm::StringRef to std::string conversions explicit.
This is how it should've been and brings it more in line with
std::string_view. There should be no functional change here.

This is mostly mechanical from a custom clang-tidy check, with a lot of
manual fixups. It uncovers a lot of minor inefficiencies.

This doesn't actually modify StringRef yet, I'll do that in a follow-up.
2020-01-28 23:25:25 +01:00
Alex Langford 5eaf44f99f [lldb] Delete ValueObject::GetBaseClassPath
Summary:
This method has exactly one call site, which is only actually executed
if `ValueObject::IsBaseClass` returns false. However, the first thing
that `ValueObject::GetBaseClassPath` does is check if `ValueObject::IsBaseClass`
is true. Because this can never be the case, this method always returns false
and is therefore effectively dead.

Differential Revision: https://reviews.llvm.org/D73517
2020-01-28 14:11:53 -08:00
Danilo Carvalho Grael 1f85dfb2af [AArch64][SVE] Add SVE2 mla indexed intrinsics.
Summary:
Add SVE2 mla indexed intrinsics:
- smlalb, smalalt, umlalb, umlalt, smlslb, smlslt, umlslb, umlslt.

Reviewers: efriedma, sdesmalen, dancgr, cameron.mcinally, c-rhodes, rengolin

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, arphaman, psnobl, llvm-commits, amehsan

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73576
2020-01-28 17:15:33 -05:00
Jessica Paquette dba29f7c3b [AArch64][GlobalISel] Fold G_AND into G_BRCOND
When the G_BRCOND is fed by a eq or ne G_ICMP, it may be possible to fold a
G_AND into the branch by producing a tbnz/tbz instead.

This happens when

  1. We have a ne/eq G_ICMP feeding into the G_BRCOND
  2. The G_ICMP is a comparison against 0
  3. One of the operands of the G_AND is a power of 2 constant

This is very similar to the code in AArch64TargetLowering::LowerBR_CC.

Add opt-and-tbnz-tbz to test this.

Differential Revision: https://reviews.llvm.org/D73573
2020-01-28 14:00:31 -08:00
Francis Visoiu Mistrih 4e799ada58 [CodeGen] Attach no-builtin attributes to function definitions with no Decl
When using -fno-builtin[-<name>], we don't attach the IR attributes to
function definitions with no Decl, like the ones created through
`CreateGlobalInitOrDestructFunction`.

This results in projects using -fno-builtin or -ffreestanding to start
seeing symbols like _memset_pattern16.

The fix changes the behavior to always add the attribute if LangOptions
requests it.

Differential Revision: https://reviews.llvm.org/D73495
2020-01-28 13:59:08 -08:00
Alex Langford c4f6fbe971 [lldb] Remove ClangASTImporter from Target
Target is one of the classes responsible for vending ClangASTImporter.
Target doesn't need to know anything about ClangASTImporter, so if we
instead have ClangPersistentVariables vend it, we can preserve
existing behavior while improving layering and removing dependencies
from non-plugins to plugins.
2020-01-28 13:40:49 -08:00
Mircea Trofin 7f434b91a9 [llvm] Ensure InlineCost-related fields are initialized
Summary: Small fix - never hurts to have things initialized.

Reviewers: davidxl, eraman

Reviewed By: davidxl

Subscribers: haicheng, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73420
2020-01-28 13:38:45 -08:00
Michael Spang a2fb2c0ddc [GlobalMerge] Preserve symbol visibility when merging globals
Symbols created for merged external global variables have default
visibility. This can break programs when compiling with -Oz
-fvisibility=hidden as symbols that should be hidden will be exported at
link time.

Differential Revision: https://reviews.llvm.org/D73235
2020-01-28 13:26:18 -08:00