platform/upstream/llvm.git
10 years agoAArch64: Follow-up to r212073
Duncan P. N. Exon Smith [Tue, 1 Jul 2014 00:05:37 +0000 (00:05 +0000)]
AArch64: Follow-up to r212073

In r212073 I missed a call of `use_begin()` that assumed the wrong
semantics.  It's not clear to me at all what this code does without the
fix, so I'm not sure how to write a testcase.

llvm-svn: 212075

10 years agoFixup Windows build breaks for the llgs upstream.
Todd Fiala [Mon, 30 Jun 2014 23:51:35 +0000 (23:51 +0000)]
Fixup Windows build breaks for the llgs upstream.

Also moves NativeRegisterContextLinux* files into the Linux directory.
These, like NativeProcessLinux, should only be built on Linux or a cross
compiler with proper headers.

llvm-svn: 212074

10 years agoAArch64: Actually do address type promotion
Duncan P. N. Exon Smith [Mon, 30 Jun 2014 23:42:14 +0000 (23:42 +0000)]
AArch64: Actually do address type promotion

AArch64AddressTypePromotion was doing nothing because it was using the
old semantics of `Use` and `uses()`, when it really wanted to get at the
`users()`.

llvm-svn: 212073

10 years ago[mach-o] improve errors when mixing architectures
Nick Kledzik [Mon, 30 Jun 2014 22:57:33 +0000 (22:57 +0000)]
[mach-o] improve errors when mixing architectures

llvm-svn: 212072

10 years agoFix apparent thinko in r209744: allocator stats can be zero
Alexey Samsonov [Mon, 30 Jun 2014 22:40:58 +0000 (22:40 +0000)]
Fix apparent thinko in r209744: allocator stats can be zero

llvm-svn: 212071

10 years agoFix libc++ bug #20039: 'Constructing std::function from empty compatible std::functio...
Marshall Clow [Mon, 30 Jun 2014 21:27:51 +0000 (21:27 +0000)]
Fix libc++ bug #20039: 'Constructing std::function from empty compatible std::function results in half-empty state' Thanks to Agustin Berge for the report, and for his and Eric Fiselier's work on a fix.

llvm-svn: 212070

10 years agoAdd lldb-gdbserver support for Linux x86_64.
Todd Fiala [Mon, 30 Jun 2014 21:05:18 +0000 (21:05 +0000)]
Add lldb-gdbserver support for Linux x86_64.

This change brings in lldb-gdbserver (llgs) specifically for Linux x86_64.
(More architectures coming soon).

Not every debugserver option is covered yet.  Currently
the lldb-gdbserver command line can start unattached,
start attached to a pid (process-name attach not supported yet),
or accept lldb attaching and launching a process or connecting
by process id.

The history of this large change can be found here:
https://github.com/tfiala/lldb/tree/dev-tfiala-native-protocol-linux-x86_64

Until mid/late April, I was not sharing the work and continued
to rebase it off of head (developed via id tfiala@google.com).  I switched over to
user todd.fiala@gmail.com in the middle, and once I went to github, I did
merges rather than rebasing so I could share with others.

llvm-svn: 212069

10 years ago[mach-o] x86_64 relocation code review fixes
Nick Kledzik [Mon, 30 Jun 2014 20:44:47 +0000 (20:44 +0000)]
[mach-o] x86_64 relocation code review fixes

llvm-svn: 212068

10 years agoConvert some byval argpromotion grep tests to FileCheck
Reid Kleckner [Mon, 30 Jun 2014 20:44:28 +0000 (20:44 +0000)]
Convert some byval argpromotion grep tests to FileCheck

Surprisingly, the i32* byval parameter is not transformed by
argpromotion.

llvm-svn: 212067

10 years agoDo not define __STRICT_ANSI__ in clang-cl
Ehsan Akhgari [Mon, 30 Jun 2014 20:36:33 +0000 (20:36 +0000)]
Do not define __STRICT_ANSI__ in clang-cl

llvm-svn: 212066

10 years agoDebugInfo: Preserve debug location information when transforming a call into an invok...
David Blaikie [Mon, 30 Jun 2014 20:30:39 +0000 (20:30 +0000)]
DebugInfo: Preserve debug location information when transforming a call into an invoke during inlining.

