platform/upstream/llvm.git
9 years agoFix several typos in LangRef.rst related to loop unrolling metadata.
Mark Heffernan [Tue, 30 Jun 2015 22:48:51 +0000 (22:48 +0000)]
Fix several typos in LangRef.rst related to loop unrolling metadata.

llvm-svn: 241126

9 years ago[SEH] Add new intrinsics for recovering and restoring parent frames
Reid Kleckner [Tue, 30 Jun 2015 22:46:59 +0000 (22:46 +0000)]
[SEH] Add new intrinsics for recovering and restoring parent frames

The incoming EBP value established by the runtime is actually a pointer
to the end of the EH registration object, and not the true parent
function frame pointer. Clang doesn't need llvm.x86.seh.exceptioninfo
anymore because we know that the exception info pointer is at a fixed
offset from this incoming EBP.

The llvm.x86.seh.recoverfp intrinsic takes an EBP value provided by the
EH runtime and returns a pointer that is usable with llvm.framerecover.

The llvm.x86.seh.restoreframe intrinsic is inserted by the 32-bit
specific preparation pass in blocks targetted by the EH runtime. It
re-establishes any physical registers used by the parent function to
address the stack, such as the frame, base, and stack pointers.

Neither of these intrinsics correctly handle stack realignment prologues
yet, but it's possible to add that later.

Reviewers: majnemer

Differential Revision: http://reviews.llvm.org/D10848

llvm-svn: 241125

9 years ago[IRBuilder] Delete unused constructor and SetInsertPoint overload.
Alexey Samsonov [Tue, 30 Jun 2015 22:38:22 +0000 (22:38 +0000)]
[IRBuilder] Delete unused constructor and SetInsertPoint overload.

llvm-svn: 241124

9 years agoFix memory leak in unittest added in r241101.
Alexey Samsonov [Tue, 30 Jun 2015 22:17:29 +0000 (22:17 +0000)]
Fix memory leak in unittest added in r241101.

llvm-svn: 241123

9 years ago[Cloning] Teach CloneModule about personality functions
David Majnemer [Tue, 30 Jun 2015 22:14:01 +0000 (22:14 +0000)]
[Cloning] Teach CloneModule about personality functions

CloneModule didn't take into account that it needed to remap the value
using values in the module.

This fixes PR23992.

llvm-svn: 241122

9 years agoFix use-after-free.
Peter Collingbourne [Tue, 30 Jun 2015 22:08:44 +0000 (22:08 +0000)]
Fix use-after-free.

llvm-svn: 241121

9 years ago[modules] Make sure macros get made visible in the top-level file if we've got
Richard Smith [Tue, 30 Jun 2015 21:29:55 +0000 (21:29 +0000)]
[modules] Make sure macros get made visible in the top-level file if we've got
local submodule visibility enabled; that top-level file might not actually be
the module includes buffer if use of prebuilt modules is disabled.

llvm-svn: 241120

9 years ago[asan] Suppress read_binary_name_regtest.c test failure on unsupported hosts.
Evgeniy Stepanov [Tue, 30 Jun 2015 21:28:55 +0000 (21:28 +0000)]
[asan] Suppress read_binary_name_regtest.c test failure on unsupported hosts.

read_binary_name_regtest.c requires seccomp kernel headers.
Make the test pass if <linux/seccomp.h> is missing.

llvm-svn: 241119

9 years ago[NVPTX] cleanups and refacotring in NVPTXFrameLowering.cpp
Jingyue Wu [Tue, 30 Jun 2015 21:28:31 +0000 (21:28 +0000)]
[NVPTX] cleanups and refacotring in NVPTXFrameLowering.cpp

Summary: NFC

Test Plan: no regression

Reviewers: wengxt

Reviewed By: wengxt

Subscribers: jholewinski, llvm-commits

Differential Revision: http://reviews.llvm.org/D10849

llvm-svn: 241118

9 years ago[MS ABI] Stick constructor closures in an IR COMDAT group
David Majnemer [Tue, 30 Jun 2015 21:23:51 +0000 (21:23 +0000)]
[MS ABI] Stick constructor closures in an IR COMDAT group

We no-longer stick linkonce_odr entities in COMDATs in the backend.
Instead, we rely on the IR COMDAT mechanism.

llvm-svn: 241117

9 years ago[FaultMaps] Let the frontend pre-select implicit null check candidates.
Sanjoy Das [Tue, 30 Jun 2015 21:22:32 +0000 (21:22 +0000)]
[FaultMaps] Let the frontend pre-select implicit null check candidates.

