Alex Lorenz [Tue, 30 Jun 2015 17:47:50 +0000 (17:47 +0000)]
MIR Parser: make the machine instruction parsing interface more consistent. NFC.
This commit refactors the interface for machine instruction parser. It adopts
the pattern of returning a bool and passing in the result in the first argument
that is used by the other parsing methods for the the method 'parse' and the
function 'parseMachineInstr'.
llvm-svn: 241085
Adrian Prantl [Tue, 30 Jun 2015 17:39:51 +0000 (17:39 +0000)]
Debug Info: Emit debug info for @import declarations.
This allows a module-aware debugger such as LLDB to import the currently
visible modules before dropping into the expression evaluator.
rdar://problem/
20965932
llvm-svn: 241084
Adrian Prantl [Tue, 30 Jun 2015 17:39:43 +0000 (17:39 +0000)]
Add a function to ExternalASTSource that returns a descriptor that
abstracts the commonalities between modules and PCH files that are
needed to emit debug info for a module or precompiled header.
llvm-svn: 241083
Dmitry Vyukov [Tue, 30 Jun 2015 17:23:29 +0000 (17:23 +0000)]
tsan: fix handling of condition variable destruction
POSIX states that "It shall be safe to destroy an initialized condition
variable upon which no threads are currently blocked", and later clarifies
"A condition variable can be destroyed immediately after all the threads
that are blocked on it are awakened) (in examples section). Tsan reported
such destruction as a data race.
Fixes https://llvm.org/bugs/show_bug.cgi?id=23616
Reviewed in http://reviews.llvm.org/D10693
llvm-svn: 241082
Samuel Antao [Tue, 30 Jun 2015 17:18:00 +0000 (17:18 +0000)]
Force relocation mode to be default, regardless of what is passed to the backend.
llvm-svn: 241081
Dan Liew [Tue, 30 Jun 2015 17:16:39 +0000 (17:16 +0000)]
[CMake] Make the CMake files (LLVMConfig.cmake and LLVMExports.cmake)
generated by the Autoconf/Makefile build system relocatable.
Previously the generated CMake files contained hardcoded paths which
prevented a binary installation from being relocated to a different
place in the file system. This problem was most noticeable in LLVM's
official binary releases which were completely unusable by a downstream
project trying to import the CMake targets.
Package maintainers who choose to modify the install location of the
CMake directory without using the ``PROJ_cmake`` Makefile variable
override will need to patch the generated``LLVMConfig.cmake`` so that
``LLVM_INSTALL_PREFIX`` and ``_LLVM_CMAKE_DIR`` variables are set
correctly.
llvm-svn: 241080
Pavel Labath [Tue, 30 Jun 2015 17:04:49 +0000 (17:04 +0000)]
[NativeProcessLinux] Refactor PtraceWrapper
Summary:
This changes PtraceWrapper to return an Error, while the actual result is in an pointer parameter
(instead of the other way around). Also made a couple of PtraceWrapper arguments default to zero.
This arrangement makes a lot of the code much simpler.
Test Plan: Tests pass on linux. It compiles on android arm64/mips64.
Reviewers: chaoren, mohit.bhakkad
Subscribers: tberghammer, aemerson, lldb-commits
Differential Revision: http://reviews.llvm.org/D10808
llvm-svn: 241079
Alex Lorenz [Tue, 30 Jun 2015 16:51:29 +0000 (16:51 +0000)]
MIR Parser: adopt the 'maybeLex...' pattern. NFC.
This commit refactors the machine instruction lexer so that the lexing
functions use the 'maybeLex...' pattern, where they determine if they
can lex the current token by themselves.
Reviewers: Sean Silva
Differential Revision: http://reviews.llvm.org/D10817
llvm-svn: 241078
Reid Kleckner [Tue, 30 Jun 2015 16:32:04 +0000 (16:32 +0000)]
[clang-cl] Use /arch: to set the base target CPU
The main effect of this change is that /arch:IA32 will use i386 as the
CPU, while clang-cl will continue to default to pentium4 (aka SSE2 plus
the usual other features).
/arch:AVX and /arch:AVX2 will also now enable the other features
available in sandybridge and haswell respectively, which is consistent
with MSDN.
llvm-svn: 241077
Sanjay Patel [Tue, 30 Jun 2015 16:30:22 +0000 (16:30 +0000)]
use range-based for loops; NFCI
llvm-svn: 241076
Rafael Espindola [Tue, 30 Jun 2015 15:34:00 +0000 (15:34 +0000)]
Update for llvm change.
llvm-svn: 241075
Rafael Espindola [Tue, 30 Jun 2015 15:33:44 +0000 (15:33 +0000)]
Fix the name of the iterator functions to match the coding standards.
llvm-svn: 241074
Gabor Horvath [Tue, 30 Jun 2015 15:31:17 +0000 (15:31 +0000)]
[Static Analyzer] Minor improvements to SATest.
Differential Revision: http://reviews.llvm.org/D10812
llvm-svn: 241073
Alexander Potapenko [Tue, 30 Jun 2015 15:18:03 +0000 (15:18 +0000)]
[ASan] Add a regression test for r240960 (https://crbug.com/502974)
The test simulates a sandbox that prevents the program from calling readlink().
ASan is supposed to still be able to print the executable name regardless of that.
llvm-svn: 241072
Ewan Crawford [Tue, 30 Jun 2015 15:03:31 +0000 (15:03 +0000)]
Fix windows build.
Windows build was broken in either r240983 or r240978 in the changes to FileSpec.cpp
llvm-svn: 241071
Rafael Espindola [Tue, 30 Jun 2015 14:59:20 +0000 (14:59 +0000)]
Report an error on invalid sh_entsize.
llvm-svn: 241070
Michael Kuperstein [Tue, 30 Jun 2015 14:38:57 +0000 (14:38 +0000)]
[X86] Fix a bug in WIN_FTOL_32/64 handling.
Duplicating an FP register "as itself" is a bad idea, since it violates the
invariant that every FP register is mapped to at most one FPU stack slot.
Use the scratch FP register instead.
This fixes PR23957.
llvm-svn: 241069
Marshall Clow [Tue, 30 Jun 2015 14:16:49 +0000 (14:16 +0000)]
Implement LWG#2407: 'packaged_task(allocator_arg_t, const Allocator&, F&&) should neither be constrained nor explicit'
llvm-svn: 241068
Marshall Clow [Tue, 30 Jun 2015 14:04:14 +0000 (14:04 +0000)]
Implement N4508: shared_mutex. Reviewed as reviews.llvm.org/D10480
llvm-svn: 241067
Toma Tabacu [Tue, 30 Jun 2015 13:46:03 +0000 (13:46 +0000)]
[mips] [IAS] Add support for the .module softfloat/hardfloat directives.
These directives are used to set the default value of the SoftFloat feature.
They have the same effect as setting -m{soft, hard}-float from the command line.
Differential Revision: http://reviews.llvm.org/D9073
llvm-svn: 241066
Michael Kuperstein [Tue, 30 Jun 2015 13:36:19 +0000 (13:36 +0000)]
[X86] Rename DEFAULT_FN_ATTR macro to __DEFAULT_FN_ATTR
llvm-svn: 241065
Marshall Clow [Tue, 30 Jun 2015 13:32:08 +0000 (13:32 +0000)]
Mark LWG#2266 as complete. This is a tightening up the wording; no code changes required.
llvm-svn: 241064
Ewan Crawford [Tue, 30 Jun 2015 13:08:44 +0000 (13:08 +0000)]
Change search order of target definition files.
Make the python target definition file have highest priority so that we can set
the remote stub breakpoint pc offset using it.
Reviewers: clayborg
Subscribers: ted, deepak2427, lldb-commits
Differential revision: http://reviews.llvm.org/D10775
llvm-svn: 241063
Toma Tabacu [Tue, 30 Jun 2015 12:41:33 +0000 (12:41 +0000)]
[mips] [IAS] Make .module directives change AssemblerOptions->front().
Differential Revision: http://reviews.llvm.org/D10643
llvm-svn: 241062
Ranjeet Singh [Tue, 30 Jun 2015 12:32:53 +0000 (12:32 +0000)]
Reverting r241058 because it's causing buildbot failures.
llvm-svn: 241061
Hubert Tong [Tue, 30 Jun 2015 12:14:52 +0000 (12:14 +0000)]
[CONCEPTS] Parsing of concept keyword
Summary: This change adds parsing for the concept keyword in a
declaration and tracks the location. Diagnostic testing added for
invalid use of concept keyword.
Reviewers: faisalv, fraggamuffin, rsmith, hubert.reinterpretcast
Reviewed By: rsmith, hubert.reinterpretcast
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D10528
Patch by Nathan Wilson!
llvm-svn: 241060
Daniel Jasper [Tue, 30 Jun 2015 11:32:22 +0000 (11:32 +0000)]
clang-format: Properly parse parenthesis in braced lists.
Among other things, this makes clang-format understand arbitrary blocks
embedded in them, such as:
SomeFunction({MACRO({ return output; }), b});
where MACRO could e.g. expand to a lambda.
llvm-svn: 241059
Ranjeet Singh [Tue, 30 Jun 2015 11:30:42 +0000 (11:30 +0000)]
There are a few places where subtarget features are still
represented by uint64_t, this patch replaces these
usages with the FeatureBitset (std::bitset) type.
Differential Revision: http://reviews.llvm.org/D10542
llvm-svn: 241058
Tamas Berghammer [Tue, 30 Jun 2015 10:41:23 +0000 (10:41 +0000)]
Fix [vdso] handling on Android (x86 and aarch64)
* Add in-memory object file handling to the core dynamic loader
* Fix in memory object file handling in ObjectFileELF (previously
only part of the file was loaded before parsing)
* Fix load address setting in ObjectFileELF for 32-bit targets
when the load bias is negative
* Change hack in DYLDRendezvous.cpp to be more specific and not to
interfere with object files with fixed load address
Differential revision: http://reviews.llvm.org/D10800
llvm-svn: 241057
Pavel Labath [Tue, 30 Jun 2015 10:20:52 +0000 (10:20 +0000)]
Add a missing header
llvm-svn: 241056
Michael Kuperstein [Tue, 30 Jun 2015 10:18:54 +0000 (10:18 +0000)]
[X86] Add missing undef of DEFAULT_FN_ATTRS in FXSR intrinsics
llvm-svn: 241055
David Majnemer [Tue, 30 Jun 2015 10:05:43 +0000 (10:05 +0000)]
Correct a typo for a LoopVectorize test
I forgot to specify the correct pass.
llvm-svn: 241054
Michael Kuperstein [Tue, 30 Jun 2015 09:45:38 +0000 (09:45 +0000)]
[X86] Add FXSR intrinsics
Add intrinsics for the FXSR instructions (FXSAVE/FXSAVE64/FXRSTOR/FXRSTOR64)
These were previously declared in Intrin.h for MSVC compatibility, but now
that we have them implemented, these declarations can be removed.
llvm-svn: 241053
Toma Tabacu [Tue, 30 Jun 2015 09:36:50 +0000 (09:36 +0000)]
[mips] [IAS] Add support for the .set oddspreg/nooddspreg directives.
Differential Revision: http://reviews.llvm.org/D10657
llvm-svn: 241052
Tamas Berghammer [Tue, 30 Jun 2015 09:35:46 +0000 (09:35 +0000)]
Ignore "push/pop {sp}" in emulation based unwinding
These instructions confusing the unwind code because in case of a
push it assumes that the original valu of a register is pushed to
the stack what is not neccessarily true in case of SP. The same is
true for the pop (in the opposite way).
Differential revision: http://reviews.llvm.org/D10806
llvm-svn: 241051
Tamas Berghammer [Tue, 30 Jun 2015 09:26:52 +0000 (09:26 +0000)]
Fix LLDB build after r241035
llvm-svn: 241050
Michael Kuperstein [Tue, 30 Jun 2015 08:49:35 +0000 (08:49 +0000)]
[X86] Add FXSR intrinsics
Add intrinsics for the FXSR instructions (FXSAVE/FXSAVE64/FXRSTOR/FXRSTOR64)
llvm-svn: 241049
Tobias Grosser [Tue, 30 Jun 2015 08:22:14 +0000 (08:22 +0000)]
Update isl to isl-0.15-30-g3518765
This updated contains various changes to isl, including improvements to the
AST generator. For Polly, the most important change is a fix that unbreaks
builds on darwin (reported by: Jack Howard)
llvm-svn: 241048
NAKAMURA Takumi [Tue, 30 Jun 2015 08:02:26 +0000 (08:02 +0000)]
Fix a couple of tests in clang/test to match "x86_thiscallcc" introduced in r240971.
llvm-svn: 241047
Yaron Keren [Tue, 30 Jun 2015 07:35:19 +0000 (07:35 +0000)]
Unbreak the Visual C++ 2013 build after r241032.
clang\lib\Parse\ParseDeclCXX.cpp(2396): error C3486: a parameter for a lambda cannot have a default argument
llvm-svn: 241046
Mohit K. Bhakkad [Tue, 30 Jun 2015 06:29:12 +0000 (06:29 +0000)]
[LLDB][MIPS] Getting correct flags for MIPS
Patch by Nitesh Jain
Reviewers: clayborg, ovyalov, emaste.
Subscribers: jaydeep, bhushan, dsanders, mohit.bhakkad, sagar, labath, tberghammer, lldb-commits.
Differential Revision: http://reviews.llvm.org/D10685
llvm-svn: 241045
NAKAMURA Takumi [Tue, 30 Jun 2015 05:59:13 +0000 (05:59 +0000)]
ELF.h: Prune obsolete comments removed in r240996. [-Wdocumentation]
FIXME: Should they be moved onto Elf_Sym_Impl::getNmae()?
llvm-svn: 241044
David Majnemer [Tue, 30 Jun 2015 04:41:18 +0000 (04:41 +0000)]
[CodeGen] Tweak isTriviallyRecursive further
isTriviallyRecursive is a hack used to bridge a gap between the
expectations that source code assumes and the semantics that LLVM IR can
provide. Specifically, asm labels on functions are treated as an
explicit name for a GlobalObject in Clang but treated like an
output-processing step in GCC. Tweak this hack a little further to emit
calls to library functions instead of emitting an incorrect definition.
The definition in question would have available_externally linkage (this
is OK) but result in a call to itself which will either result in an
infinite loop or stack overflow.
This fixes PR23964.
llvm-svn: 241043
Rafael Espindola [Tue, 30 Jun 2015 04:08:37 +0000 (04:08 +0000)]
Don't return error_code from a function that doesn't fail.
llvm-svn: 241042
Dan Gohman [Tue, 30 Jun 2015 03:52:25 +0000 (03:52 +0000)]
Drop the OS from the WebAssembly target triple for now.
This unbreaks TripleTest.Normalization. We'll have to come up with a new
plan for the OS component of the target triple for WebAssembly.
llvm-svn: 241041
Rafael Espindola [Tue, 30 Jun 2015 03:41:26 +0000 (03:41 +0000)]
Move function to the only file that uses it.
llvm-svn: 241040
Rafael Espindola [Tue, 30 Jun 2015 03:33:18 +0000 (03:33 +0000)]
Don't return error_code from a function that doesn't fail.
llvm-svn: 241039
David Majnemer [Tue, 30 Jun 2015 03:30:26 +0000 (03:30 +0000)]
[MS ABI] Workaround corner-case bug in the ABI for operator delete
MSVC only genreates array cookies if the class has a destructor. This
is problematic when having to call T::operator delete[](void *, size_t)
because the second argument's argument is impossible to synthesize
correctly if the class has no destructor (because there will be no array
cookie).
Instead, MSVC passes the size of the class. Do the same, for
compatibility, instead of crashing.
This fixes PR23990.
llvm-svn: 241038
Andrew Wilkins [Tue, 30 Jun 2015 02:52:38 +0000 (02:52 +0000)]
Sphinx-based clang man pages
Summary:
This diff introduces .rst files, Sphinx config, and a CMake target
for building clang man pages. This will deprecate the existing .pod-
based man page, and will integrate nicely with CMake. This diff does
not remove the existing man page; that will be done in a follow-up
once packagers have had a chance to react to the change.
For now, only clang(1) has been done; others can be added over time
by dropping additional files into the docs/CommandGuide directory.
The index page for CommandGuide has been copied from LLVM's
docs/CommandGuide.
The man page itself is mostly the same, with a few minor cosmetic
changes. The only major change is the SYNOPSIS section. I was unable
to get .rst/Sphinx produce the same style as in the existing man page.
Instead, I changed it to match the LLVM tools' relatively simple style.
To build the man pages, use the "docs-clang-man" target if building
with CMake. Otherwise, use "make -f Makefile.sphinx man".
Reviewers: cmatthews, silvas
Subscribers: dim, gaeke, beanz, cfe-commits
Differential Revision: http://reviews.llvm.org/D10562
llvm-svn: 241037
Adrian Prantl [Tue, 30 Jun 2015 02:34:37 +0000 (02:34 +0000)]
Add two missing arguments.
I forgot to add this file to r241035.
llvm-svn: 241036
Adrian Prantl [Tue, 30 Jun 2015 02:26:03 +0000 (02:26 +0000)]
Pass HeaderSearchOptions and PreprocessorOptions into CodeGenModule.
In order to produce debug info for clang modules CGDebugInfo it needs
access to macros passed on the command line and the isysroot.
llvm-svn: 241035
Adrian Prantl [Tue, 30 Jun 2015 02:13:04 +0000 (02:13 +0000)]
Debug info: Add dwarf backend support for DIModule.
rdar://problem/
20965932
llvm-svn: 241034
Rafael Espindola [Tue, 30 Jun 2015 01:53:01 +0000 (01:53 +0000)]
Don't return error_code from a function that doesn't fail.
llvm-svn: 241033
Richard Smith [Tue, 30 Jun 2015 01:28:56 +0000 (01:28 +0000)]
Rework parsing of pure-specifiers. Perform the grammar matching and
disambiguation in the parser rather than trying to do it in Sema.
llvm-svn: 241032
Peter Collingbourne [Tue, 30 Jun 2015 01:15:54 +0000 (01:15 +0000)]
Add layout/triple to fix test on platforms where names are mangled.
llvm-svn: 241031
Dan Gohman [Tue, 30 Jun 2015 00:56:48 +0000 (00:56 +0000)]
Fix LastArchType to point to the new last arch.
llvm-svn: 241030
Peter Collingbourne [Tue, 30 Jun 2015 00:47:52 +0000 (00:47 +0000)]
COFF: Implement SymbolBody::getDebugName() for DefinedBitcode symbols.
Differential Revision: http://reviews.llvm.org/D10827
llvm-svn: 241029
Rafael Espindola [Tue, 30 Jun 2015 00:33:59 +0000 (00:33 +0000)]
Cleanup getRelocationAddend.
Realistically, this will be returning ErrorOr for some time as refactoring the
user code to check once per section will take some time.
Given that, use it for checking if a relocation has addend or not.
While at it, add ELFRelocationRef to simplify the users.
llvm-svn: 241028
Matthias Braun [Tue, 30 Jun 2015 00:33:44 +0000 (00:33 +0000)]
RegisterCoalescer: Cleanup empty subranges after shrinkToUses()
A call to removeEmptySubranges() is necessary after every operation that
potentially removes all segments from a subregister range; this case in
the register coalescer was missing.
llvm-svn: 241027
Adrian Prantl [Tue, 30 Jun 2015 00:25:41 +0000 (00:25 +0000)]
llvm-bcanalyzer: Add a field that was missed in r241016.
llvm-svn: 241026
Rui Ueyama [Tue, 30 Jun 2015 00:10:54 +0000 (00:10 +0000)]
COFF: Make DefinedCOFF one pointer smaller.
The size of this class actually matters because this is the
most popular class among all classes. We create a Defined symbol
for each defined symbol in a symbol table. That can be millions
for a large program. For example, linking LLD instantiates this
class millions times.
llvm-svn: 241025
Rui Ueyama [Tue, 30 Jun 2015 00:03:56 +0000 (00:03 +0000)]
Object/COFF: Define coff_symbol_generic.
If you only need Name and Value fields in the COFF symbol,
you don't need to distinguish 32 bit and 64 bit COFF symbols.
These fields start at the same offsets and have the same size.
This data strucutre is one pointer smaller than COFFSymbolRef
thus slightly efficient. I'll use this class in LLD as we create
millions of LLD symbol objects that currently contain COFFSymbolRef.
Shaving off 8 byte (or 4 byte on 32 bit) from that class actually
matters becasue of the number of objects we create in LLD.
llvm-svn: 241024
Rafael Espindola [Mon, 29 Jun 2015 23:55:05 +0000 (23:55 +0000)]
Use asserts for checks that should never fail.
If a section is not SHT_REL or SHT_RELA, we never create a valid iterator,
so the getRelocation* methods should always see a section with the correct type.
llvm-svn: 241023
Dan Gohman [Mon, 29 Jun 2015 23:51:55 +0000 (23:51 +0000)]
[WebAssembly] Initial WebAssembly backend
This WebAssembly backend is just a skeleton at this time and is not yet
functional.
llvm-svn: 241022
Rafael Espindola [Mon, 29 Jun 2015 23:29:12 +0000 (23:29 +0000)]
Don't return error_code from function that never fails.
llvm-svn: 241021
Peter Collingbourne [Mon, 29 Jun 2015 23:26:28 +0000 (23:26 +0000)]
COFF: Use LTOModule::getLinkerOpts() instead of reading the linker directives ourselves.
llvm-svn: 241020
Richard Smith [Mon, 29 Jun 2015 23:19:23 +0000 (23:19 +0000)]
PR23942: a pure-specifier's integer literal must be spelled '0'
llvm-svn: 241019
Peter Collingbourne [Mon, 29 Jun 2015 23:09:12 +0000 (23:09 +0000)]
lto: Clean up C libLTO interfaces pertaining to linker flags.
Specifically, remove the dependent library interface and replace the existing
linker option interface with a new one that returns a single list of flags.
Differential Revision: http://reviews.llvm.org/D10820
llvm-svn: 241018
Adrian Prantl [Mon, 29 Jun 2015 23:03:47 +0000 (23:03 +0000)]
Add a DIModule metadata node to the IR.
It is meant to be used to record modules @imported by the current
compile unit, so a debugger an import the same modules to replicate this
environment before dropping into the expression evaluator.
DIModule is a sibling to DINamespace and behaves quite similarly.
In addition to the name of the module it also records the module
configuration details that are necessary to uniquely identify the module.
This includes the configuration macros (e.g., -DNDEBUG), the include path
where the module.map file is to be found, and the isysroot.
The idea is that the backend will turn this into a DW_TAG_module.
http://reviews.llvm.org/D9614
rdar://problem/
20965932
llvm-svn: 241017
Duncan P. N. Exon Smith [Mon, 29 Jun 2015 22:50:35 +0000 (22:50 +0000)]
bcanalyzer: Rewrite all the METADATA_ codes
Add all the new `Metadata` codes since LLVM 3.6, and at the same time
follow the precedent set in other blocks by removing the `METADATA_`
prefix from the string output.
llvm-svn: 241016
Duncan P. N. Exon Smith [Mon, 29 Jun 2015 22:50:32 +0000 (22:50 +0000)]
bcanalyzer: Use a macro to decode bitcodes, NFC
I'm about to add a whack of missing names for metadata. Add a macro to
make this easier.
llvm-svn: 241015
Ying Chen [Mon, 29 Jun 2015 22:40:33 +0000 (22:40 +0000)]
Revert "Mark test_sb_api_listener_event_process_state as flakey"
This reverts commit
a4f5f4da7e164b7ac358a75f2e4254c25718ad4b.
This test fails 100% with gcc4.9.2, revert it first. Will find out why xfail is overruled by xflaky.
llvm-svn: 241014
Marshall Clow [Mon, 29 Jun 2015 22:27:30 +0000 (22:27 +0000)]
Mark LWG#2439 as complete. This is a tightening up the wording; no code changes required.
llvm-svn: 241013
Ben Langmuir [Mon, 29 Jun 2015 22:16:39 +0000 (22:16 +0000)]
Reapply "Use gethostuuid() on Mac to identify hosts for LockFileManager"
Reapplies r241005 after fixing the build on non-Mac platforms. Original
commit message below.
The hostname can be very unstable when there are many machines on the
network competing for the same name. Using the hardware UUID makes it
less likely to have collisions or to consider files written by the
current host to be owned by a different one at a later time.
rdar://problem/
21512307
llvm-svn: 241012
Rui Ueyama [Mon, 29 Jun 2015 22:16:21 +0000 (22:16 +0000)]
COFF: Split ObjectFile::createSymbolBody into small functions. NFC.
llvm-svn: 241011
Peter Collingbourne [Mon, 29 Jun 2015 22:04:09 +0000 (22:04 +0000)]
Teach LTOModule to emit linker flags for dllexported symbols, plus interface cleanup.
This change unifies how LTOModule and the backend obtain linker flags
for globals: via a new TargetLoweringObjectFile member function named
emitLinkerFlagsForGlobal. A new function LTOModule::getLinkerOpts() returns
the list of linker flags as a single concatenated string.
This change affects the C libLTO API: the function lto_module_get_*deplibs now
exposes an empty list, and lto_module_get_*linkeropts exposes a single element
which combines the contents of all observed flags. libLTO should never have
tried to parse the linker flags; it is the linker's job to do so. Because
linkers will need to be able to parse flags in regular object files, it
makes little sense for libLTO to have a redundant mechanism for doing so.
The new API is compatible with the old one. It is valid for a user to specify
multiple linker flags in a single pragma directive like this:
#pragma comment(linker, "/defaultlib:foo /defaultlib:bar")
The previous implementation would not have exposed
either flag via lto_module_get_*deplibs (as the test in
TargetLoweringObjectFileCOFF::getDepLibFromLinkerOpt was case sensitive)
and would have exposed "/defaultlib:foo /defaultlib:bar" as a single flag via
lto_module_get_*linkeropts. This may have been a bug in the implementation,
but it does give us a chance to fix the interface.
Differential Revision: http://reviews.llvm.org/D10548
llvm-svn: 241010
Sanjoy Das [Mon, 29 Jun 2015 22:00:30 +0000 (22:00 +0000)]
[FaultMaps][Docs] Document the ImplicitNullChecks pass.
llvm-svn: 241009
Rui Ueyama [Mon, 29 Jun 2015 21:59:34 +0000 (21:59 +0000)]
Move llvm_unreachable out of switch to avoid -Wswitch-covered-defualt.
llvm-svn: 241008
Ben Langmuir [Mon, 29 Jun 2015 21:56:03 +0000 (21:56 +0000)]
Revert "Use gethostuuid() on Mac to identify hosts for LockFileManager"
Broke non-Mac builds.
This reverts commit r241005.
llvm-svn: 241007
Keno Fischer [Mon, 29 Jun 2015 21:52:45 +0000 (21:52 +0000)]
Add -lpthread to LLDB shared lib link line unconditionally
Usually -lpthread is included due to LLVM link options,
but when LLVM threading is disabled, this does not happen.
pthread is still needed however because LLDB uses threading
regardless of whether LLVM is built with threading support or not.
Differential Revision: http://reviews.llvm.org/D5431
llvm-svn: 241006
Ben Langmuir [Mon, 29 Jun 2015 21:47:44 +0000 (21:47 +0000)]
Use gethostuuid() on Mac to identify hosts for LockFileManager
The hostname can be very unstable when there are many machines on the
network competing for the same name. Using the hardware UUID makes it
less likely to have collisions or to consider files written by the
current host to be owned by a different one at a later time.
rdar://problem/
21512307
llvm-svn: 241005
Rui Ueyama [Mon, 29 Jun 2015 21:46:46 +0000 (21:46 +0000)]
Silence MSVC "not all control paths return a value" warning.
llvm-svn: 241004
Tim Northover [Mon, 29 Jun 2015 21:42:16 +0000 (21:42 +0000)]
ARM: add correct kill flags when combining stm instructions
When the store sequence being combined actually stores the base register, we
should not mark it as killed until the end.
rdar://
21504262
llvm-svn: 241003
Matthias Braun [Mon, 29 Jun 2015 21:35:51 +0000 (21:35 +0000)]
X86: Rework inline asm integer register specification.
This is a new version of http://reviews.llvm.org/D10260.
It turned out that when you specify an integer register in inline asm on
x86 you get the register of the required type size back. That means that
X86TargetLowering::getRegForInlineAsmConstraint() has to accept any of
the integer registers and adapt its size to the given target size which
may be any 8/16/32/64 bit sized type. Surprisingly that means given a
constraint of "{ax}" and a type of MVT::F32 we need to return X86::EAX.
This change makes this face explicit, the previous code seemed like
working by accident because there it never returned an error once a
register was found. On the other hand this rewrite allows to actually
return errors for invalid situations like requesting an integer register
for an i128 type.
Related to rdar://
21042280
Differential Revision: http://reviews.llvm.org/D10813
llvm-svn: 241002
Chandler Carruth [Mon, 29 Jun 2015 21:35:48 +0000 (21:35 +0000)]
[opt] Devirtualize the SymbolBody type hierarchy and start compacting
its members into the base class.
First, to help motivate this kind of change, understand that in
a self-link, LLD creates 5.5 million defined regular symbol bodies (and
6 million symbol bodies total). A significant portion of its time is
spent allocating the memory for these symbols, and befor ethis patch
the defined regular symbol body objects alone consumed some 420mb of
memory during the self link.
As a consequence, I think it is worth expending considerable effort to
make these objects as memory efficient as possible. This is the first of
several components of that. This change starts with the goal of removing
the virtual functins from SymbolBody so that it can avoid having a vptr
embedded in it when it already contains a "kind" member, and that member
can be much more compact than a vptr.
The primary way of doing this is to sink as much of the logic that we
would have to dispatch for into data in the base class. As part of this,
I made the various flags bits that will pack into a bitfield with the
kind tag. I also sank the Name down to eliminate the dispatch for that,
and used LLVM's RTTI-style dispatch for everything else (most of which
is cold and so doesn't matter terribly if we get minutely worse lowering
than a vtable dispatch).
As I was doing this, I wanted to make the RTTI-dispatch (which would
become much hotter than before) as efficient as possible, so I've
re-organized the tags somewhat. Notably, the common case (regular
defined symbols) is now zero which we can test for faster.
I also needed to rewrite the comparison routine used during resolving
symbols. This proved to be quite complex as the semantics of the
existing one were very subtle due to the back-and-forth virtual dispatch
caused by re-dispatching with reversed operands. I've consolidated it to
a single function and tried to comment it quite a bit more to help
explain what is going on. However, this may need more comments or other
explanations. It at least passes all the regression tests. I'm not
working on Windows, so I can't fully test it.
With all of these changes, the size of a DefinedRegular symbol on
a 64-bit build goes from 80 bytes to 64 bytes, and we save approximately
84mb or 20% of the memory consumed by these symbol bodies during the
link.
The link time appears marginally faster as well, and the profile hotness
of the memory allocation subsystem got a bit better, but there is still
a lot of allocation traffic.
Differential Revision: http://reviews.llvm.org/D10792
llvm-svn: 241001
Chandler Carruth [Mon, 29 Jun 2015 21:32:37 +0000 (21:32 +0000)]
[cleanup] Clean up the flow of creating a symbol body for regular symbols.
This uses a single cast and test to get the section for the symbol, and
uses the cast_or_null<> pattern throughout to handle the known type but
unknown non-null-ness.
No functionality changed.
Differential Revision: http://reviews.llvm.org/D10791
llvm-svn: 241000
Alexey Samsonov [Mon, 29 Jun 2015 21:30:14 +0000 (21:30 +0000)]
[LoopSimplify] Set proper debug location in loop backedge blocks.
Set debug location for terminator instruction in loop backedge block
(which is an unconditional jump to loop header). We can't copy debug
location from original backedges, as there can be several of them,
with different debug info locations. So, we follow the approach of
SplitBlockPredecessors, and copy the debug info from first non-PHI
instruction in the header (i.e. destination block).
This is yet another change for PR23837.
llvm-svn: 240999
Sanjoy Das [Mon, 29 Jun 2015 21:27:36 +0000 (21:27 +0000)]
[FaultMaps] Fix test case.
implicit-null-check-negative.ll had a missing 2>&1. Fix this, and
remove an incorrect test case that this exposes.
llvm-svn: 240998
Rafael Espindola [Mon, 29 Jun 2015 21:26:07 +0000 (21:26 +0000)]
Update for llvm api change.
llvm-svn: 240997
Rafael Espindola [Mon, 29 Jun 2015 21:24:55 +0000 (21:24 +0000)]
Convert obj->getSymbolName to sym->getName.
I doesn't depend on the object anymore.
llvm-svn: 240996
Chandler Carruth [Mon, 29 Jun 2015 21:12:49 +0000 (21:12 +0000)]
[opt] Replace the recursive walk for GC with a worklist algorithm.
This flattens the entire liveness walk from a recursive mark approach to
a worklist approach. It also sinks the worklist management completely
out of the SectionChunk and into the Writer by exposing the ability to
iterato over children of a chunk and over the symbol bodies of relocated
symbols. I'm not 100% happy with the API names, so suggestions welcome
there.
This allows us to use a single worklist for the entire recursive walk
and would also be a natural place to take advantage of parallelism at
some future point.
With this, we completely inline away the GC walk into the
Writer::markLive function and it makes it very easy to profile what is
slow. Currently, time is being wasted checking whether a Chunk isa
SectionChunk (it essentially always is), finding (or skipping)
a replacement for a symbol, and chasing pointers between symbols and
their chunks. There are a bunch of things we can do to fix this, and its
easier to do them after this change IMO.
This change alone saves 1-2% of the time for my self-link of lld.exe
(which I'm running and benchmarking on Linux ironically).
Perhaps more notably, we'll no longer blow out the stack for large
links. =]
Just as an FYI, at this point, I/O is starting to really dominate the
profile. Well over 10% of the time appears to be inside the kernel doing
page table silliness. I think a decent chunk of this can be nuked as
well, but it's a little odd as cross-linking in this way isn't really
the primary goal here.
Differential Revision: http://reviews.llvm.org/D10790
llvm-svn: 240995
Eric Christopher [Mon, 29 Jun 2015 21:00:05 +0000 (21:00 +0000)]
Add support for the x86 builtin __builtin_cpu_supports.
This matches the implementation of the gcc support for the same
feature, including checking the values set up by libgcc at runtime.
The structure looks like this:
unsigned int __cpu_vendor;
unsigned int __cpu_type;
unsigned int __cpu_subtype;
unsigned int __cpu_features[1];
with a set of enums to match various fields that are field out after
parsing the output of the cpuid instruction.
This also adds a set of errors checking for valid input (and cpu).
compiler-rt support for this and the other builtins in this family
(__builtin_cpu_init and __builtin_cpu_is) are forthcoming.
llvm-svn: 240994
Greg Clayton [Mon, 29 Jun 2015 20:42:28 +0000 (20:42 +0000)]
Make sure that SharingPtr.h appears in the LLDB.framework by making it a public header in the LLDB framework target.
This fixes test issues with building lldb/test/api/multithreaded and a few other tests that build against the LLDB.framework in our build directory.
llvm-svn: 240993
Evgeniy Stepanov [Mon, 29 Jun 2015 20:28:55 +0000 (20:28 +0000)]
[asan] Fix SanitizerCommon.PthreadDestructorIterations test on Android L.
On Android L, TSD destructors run 8 times instead of 4.
Back to 4 times on the current master branch (as well as on K).
llvm-svn: 240992
Pawel Bylica [Mon, 29 Jun 2015 20:28:47 +0000 (20:28 +0000)]
[DAGCombiner] Fix & simplify constant folding of sext/zext.
Summary: This patch fixes the cases of sext/zext constant folding in DAG combiner where constans do not fit 64 bits. The fix simply removes un$
Test Plan: New regression test included.
Reviewers: RKSimon
Reviewed By: RKSimon
Subscribers: RKSimon, llvm-commits
Differential Revision: http://reviews.llvm.org/D10607
llvm-svn: 240991
Benjamin Kramer [Mon, 29 Jun 2015 20:21:55 +0000 (20:21 +0000)]
[MMI] Use TinyPtrVector instead of PointerUnion with vector.
Also simplify duplicated code a bit. No functionality change intended.
llvm-svn: 240990
David Majnemer [Mon, 29 Jun 2015 20:13:23 +0000 (20:13 +0000)]
[CodeGen] Remove atomic sugar from record types in isSafeToConvert
We failed to see that we should have deferred the creation of a type
which references a type currently under construction because of atomic
sugar.
This fixes PR23985.
llvm-svn: 240989
Greg Clayton [Mon, 29 Jun 2015 20:08:51 +0000 (20:08 +0000)]
More packet reduction when debugging with GDB server.
- Avoid sending the qfThreadInfo, qsThreadInfo packets if we have a stop reply packet with the threads already (save 2 round trip packets)
- Include the qname, qserial and qkind in the JSON info
- Report the qname, qserial and qkind to the thread so it can cache it to avoid many packets on MacOSX and iOS
- Don't clear all discoverable settings when we exec, just the ones we need to saves 1-5 packets for each exec.
llvm-svn: 240988
Diego Novillo [Mon, 29 Jun 2015 20:03:46 +0000 (20:03 +0000)]
Tidy comment.
llvm-svn: 240987
Michael Kruse [Mon, 29 Jun 2015 19:57:59 +0000 (19:57 +0000)]
[Polly] Add -std=c99 flag only to C source files
Summary: Adding the flag to C++ source files emits a warning, hence we set the compile flag depending on the file's language.
Reviewers: grosser
Subscribers: Meinersbur, pollydev, llvm-commits
Projects: #polly
Differential Revision: http://reviews.llvm.org/D10809
llvm-svn: 240986