This both improves basic debug info quality, but also fixes a larger
hole whenever we inline a call/invoke without a location (debug info for
the entire inlining is lost and other badness that the debug info
emission code is currently working around but shouldn't have to).

llvm-svn: 212065

10 years ago[UBSan] Don't link UBSan runtime into shared libraries.
Alexey Samsonov [Mon, 30 Jun 2014 20:27:16 +0000 (20:27 +0000)]
[UBSan] Don't link UBSan runtime into shared libraries.

It used to be a feature of UBSan (it could sanitize a standalone
shared object instead of the whole program), but now it causes
more problems, like PR20165.

llvm-svn: 212064

10 years agoRemove unnecessary datalayout string from a test case.
David Blaikie [Mon, 30 Jun 2014 20:26:12 +0000 (20:26 +0000)]
Remove unnecessary datalayout string from a test case.

llvm-svn: 212063

10 years agoSpeculatively fix some code handling Power64 MachO files
Reid Kleckner [Mon, 30 Jun 2014 20:12:59 +0000 (20:12 +0000)]
Speculatively fix some code handling Power64 MachO files

MSVC was warning on a switch containing only default labels.  In this
instance, it looks like it uncovered a real bug.  :)

llvm-svn: 212062

10 years agomsan: Stop stripping the 'tail' modifier off of calls
Reid Kleckner [Mon, 30 Jun 2014 20:12:27 +0000 (20:12 +0000)]
msan: Stop stripping the 'tail' modifier off of calls

This probably isn't necessary since msan started to unpoison the return
value shadow memory before all calls.

llvm-svn: 212061

10 years agoConsider module depedencies when checking a preamble in libclang
Ben Langmuir [Mon, 30 Jun 2014 20:04:14 +0000 (20:04 +0000)]
Consider module depedencies when checking a preamble in libclang

Add module dependencies (header files, module map files) to the list of
files to check when deciding whether to rebuild a preamble. That fixes
using preambles with module imports so long as they are in
non-overridden files.

My intent is to use to unify the existing dependency collectors to the
new “DependencyCollectory” interface from this commit, starting with the
DependencyFileGenerator.

llvm-svn: 212060

10 years agoobjdump: Add test for ELF file with no section table
Ed Maste [Mon, 30 Jun 2014 20:03:02 +0000 (20:03 +0000)]
objdump: Add test for ELF file with no section table

This is a test for the fix in r211904.

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

llvm-svn: 212059

10 years agoUse the newly added FindInEnvPath helper in clang
Ehsan Akhgari [Mon, 30 Jun 2014 19:56:37 +0000 (19:56 +0000)]
Use the newly added FindInEnvPath helper in clang

llvm-svn: 212058

10 years agoRefactor the code in clang to find a file in a PATH like environment variable into...
Ehsan Akhgari [Mon, 30 Jun 2014 19:54:20 +0000 (19:54 +0000)]
Refactor the code in clang to find a file in a PATH like environment variable into a helper function

llvm-svn: 212057

10 years agoFix 'platform-specific' hyphenations
Alp Toker [Mon, 30 Jun 2014 18:57:16 +0000 (18:57 +0000)]
Fix 'platform-specific' hyphenations

llvm-svn: 212056

10 years agoBuild fix for systems without futimes/futimens
Alp Toker [Mon, 30 Jun 2014 18:57:04 +0000 (18:57 +0000)]
Build fix for systems without futimes/futimens

Some versions of Android don't have futimes/futimens and this code wasn't
updated during the recent errc refactoring.

Patch by Luqman Aden!

llvm-svn: 212055

10 years agoAdd the -arch flag support to llvm-nm to select the slice out of a Mach-O
Kevin Enderby [Mon, 30 Jun 2014 18:45:23 +0000 (18:45 +0000)]
Add the -arch flag support to llvm-nm to select the slice out of a Mach-O
universal file.  This also includes support for -arch all, selecting the host
architecture by default from a universal file and checking if -arch is used
with a standard Mach-O it matches that architecture.

llvm-svn: 212054

10 years ago[x86] Add Clang support for intrinsic __rdpmc.
Andrea Di Biagio [Mon, 30 Jun 2014 18:23:58 +0000 (18:23 +0000)]
[x86] Add Clang support for intrinsic __rdpmc.

This patch adds intrinsic __rdpmc to header file 'ia32intrin.h'.
Intrinsic __rdmpc can be used to read performance monitoring counters. It is
implemented as a direct call to __builtin_ia32_rdpmc.

It takes as input a value representing the index of the performance counter to
read. The value of the performance counter is then returned as a unsigned
64-bit quantity.

llvm-svn: 212053

10 years agoR600: Move mul combine to separate function
Matt Arsenault [Mon, 30 Jun 2014 17:55:48 +0000 (17:55 +0000)]
R600: Move mul combine to separate function

llvm-svn: 212052

10 years agoR600: Remove unused declarations leftover from AMDIL
Matt Arsenault [Mon, 30 Jun 2014 17:37:17 +0000 (17:37 +0000)]
R600: Remove unused declarations leftover from AMDIL