Summary:
This change introduces a !make.implicit metadata that allows the
frontend to pre-select the set of explicit null checks that will be
considered for transformation into implicit null checks.

The reason for not using profiling data instead of !make.implicit is
explained in the change to `FaultMaps.rst`.

Reviewers: atrick, reames, pgavlin, JosephTremoulet

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D10824

llvm-svn: 241116

9 years agoPack MCSymbol::HasName in to a spare bit in the section/fragment union.
Pete Cooper [Tue, 30 Jun 2015 20:54:21 +0000 (20:54 +0000)]
Pack MCSymbol::HasName in to a spare bit in the section/fragment union.

This is part of an effort to pack the average MCSymbol down to 24 bytes.

The HasName bit was pushing the size of the bitfield over to another word,
so this change uses a PointerIntPair to fit in it to unused bits of a
PointerUnion.

Reviewed by Rafael EspĂ­ndola

llvm-svn: 241115

9 years agoUse ErrorOr in getRelocationAdress.
Rafael Espindola [Tue, 30 Jun 2015 20:32:26 +0000 (20:32 +0000)]
Use ErrorOr in getRelocationAdress.

We can probably do better in this method, but this is an improvement and
enables further ErrorOr cleanups.

llvm-svn: 241114

9 years agoRevert part of r240623 (Enable memory sanitizer for PPC64) because the
Jay Foad [Tue, 30 Jun 2015 20:30:19 +0000 (20:30 +0000)]
Revert part of r240623 (Enable memory sanitizer for PPC64) because the
buildbots are still failing in check-ubsan.

llvm-svn: 241113

9 years agoImplement containsSymbol with other lower level methods.
Rafael Espindola [Tue, 30 Jun 2015 20:18:49 +0000 (20:18 +0000)]
Implement containsSymbol with other lower level methods.

llvm-svn: 241112

9 years agoMark N4508, LWG#2407, and LWG#2470 as complete. I don't see that 2470 requires any...
Marshall Clow [Tue, 30 Jun 2015 20:06:00 +0000 (20:06 +0000)]
Mark N4508, LWG#2407, and LWG#2470 as complete. I don't see that 2470 requires any changes to the library.

llvm-svn: 241111

9 years agoModified a comment about the reason for the patch (removed commented code).
Nemanja Ivanovic [Tue, 30 Jun 2015 20:01:16 +0000 (20:01 +0000)]
Modified a comment about the reason for the patch (removed commented code).

llvm-svn: 241110

9 years agoRemove Elf_Shdr_Iter. Diagnose files with invalid section header sizes.
Rafael Espindola [Tue, 30 Jun 2015 19:58:10 +0000 (19:58 +0000)]
Remove Elf_Shdr_Iter. Diagnose files with invalid section header sizes.

llvm-svn: 241109

9 years agoFixes a bug with __builtin_vsx_lxvdw4x on Little Endian systems
Nemanja Ivanovic [Tue, 30 Jun 2015 19:45:45 +0000 (19:45 +0000)]
Fixes a bug with __builtin_vsx_lxvdw4x on Little Endian systems

llvm-svn: 241108

9 years agoCOFF: Change the order of adding symbols to the symbol table.
Rui Ueyama [Tue, 30 Jun 2015 19:35:21 +0000 (19:35 +0000)]
COFF: Change the order of adding symbols to the symbol table.

Previously, the order of adding symbols to the symbol table was simple.
We have a list of all input files. We read each file from beginning of
the list and add all symbols in it to the symbol table.

This patch changes that order. Now all archive files are added to the
symbol table first, and then all the other object files are added.
This shouldn't change the behavior in single-threading, and make room
to parallelize in multi-threading.

In the first step, only lazy symbols are added to the symbol table
because archives contain only Lazy symbols. Member object files
found to be necessary are queued. In the second step, defined and
undefined symbols are added from object files. Adding an undefined
symbol to the symbol table may cause more member files to be added
to the queue. We simply continue reading all object files until the
queue is empty.

Finally, new archive or object files may be added to the queues by
object files' directive sections (which contain new command line
options).

The above process is repeated until we get no new files.

Symbols defined both in object files and in archives can make results
undeterministic. If an archive is read before an object, a new member
file gets linked, while in the other way, no new file would be added.
That is the most popular cause of an undeterministic result or linking
failure as I observed. Separating phases of adding lazy symbols and
undefined symbols makes that deterministic. Adding symbols in each
phase should be parallelizable.

llvm-svn: 241107