llvm-svn: 212051

10 years agoDebug info: split out complex DIVariable address expressions into a
Adrian Prantl [Mon, 30 Jun 2014 17:17:35 +0000 (17:17 +0000)]
Debug info: split out complex DIVariable address expressions into a
separate MDNode so they can be uniqued via folding set magic. To conserve
space, DIVariable nodes are still variable-length, with the last two
fields being optional.

No functional change.
http://reviews.llvm.org/D3526

llvm-svn: 212050

10 years ago[X86] Add support for builtin to read performance monitoring counters.
Andrea Di Biagio [Mon, 30 Jun 2014 17:14:21 +0000 (17:14 +0000)]
[X86] Add support for builtin to read performance monitoring counters.

This patch adds support for a new builtin instruction called
__builtin_ia32_rdpmc.

Builtin '__builtin_ia32_rdpmc' is defined as a 'GCC builtin'; on X86, it can
be used to read performance monitoring counters. It takes as input the index
of the performance counter to read, and returns the value of the specified
performance counter as a 64-bit number.

Calls to this new builtin will map to instruction RDPMC.
The index in input to the builtin call is moved to register %ECX. The result
of the builtin call is the value of the specified performance counter (RDPMC
would return that quantity in registers RDX:RAX).

This patch:
 - Adds builtin int_x86_rdpmc as a GCCBuiltin;
 - Adds a new x86 DAG node called 'RDPMC_DAG';
 - Teaches how to lower this new builtin;
 - Adds an ISel pattern to select instruction RDPMC;
 - Fixes the definition of instruction RDPMC adding %RAX and %RDX as
   implicit definitions, and adding %ECX as implicit use;
 - Adds a LLVM test to verify that the new builtin is correctly selected.

llvm-svn: 212049

10 years ago[OCaml] Documentation improvements.
Peter Zotov [Mon, 30 Jun 2014 16:53:53 +0000 (16:53 +0000)]
[OCaml] Documentation improvements.

llvm-svn: 212048

10 years agoRemoved unused typedef for recursive_directory_iterator
Ben Langmuir [Mon, 30 Jun 2014 16:10:15 +0000 (16:10 +0000)]
Removed unused typedef for recursive_directory_iterator

llvm-svn: 212047

10 years agoFix a typo in the noexcept calculation for __compressed_pair::swap. Thanks to EricWF...
Marshall Clow [Mon, 30 Jun 2014 15:35:09 +0000 (15:35 +0000)]
Fix a typo in the noexcept calculation for __compressed_pair::swap. Thanks to EricWF for the bug report and the fix.

llvm-svn: 212046

10 years ago[AArch64] Unsized types don't specify an alignment.
Chad Rosier [Mon, 30 Jun 2014 15:03:00 +0000 (15:03 +0000)]
[AArch64] Unsized types don't specify an alignment.
PR20109

llvm-svn: 212045

10 years ago[AArch64] Convert mul x, -(pow2 +/- 1) to shift + add/sub.
Chad Rosier [Mon, 30 Jun 2014 14:51:14 +0000 (14:51 +0000)]
[AArch64] Convert mul x, -(pow2 +/- 1) to shift + add/sub.

The combine for mul x, pow2 +/- 1 is unchanged. Test cases for
both combines as well as mul x, pow2 have been added as well.

llvm-svn: 212044

10 years agomacho-dump: add code to print LC_ID_DYLIB load commands.
Tim Northover [Mon, 30 Jun 2014 14:40:57 +0000 (14:40 +0000)]
macho-dump: add code to print LC_ID_DYLIB load commands.

I want to check them in lld.

llvm-svn: 212043

10 years agoInitialize ClangTidyMessage::FileOffset field to avoid unitialized variable access...
Alexander Kornienko [Mon, 30 Jun 2014 14:29:03 +0000 (14:29 +0000)]
Initialize ClangTidyMessage::FileOffset field to avoid unitialized variable access when sorting errors on output.

llvm-svn: 212042

10 years agoclang-format: Support member function reference qualifiers.
Daniel Jasper [Mon, 30 Jun 2014 13:54:27 +0000 (13:54 +0000)]
clang-format: Support member function reference qualifiers.

Before:
  string // break
      operator()() &
  {}

After:
  string // break
  operator()() & {}

llvm-svn: 212041

10 years agoclang-format: Improve expression heuristics.
Daniel Jasper [Mon, 30 Jun 2014 13:44:47 +0000 (13:44 +0000)]
clang-format: Improve expression heuristics.

Upon encountering a binary operator inside parentheses, assume that the
parentheses contain an expression.

Before:
  MACRO('0' <= c&& c <= '9');

After:
  MACRO('0' <= c && c <= '9');

llvm-svn: 212040

10 years agoFixing a few typos in the documentation.
Aaron Ballman [Mon, 30 Jun 2014 13:43:04 +0000 (13:43 +0000)]
Fixing a few typos in the documentation.

llvm-svn: 212039

10 years agoclang-format: [JS] support free-standing functions again.
Daniel Jasper [Mon, 30 Jun 2014 13:24:54 +0000 (13:24 +0000)]
clang-format: [JS] support free-standing functions again.

This worked initially but was broken by r210887.

Before:
  function outer1(a, b) {
    function inner1(a, b) { return a; } inner1(a, b);
  } function outer2(a, b) { function inner2(a, b) { return a; } inner2(a, b); }

After:
  function outer1(a, b) {
    function inner1(a, b) { return a; }
    inner1(a, b);
  }
  function outer2(a, b) {
    function inner2(a, b) { return a; }
    inner2(a, b);
  }

Thanks to Adam Strzelecki for working on this.

llvm-svn: 212038

10 years agoRevert the LSDA change to scan_eh_tab.
Logan Chien [Mon, 30 Jun 2014 12:35:29 +0000 (12:35 +0000)]
Revert the LSDA change to scan_eh_tab.

This commit reverts the LSDA-related change in r211745.

The r211745 adds a new argument to scan_eh_tab(), i.e. lsda.
However, IMO, calling _Unwind_GetLanguageSpecificData() directly in
scan_eh_tab() was more intuitive and reduces several function call
to _Unwind_GetLanguageSpecificData() in __cxx_personality_v0().

llvm-svn: 212037

10 years ago[msan] Limit stack origin chain length.
Evgeniy Stepanov [Mon, 30 Jun 2014 11:22:42 +0000 (11:22 +0000)]
[msan] Limit stack origin chain length.

Stack origins were created with unlimited length by mistake.

llvm-svn: 212036

10 years agoMachO: stop iterating past the end of an array
Tim Northover [Mon, 30 Jun 2014 10:30:00 +0000 (10:30 +0000)]
MachO: stop iterating past the end of an array

When trying to map atom types to sections, we were iterating through an array
until we hit a sentinel value. There's no need for such dances when range-based
for loops are available.

llvm-svn: 212035

10 years ago[OPENMP] Added table with allowed nesting info for OpenMP regions (per request from...
Alexey Bataev [Mon, 30 Jun 2014 10:22:46 +0000 (10:22 +0000)]
[OPENMP] Added table with allowed nesting info for OpenMP regions (per request from Samuel F Antao).

llvm-svn: 212034

10 years agoAdded a comment to document relation of this check to -Wold-style-cast.
Alexander Kornienko [Mon, 30 Jun 2014 09:54:12 +0000 (09:54 +0000)]
Added a comment to document relation of this check to -Wold-style-cast.

llvm-svn: 212033

10 years agoMachO: re-enable writing of compact-unwind sections.
Tim Northover [Mon, 30 Jun 2014 09:49:37 +0000 (09:49 +0000)]
MachO: re-enable writing of compact-unwind sections.

This isn't really the right place to put them in final object files (that would
be __TEXT,__unwind_info), but the format is different between relocatable and
final objects, which means we really need a pass to handle the translation.

For now, re-emitting in __LD,__compact_unwind is harmless (dyld ignores it and
moves straight on to inspecting __TEXT,__eh_frame), and sidesteps an assertion
failure when processing files containing compact-unwind info.

llvm-svn: 212032

10 years agoMachO: align segment virtual addresses to page size.
Tim Northover [Mon, 30 Jun 2014 09:49:33 +0000 (09:49 +0000)]
MachO: align segment virtual addresses to page size.

Segments must occupy a multiple of the page size in memory (4096 currently). We
check for this when emitting files, but the placement algorithm broke down for
the second non-__TEXT segment encountered: the offset wasn't aligned up to 4096
before starting its layout.

llvm-svn: 212031

10 years agoMachO: calculate segment offsets in final MachO files properly.
Tim Northover [Mon, 30 Jun 2014 09:49:30 +0000 (09:49 +0000)]
MachO: calculate segment offsets in final MachO files properly.

Because of how we were calculating fileOffset and fileSize for segments, most
ended up at a single offset in a finalised MachO file. This meant the data
often didn't even get written in the final object, let alone where it would be
useful.

llvm-svn: 212030

10 years agoARM: take care not to set the ThumbFunc bit on TLS data symbols
Scott Douglass [Mon, 30 Jun 2014 09:37:24 +0000 (09:37 +0000)]
ARM: take care not to set the ThumbFunc bit on TLS data symbols