9 years agoMore range-based-for-loopification. NFC
Douglas Katzman [Tue, 30 Jun 2015 19:32:57 +0000 (19:32 +0000)]
More range-based-for-loopification. NFC

llvm-svn: 241106

9 years agoUse range loops. NFC.
Rafael Espindola [Tue, 30 Jun 2015 19:24:51 +0000 (19:24 +0000)]
Use range loops. NFC.

llvm-svn: 241105

9 years agoUse range loop.
Rafael Espindola [Tue, 30 Jun 2015 19:13:25 +0000 (19:13 +0000)]
Use range loop.

llvm-svn: 241104

9 years agoCOFF: Do not assign linker-weak symbols to selectany comdat sections.
Peter Collingbourne [Tue, 30 Jun 2015 19:10:31 +0000 (19:10 +0000)]
COFF: Do not assign linker-weak symbols to selectany comdat sections.

It is mandatory to specify a comdat in order to receive comdat semantics
for a symbol. We were previously getting this wrong in -function-sections
mode; linker-weak symbols were being emitted in a selectany comdat. This
change causes such symbols to use a noduplicates comdat instead, fixing
the inconsistency.

Also correct an inaccuracy in the docs.

Differential Revision: http://reviews.llvm.org/D10828

llvm-svn: 241103

9 years agoCodeGen: Assign an appropriate comdat to thunks.
Peter Collingbourne [Tue, 30 Jun 2015 19:07:26 +0000 (19:07 +0000)]
CodeGen: Assign an appropriate comdat to thunks.

Previously we were not assigning a comdat to thunks in the Microsoft ABI,
which would have required us to emit these functions outside of a comdat.
(Due to an inconsistency in how we were emitting objects, we were getting this
right most of the time, but only when compiling with function sections.) This
code generator change causes us to create a comdat for each thunk.

Differential Revision: http://reviews.llvm.org/D10829

llvm-svn: 241102

9 years ago[DebugInfo] Let IRBuilder::SetInsertPoint(BB::iterator) update current debug location.
Alexey Samsonov [Tue, 30 Jun 2015 19:07:20 +0000 (19:07 +0000)]
[DebugInfo] Let IRBuilder::SetInsertPoint(BB::iterator) update current debug location.

IRBuilder::SetInsertPoint(BB, BB::iterator) is an older version of
IRBuilder::SetInsertPoint(Instruction). However, the latter updates
the current debug location of emitted instruction, while the former
doesn't, which is confusing.

Unify the behavior of these methods: now they both set current debug
location to the debug location of instruction at insertion point.

The callers of IRBuilder::SetInsertPoint(BB, BB::iterator) doesn't
seem to depend on the old behavior (keeping the original debug info
location). On the contrary, sometimes they (e.g. SCEV) *should* be
updating debug info location, but don't. I'll look at gdb bots after
the commit to check that we don't regress on debug info somewhere.

This change may make line table more fine-grained, thus increasing
debug info size. I haven't observed significant increase, though:
it varies from negligible to 0.3% on several binaries and self-hosted
Clang.

This is yet another change targeted at resolving PR23837.

llvm-svn: 241101

9 years agoUse range loop.
Rafael Espindola [Tue, 30 Jun 2015 19:02:00 +0000 (19:02 +0000)]
Use range loop.

llvm-svn: 241100

9 years ago[NVPTX] Fix issue introduced in D10321
Jingyue Wu [Tue, 30 Jun 2015 18:59:19 +0000 (18:59 +0000)]
[NVPTX] Fix issue introduced in D10321

Summary:
Really check if %SP is not used in other places, instead of checking only exact
one non-dbg use.

Patched by Xuetian Weng.

Test Plan:
@foo4 in test/CodeGen/NVPTX/local-stack-frame.ll, create a case that
SP will appear twice.

Reviewers: jholewinski, jingyue

Reviewed By: jingyue

Subscribers: llvm-commits, sfantao, jholewinski

Differential Revision: http://reviews.llvm.org/D10844

llvm-svn: 241099

9 years agoUpdate testcases: DICompileUnits are now created distinct by DIBuilder.
Adrian Prantl [Tue, 30 Jun 2015 18:32:50 +0000 (18:32 +0000)]
Update testcases: DICompileUnits are now created distinct by DIBuilder.

llvm-svn: 241098

9 years agoFix a fixme and make DICompileUnit a distinct node. Tested via clang.
Adrian Prantl [Tue, 30 Jun 2015 18:32:18 +0000 (18:32 +0000)]
Fix a fixme and make DICompileUnit a distinct node. Tested via clang.