This fixes LNT SingleSource/UnitTests/Threads with -mthumb.

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

llvm-svn: 212029

10 years agoSecond part of fix in CodeGen/captured-statements-nested.c
Alexey Bataev [Mon, 30 Jun 2014 09:14:10 +0000 (09:14 +0000)]
Second part of fix in CodeGen/captured-statements-nested.c

llvm-svn: 212028

10 years agoMachO: support atomization of dylibs.
Tim Northover [Mon, 30 Jun 2014 09:11:38 +0000 (09:11 +0000)]
MachO: support atomization of dylibs.

For .dylib files, we refrain from actually creating any atoms until they're
requested via the "exports" method.

llvm-svn: 212027

10 years agoTest fix
Alexey Bataev [Mon, 30 Jun 2014 09:05:08 +0000 (09:05 +0000)]
Test fix

llvm-svn: 212026

10 years agoFixed incompatibility in CodeGen/captured-statements-nested.c with MSVC
Alexey Bataev [Mon, 30 Jun 2014 08:37:48 +0000 (08:37 +0000)]
Fixed incompatibility in CodeGen/captured-statements-nested.c with MSVC

llvm-svn: 212025

10 years agoFixed CodeGen/captured-statements-nested.c test
Alexey Bataev [Mon, 30 Jun 2014 08:17:11 +0000 (08:17 +0000)]
Fixed CodeGen/captured-statements-nested.c test

llvm-svn: 212024

10 years ago[Driver][Mips] Fix test cases - make ABI name and target triple consistent.
Simon Atanasyan [Mon, 30 Jun 2014 08:10:01 +0000 (08:10 +0000)]
[Driver][Mips] Fix test cases - make ABI name and target triple consistent.

No functional changes.

llvm-svn: 212023

10 years ago[Driver][Mips] Check rejecting of invalid MIPS ABI names in the test.
Simon Atanasyan [Mon, 30 Jun 2014 08:09:54 +0000 (08:09 +0000)]
[Driver][Mips] Check rejecting of invalid MIPS ABI names in the test.

No functional changes.

llvm-svn: 212022

10 years agoundo test commit (whitespace only)
Scott Douglass [Mon, 30 Jun 2014 08:09:35 +0000 (08:09 +0000)]
undo test commit (whitespace only)

llvm-svn: 212021

10 years agotest commit (whitespace only)
Scott Douglass [Mon, 30 Jun 2014 08:07:32 +0000 (08:07 +0000)]
test commit (whitespace only)

llvm-svn: 212020

10 years agotest commit: add a comment line in GVN test file
Erik Eckstein [Mon, 30 Jun 2014 07:19:02 +0000 (07:19 +0000)]
test commit: add a comment line in GVN test file

llvm-svn: 212019

10 years agoDisable CodeGen/captured-statements-nested.c
Alexey Bataev [Mon, 30 Jun 2014 05:07:42 +0000 (05:07 +0000)]
Disable CodeGen/captured-statements-nested.c

llvm-svn: 212018

10 years agoAdd checking for the complexity guarantees in the standard
Marshall Clow [Mon, 30 Jun 2014 05:04:20 +0000 (05:04 +0000)]
Add checking for the complexity guarantees in the standard

llvm-svn: 212017

10 years agoFixed CodeGen/captured-statements-nested.c test
Alexey Bataev [Mon, 30 Jun 2014 05:02:50 +0000 (05:02 +0000)]
Fixed CodeGen/captured-statements-nested.c test

llvm-svn: 212016

10 years agoFactored out Linux proc file reading into separate class.
Todd Fiala [Mon, 30 Jun 2014 04:14:13 +0000 (04:14 +0000)]
Factored out Linux proc file reading into separate class.

Both NativeProcessLinux (in llgs branch) and Linux Host.cpp had similar code to handle /proc
file reading.  I factored that out into a new Linux-specific ProcFileReader class and added a method
that the llgs branch will use for line-by-line parsing.

This change also adds numerous Linux-specific files to Xcode that were missing from the Xcode
project files.

Related to https://github.com/tfiala/lldb/issues/27

llvm-svn: 212015

10 years agoDisable CodeGen/captured-statements-nested.c
Alexey Bataev [Mon, 30 Jun 2014 03:30:41 +0000 (03:30 +0000)]
Disable CodeGen/captured-statements-nested.c

llvm-svn: 212014

10 years agoTemp XFAIL CodeGen/captured-statements-nested.c to fix the test
Alexey Bataev [Mon, 30 Jun 2014 03:14:43 +0000 (03:14 +0000)]
Temp XFAIL CodeGen/captured-statements-nested.c to fix the test

llvm-svn: 212013