llvm-svn: 241097

9 years agoFix compilation failure introduced in r241093.
Alex Lorenz [Tue, 30 Jun 2015 18:32:02 +0000 (18:32 +0000)]
Fix compilation failure introduced in r241093.

llvm-svn: 241096

9 years agoK-ballo pointed out that I missed one of the specializations of packaged_task when...
Marshall Clow [Tue, 30 Jun 2015 18:28:35 +0000 (18:28 +0000)]
K-ballo pointed out that I missed one of the specializations of packaged_task when I committed r241068. Thanks for the catch.

llvm-svn: 241095

9 years agoAdd a test of an elf file with an invalid section index.
Rafael Espindola [Tue, 30 Jun 2015 18:23:07 +0000 (18:23 +0000)]
Add a test of an elf file with an invalid section index.

We were already checking, but were missing a test.

llvm-svn: 241094

9 years agoMIR Serialization: Serialize MBB successors.
Alex Lorenz [Tue, 30 Jun 2015 18:16:42 +0000 (18:16 +0000)]
MIR Serialization: Serialize MBB successors.

This commit implements serialization of the machine basic block successors. It
uses a YAML flow sequence that contains strings that have the MBB references.
The MBB references in those strings use the same syntax as the MBB machine
operands in the machine instruction strings.

Reviewers: Duncan P. N. Exon Smith

Differential Revision: http://reviews.llvm.org/D10699

llvm-svn: 241093

9 years agoForgot the support include file in r241091
Marshall Clow [Tue, 30 Jun 2015 18:16:12 +0000 (18:16 +0000)]
Forgot the support include file in r241091

llvm-svn: 241092

9 years agoAdd tests for LWG#2299. While doing so, I noticed that the tests we have for the...
Marshall Clow [Tue, 30 Jun 2015 18:15:41 +0000 (18:15 +0000)]
Add tests for LWG#2299. While doing so, I noticed that the tests we have for the transparent comparators don't actually call them. Fix those tests, too. Now one of them is failing, due to a missing const in <map>. Add that (twice). Next step is to do the same for <unordered_map>

llvm-svn: 241091

9 years agoRelax this test so it also works on platforms that use characters other
Adrian Prantl [Tue, 30 Jun 2015 18:05:46 +0000 (18:05 +0000)]
Relax this test so it also works on platforms that use characters other
than forward slashes as path separators.

llvm-svn: 241090

9 years agoUse copy init instead of direct init.
Rafael Espindola [Tue, 30 Jun 2015 18:04:46 +0000 (18:04 +0000)]
Use copy init instead of direct init.

llvm-svn: 241089

9 years agoUse an early exit to improve readability. (NFC)
Adrian Prantl [Tue, 30 Jun 2015 18:01:05 +0000 (18:01 +0000)]
Use an early exit to improve readability. (NFC)

llvm-svn: 241088

9 years agoMIR Printer: extract the code that prints MBB references into a new method. NFC.
Alex Lorenz [Tue, 30 Jun 2015 18:00:16 +0000 (18:00 +0000)]
MIR Printer: extract the code that prints MBB references into a new method. NFC.

This commit enables the MIR printer to reuse the code that prints MBB
references.

llvm-svn: 241087

9 years agoMIR Parser: refactor error reporting for machine instruction parser errors. NFC.
Alex Lorenz [Tue, 30 Jun 2015 17:55:00 +0000 (17:55 +0000)]
MIR Parser: refactor error reporting for machine instruction parser errors. NFC.

This commit extracts the code that reports an error that's produced by the
machine instruction parser into a new method that can be reused in other places.

llvm-svn: 241086

9 years agoMIR Parser: make the machine instruction parsing interface more consistent. NFC.
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

9 years agoDebug Info: Emit debug info for @import declarations.
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

9 years agoAdd a function to ExternalASTSource that returns a descriptor that
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

9 years agotsan: fix handling of condition variable destruction
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

9 years agoForce relocation mode to be default, regardless of what is passed to the backend.
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

9 years ago[CMake] Make the CMake files (LLVMConfig.cmake and LLVMExports.cmake)
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

9 years ago[NativeProcessLinux] Refactor PtraceWrapper
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

9 years agoMIR Parser: adopt the 'maybeLex...' pattern. NFC.
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

9 years ago[clang-cl] Use /arch: to set the base target CPU
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

9 years agouse range-based for loops; NFCI
Sanjay Patel [Tue, 30 Jun 2015 16:30:22 +0000 (16:30 +0000)]
use range-based for loops; NFCI