10 years agoX86: fix comment
Saleem Abdulrasool [Mon, 30 Jun 2014 03:11:18 +0000 (03:11 +0000)]
X86: fix comment

Fix a comment typo `DbgLocLImport` instead of `DLLImport`.

llvm-svn: 212012

10 years agoARM: use symbolic name for constant
Saleem Abdulrasool [Mon, 30 Jun 2014 03:11:14 +0000 (03:11 +0000)]
ARM: use symbolic name for constant

This just changes the constant value to the symbolic name corresponding to it.
NFC.

llvm-svn: 212011

10 years agoUsing of variable length arrays in captured statements and OpenMP constructs.
Alexey Bataev [Mon, 30 Jun 2014 02:55:54 +0000 (02:55 +0000)]
Using of variable length arrays in captured statements and OpenMP constructs.
Differential Revision: http://reviews.llvm.org/D4067

llvm-svn: 212010

10 years agotest: move test from CodeGen to Sema
Saleem Abdulrasool [Mon, 30 Jun 2014 02:14:37 +0000 (02:14 +0000)]
test: move test from CodeGen to Sema

Move test from CodeGen to Sema to more accurately reflect what is being tested
as pointed out by Alp.

llvm-svn: 212009

10 years agoRemove some incorrect test suppressions
Alp Toker [Mon, 30 Jun 2014 01:34:09 +0000 (01:34 +0000)]
Remove some incorrect test suppressions

These don't actually require any registered backend to run.

This commit tests the water with a handful of fixes for what is a more
widespread problem.

llvm-svn: 212008

10 years agoCodeGenAction::ExecuteAction(): check for invalid LLVM source locations
Alp Toker [Mon, 30 Jun 2014 01:33:59 +0000 (01:33 +0000)]
CodeGenAction::ExecuteAction(): check for invalid LLVM source locations

Add sign checks to deal with the fact that IR parser line/column pairs are
signed integers and sometimes invalid.

The crash path is potentially triggered by corrupt '.bc' files in practice,
though I don't have a binary input test case that can be checked-in right now.