llvm-svn: 241076

9 years agoUpdate for llvm change.
Rafael Espindola [Tue, 30 Jun 2015 15:34:00 +0000 (15:34 +0000)]
Update for llvm change.

llvm-svn: 241075

9 years agoFix the name of the iterator functions to match the coding standards.
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

9 years ago[Static Analyzer] Minor improvements to SATest.
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

9 years ago[ASan] Add a regression test for r240960 (https://crbug.com/502974)
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

9 years agoFix windows build.
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

9 years agoReport an error on invalid sh_entsize.
Rafael Espindola [Tue, 30 Jun 2015 14:59:20 +0000 (14:59 +0000)]
Report an error on invalid sh_entsize.

llvm-svn: 241070

9 years ago[X86] Fix a bug in WIN_FTOL_32/64 handling.
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

9 years agoImplement LWG#2407: 'packaged_task(allocator_arg_t, const Allocator&, F&&) should...
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

9 years agoImplement N4508: shared_mutex. Reviewed as http://reviews.llvm.org/D10480
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

9 years ago[mips] [IAS] Add support for the .module softfloat/hardfloat directives.
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

9 years ago[X86] Rename DEFAULT_FN_ATTR macro to __DEFAULT_FN_ATTR
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

9 years agoMark LWG#2266 as complete. This is a tightening up the wording; no code changes required.
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

9 years agoChange search order of target definition files.
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

9 years ago[mips] [IAS] Make .module directives change AssemblerOptions->front().
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

9 years agoReverting r241058 because it's causing buildbot failures.
Ranjeet Singh [Tue, 30 Jun 2015 12:32:53 +0000 (12:32 +0000)]
Reverting r241058 because it's causing buildbot failures.

llvm-svn: 241061

9 years ago[CONCEPTS] Parsing of concept keyword
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

9 years agoclang-format: Properly parse parenthesis in braced lists.
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

9 years agoThere are a few places where subtarget features are still
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

9 years agoFix [vdso] handling on Android (x86 and aarch64)
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

9 years agoAdd a missing header
Pavel Labath [Tue, 30 Jun 2015 10:20:52 +0000 (10:20 +0000)]
Add a missing header

llvm-svn: 241056

9 years ago[X86] Add missing undef of DEFAULT_FN_ATTRS in FXSR intrinsics
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

9 years agoCorrect a typo for a LoopVectorize test
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

9 years ago[X86] Add FXSR intrinsics
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

9 years ago[mips] [IAS] Add support for the .set oddspreg/nooddspreg directives.
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

9 years agoIgnore "push/pop {sp}" in emulation based unwinding
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

9 years agoFix LLDB build after r241035
Tamas Berghammer [Tue, 30 Jun 2015 09:26:52 +0000 (09:26 +0000)]
Fix LLDB build after r241035

llvm-svn: 241050

9 years ago[X86] Add FXSR intrinsics
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

9 years agoUpdate isl to isl-0.15-30-g3518765
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

9 years agoFix a couple of tests in clang/test to match "x86_thiscallcc" introduced in r240971.
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

9 years agoUnbreak the Visual C++ 2013 build after r241032.
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

9 years ago[LLDB][MIPS] Getting correct flags for MIPS
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

9 years agoELF.h: Prune obsolete comments removed in r240996. [-Wdocumentation]
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

9 years ago[CodeGen] Tweak isTriviallyRecursive further
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

9 years agoDon't return error_code from a function that doesn't fail.
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

9 years agoDrop the OS from the WebAssembly target triple for now.
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

9 years agoMove function to the only file that uses it.
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

9 years agoDon't return error_code from a function that doesn't fail.
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

9 years ago[MS ABI] Workaround corner-case bug in the ABI for operator delete
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

9 years agoSphinx-based clang man pages
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

9 years agoAdd two missing arguments.
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

9 years agoPass HeaderSearchOptions and PreprocessorOptions into CodeGenModule.
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

9 years agoDebug info: Add dwarf backend support for DIModule.
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

9 years agoDon't return error_code from a function that doesn't fail.
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

9 years agoRework parsing of pure-specifiers. Perform the grammar matching and
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

9 years agoAdd layout/triple to fix test on platforms where names are mangled.
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

9 years agoFix LastArchType to point to the new last arch.
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

9 years agoCOFF: Implement SymbolBody::getDebugName() for DefinedBitcode symbols.
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

9 years agoCleanup getRelocationAddend.
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

9 years agoRegisterCoalescer: Cleanup empty subranges after shrinkToUses()
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