(Unfortunately the backend itself crashes on various ill-formed '.bc' inputs so
this bandage isn't as helpful as it appears yet.)

llvm-svn: 212007

10 years agoExtract an isReservedName() function
Alp Toker [Mon, 30 Jun 2014 01:33:53 +0000 (01:33 +0000)]
Extract an isReservedName() function

We'll want to share the implementation if anything else decides to check
for reserved names in future, so make this little snippet of code more
discoverable.

Also remove the __va_list_tag and __builtin_va_list special-case
checks. They're leftovers from before when the reserved name logic was
added.

No change in functionality.

llvm-svn: 212006

10 years agoPull ProcessInfo and ProcessLaunchInfo out of Target/Process.
Todd Fiala [Mon, 30 Jun 2014 00:30:53 +0000 (00:30 +0000)]
Pull ProcessInfo and ProcessLaunchInfo out of Target/Process.

Elevate ProcessInfo and ProcessLaunchInfo into their own headers.
llgs will be using ProcessLaunchInfo but doesn't need to pull in
the rest of Process.h.

This also moves a bunch of implementation details from the header
declarations into ProcessInfo.cpp and ProcessLaunchInfo.cpp.

Tested on Ubuntu 14.04 Cmake and MacOSX Xcode.

Related to https://github.com/tfiala/lldb/issues/26.

llvm-svn: 212005

10 years agoBasic: correct the va_list type on Windows on ARM
Saleem Abdulrasool [Sun, 29 Jun 2014 23:05:41 +0000 (23:05 +0000)]
Basic: correct the va_list type on Windows on ARM

Windows on ARM defines va_list as a typedef for char *.  Although the semantics
of argument passing for variadic functions matches AAPCS VFP, the wrapped
struct __va_list type is unused.  This makes the intrinsic definition for
va_list match that of Visual Studio.

llvm-svn: 212004

10 years agoFix a stray semi-colon. (Found by a pedantic warning)
Chandler Carruth [Sun, 29 Jun 2014 22:42:51 +0000 (22:42 +0000)]
Fix a stray semi-colon. (Found by a pedantic warning)

llvm-svn: 212003

10 years agoAnother attempt to add a clang-tidy check for flagging C-style casts.
Alexander Kornienko [Sun, 29 Jun 2014 22:19:53 +0000 (22:19 +0000)]
Another attempt to add a clang-tidy check for flagging C-style casts.

Summary:
The first version failed the SubstNonTypeTempateParmExpr-related test
on some buildbots. This one uses the new substNonTypeTempateParmExpr matcher to
filter out implicit C-style casts.

This patch depends on D4327.

Reviewers: djasper

Reviewed By: djasper

Subscribers: aemerson, cfe-commits

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

llvm-svn: 212002

10 years agoAdd a matcher for SubstNonTypeTemplateParmExpr.
Alexander Kornienko [Sun, 29 Jun 2014 22:18:53 +0000 (22:18 +0000)]
Add a matcher for SubstNonTypeTemplateParmExpr.

Reviewers: klimek, djasper

Reviewed By: djasper

Subscribers: klimek, aemerson, cfe-commits

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

llvm-svn: 212001

10 years agoCodeGen: rename Win64 ExceptionHandling to WinEH
Saleem Abdulrasool [Sun, 29 Jun 2014 21:43:47 +0000 (21:43 +0000)]
CodeGen: rename Win64 ExceptionHandling to WinEH

This exception format is not specific to Windows x64.  A similar approach is
taken on nearly all architectures.  Generalise the name to reflect reality.
This will eventually be used for Windows on ARM data emission as well.

Switch the enum and namespace into an enum class.

llvm-svn: 212000

10 years ago[Mips] Fix MIPS ABI name in the test. The name "64" is accepted by both gcc
Simon Atanasyan [Sun, 29 Jun 2014 16:51:16 +0000 (16:51 +0000)]
[Mips] Fix MIPS ABI name in the test. The name "64" is accepted by both gcc
and Clang drivers but internally LLVM/Clang use the name "n64".

llvm-svn: 211999

10 years agoRevert r211866, r211895 and r211995, "Driver: use GNU::Link for the Generic_GCC toolc...
NAKAMURA Takumi [Sun, 29 Jun 2014 16:00:11 +0000 (16:00 +0000)]
Revert r211866, r211895 and r211995, "Driver: use GNU::Link for the Generic_GCC toolchain". It broke users of Generic_GCC, cygwin and mingw32.

It reverts commits as follows:
  r211866: "Driver: use GNU::Link for the Generic_GCC toolchain"
  r211895: "Replace GetProgramPath("ld") with GetLinkerPath()."
  r211995: "Driver: add a cygwin linker tool"

llvm-svn: 211998

10 years agoLibclangTest.cpp: s/uint/unsigned/. I think 'uint' is not a standard type.
NAKAMURA Takumi [Sun, 29 Jun 2014 11:07:48 +0000 (11:07 +0000)]
LibclangTest.cpp: s/uint/unsigned/. I think 'uint' is not a standard type.

llvm-svn: 211997

10 years agoclang/test/CodeGenCXX/windows-itanium-exceptions.cpp: Add REQUIRES:asserts for now.
NAKAMURA Takumi [Sun, 29 Jun 2014 11:03:28 +0000 (11:03 +0000)]
clang/test/CodeGenCXX/windows-itanium-exceptions.cpp: Add REQUIRES:asserts for now.

llvm-svn: 211996

10 years agoDriver: add a cygwin linker tool
Saleem Abdulrasool [Sun, 29 Jun 2014 06:11:14 +0000 (06:11 +0000)]
Driver: add a cygwin linker tool

This adds a linker tool for the Windows cygwin environment.  This linker
invocation is significantly different from the generic ld invocation.  It
requires additional parameters as well as does not accept some normal
parameters.  This should fix self-hosting on Cygwin.

llvm-svn: 211995

10 years agoMC: rename EmitWin64EH routines
Saleem Abdulrasool [Sun, 29 Jun 2014 01:52:01 +0000 (01:52 +0000)]
MC: rename EmitWin64EH routines

Rename the routines to reflect the reality that they are more related to call
frame information than to Win64 EH. Although EH is implemented in an intertwined
manner by augmenting with an exception handler and an associated parameter, the
majority of these routines emit information required to unwind the frames. This
also helps identify that these routines are generic for most windows platforms
(they apply equally to nearly all architectures except x86) although the
encoding of the information is architecture dependent.

Unwinding data is emitted via EmitWinCFI* and exception handling information via
EmitWinEH*.

llvm-svn: 211994

10 years agoAdd ops() method to SDNode that returns an ArrayRef<SDUse>. Use it to simplify some...
Craig Topper [Sun, 29 Jun 2014 00:40:57 +0000 (00:40 +0000)]
Add ops() method to SDNode that returns an ArrayRef<SDUse>. Use it to simplify some code.

llvm-svn: 211993

10 years agotest: add a test for windows itanium exceptions
Saleem Abdulrasool [Sat, 28 Jun 2014 23:34:15 +0000 (23:34 +0000)]
test: add a test for windows itanium exceptions

Some time ago, I noticed that try would get resolved incorrectly for Windows
Itanium targets.  Add an explicit test to exsure that exceptions are handled
correctly for Windows Itanium environments.

llvm-svn: 211992

10 years agoBasic: fix handling for Windows Itanium environment
Saleem Abdulrasool [Sat, 28 Jun 2014 23:34:11 +0000 (23:34 +0000)]
Basic: fix handling for Windows Itanium environment

This corrects the handling for i686-windows-itanium.  This environment is nearly
identical to Windows MSVC, except it uses the itanium ABI for C++.

llvm-svn: 211991

10 years agoBasic: whitespace cleanup
Saleem Abdulrasool [Sat, 28 Jun 2014 23:34:07 +0000 (23:34 +0000)]
Basic: whitespace cleanup

Remove unnecessary separation of anonymous namespace.  NFC.

llvm-svn: 211990

10 years agoExtend -Wtautological-undefined-compare and -Wundefined-bool-conversion to
Richard Trieu [Sat, 28 Jun 2014 23:25:37 +0000 (23:25 +0000)]
Extend -Wtautological-undefined-compare and -Wundefined-bool-conversion to
trigger on taking the address of a reference that is returned from a function
call.

llvm-svn: 211989

10 years agoImport MutableArrayRef into clang namespace.
Craig Topper [Sat, 28 Jun 2014 23:22:33 +0000 (23:22 +0000)]
Import MutableArrayRef into clang namespace.

llvm-svn: 211988

10 years agoRemove llvm:: from uses of ArrayRef.
Craig Topper [Sat, 28 Jun 2014 23:22:23 +0000 (23:22 +0000)]
Remove llvm:: from uses of ArrayRef.

llvm-svn: 211987

10 years agoUse a range loop. No functionality change.
Rafael Espindola [Sat, 28 Jun 2014 18:44:59 +0000 (18:44 +0000)]
Use a range loop. No functionality change.

llvm-svn: 211986

10 years agoSimplify code a bit, no functionality change.
Rafael Espindola [Sat, 28 Jun 2014 17:46:19 +0000 (17:46 +0000)]
Simplify code a bit, no functionality change.

llvm-svn: 211985

10 years ago[Driver][Mips] Fix else-after-return.
Simon Atanasyan [Sat, 28 Jun 2014 15:56:08 +0000 (15:56 +0000)]
[Driver][Mips] Fix else-after-return.

No functional changes.

llvm-svn: 211984

10 years ago[Driver][Mips] Remove redundant brackets.
Simon Atanasyan [Sat, 28 Jun 2014 15:56:03 +0000 (15:56 +0000)]
[Driver][Mips] Remove redundant brackets.

No functional changes.

llvm-svn: 211983

10 years ago[Driver][Mips] Remove redundant abstract/override function.
Simon Atanasyan [Sat, 28 Jun 2014 15:55:55 +0000 (15:55 +0000)]
[Driver][Mips] Remove redundant abstract/override function.

No functional changes.

llvm-svn: 211982

10 years ago[C++11] Use more range based fors
Tobias Grosser [Sat, 28 Jun 2014 08:59:45 +0000 (08:59 +0000)]
[C++11] Use more range based fors

llvm-svn: 211981

10 years agoRemove redundant code and use C++ range fors
Tobias Grosser [Sat, 28 Jun 2014 08:59:38 +0000 (08:59 +0000)]
Remove redundant code and use C++ range fors

llvm-svn: 211980

10 years agoGet arm_acle tests from r211962 working
Alp Toker [Sat, 28 Jun 2014 06:51:27 +0000 (06:51 +0000)]
Get arm_acle tests from r211962 working

llvm-svn: 211979

10 years agoFix build following r211956
Alp Toker [Sat, 28 Jun 2014 06:31:47 +0000 (06:31 +0000)]
Fix build following r211956

RuntimeDyld now uses MCInst::dump_pretty() which introduces a dependency on
'MC'.

llvm-svn: 211978

10 years agoVerifier: Update assert message to reflect LangRef
David Majnemer [Sat, 28 Jun 2014 06:24:49 +0000 (06:24 +0000)]
Verifier: Update assert message to reflect LangRef

No functionality change, just correcting the assertion message.

llvm-svn: 211977

10 years ago[x86] Fix a bug in the v8i16 shuffling exposed by the new splat-like
Chandler Carruth [Sat, 28 Jun 2014 05:46:28 +0000 (05:46 +0000)]
[x86] Fix a bug in the v8i16 shuffling exposed by the new splat-like
lowering for v16i8.

ASan and some bots caught this bug with existing test cases. Fixing it
even fixed a miscompile with one of the test cases. I'm still a bit
suspicious of this test case as I've not taken a proper amount of time
to think about it, but the fix here is strict goodness.

llvm-svn: 211976