platform/upstream/llvm.git
9 years agoConvert a member variable to a local variable. NFC.
Rafael Espindola [Tue, 16 Dec 2014 02:53:35 +0000 (02:53 +0000)]
Convert a member variable to a local variable. NFC.

llvm-svn: 224311

9 years agoInstead of rolling our own, use the C++11 sanctioned solution
Enrico Granata [Tue, 16 Dec 2014 02:34:13 +0000 (02:34 +0000)]
Instead of rolling our own, use the C++11 sanctioned solution

llvm-svn: 224310

9 years agoRemove unused member and simplify. NFC.
Rafael Espindola [Tue, 16 Dec 2014 02:19:26 +0000 (02:19 +0000)]
Remove unused member and simplify. NFC.

llvm-svn: 224309

9 years agoFix data symbolization with libbacktrace. Patch by Jakub Jelinek!
Alexey Samsonov [Tue, 16 Dec 2014 01:52:55 +0000 (01:52 +0000)]
Fix data symbolization with libbacktrace. Patch by Jakub Jelinek!

llvm-svn: 224308

9 years agoStart adding thin archive support.
Rafael Espindola [Tue, 16 Dec 2014 01:43:41 +0000 (01:43 +0000)]
Start adding thin archive support.

This is just sufficient for 'ar t' to work.

llvm-svn: 224307

9 years agoIf a binary was stripped we sometimes didn't show the ivars of an Objective C class...
Greg Clayton [Tue, 16 Dec 2014 01:33:17 +0000 (01:33 +0000)]
If a binary was stripped we sometimes didn't show the ivars of an Objective C class correctly. Now we do as we consult the runtime data for the class so we don't have to have a symbol in the symbol table.

Fixed:
1 - try the symbol table symbol for an ObjC ivar and use it if available
2 - fall back to using the runtime data since it is slower to gather via memory read
3 - Fixed our hidden ivars test case to test this to ensure we don't regress
4 - split out a test case in the hidden ivars to cover only the part that was failing so we don't have an expected failure for all of the other content in the test.

<rdar://problem/18882687>

llvm-svn: 224306

9 years ago[ASan] Allow to atomically modify malloc_context_size at runtime.
Alexey Samsonov [Tue, 16 Dec 2014 01:23:03 +0000 (01:23 +0000)]
[ASan] Allow to atomically modify malloc_context_size at runtime.

Summary:
Introduce __asan::malloc_context_size atomic that is used to determine
required malloc/free stack trace size. It is initialized with
common_flags()->malloc_context_size flag, but can later be overwritten
at runtime (e.g. when ASan is activated / deactivated).

Test Plan: regression test suite

Reviewers: kcc, eugenis

Subscribers: llvm-commits

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

llvm-svn: 224305

9 years agoAppease the c++14 buildbots
Jonathan Roelofs [Tue, 16 Dec 2014 01:18:11 +0000 (01:18 +0000)]
Appease the c++14 buildbots

llvm-svn: 224304

9 years agoClarify the code in checkDLLAttribute()
Hans Wennborg [Tue, 16 Dec 2014 01:15:01 +0000 (01:15 +0000)]
Clarify the code in checkDLLAttribute()

Update the comments to make it more clear what's going on, and address
Richard's comments from PR21718. This doesn't fix that bug, but hopefully
makes the code easier to understand.

llvm-svn: 224303

9 years agoFix a bug in llvm-objdump’s -private-headers for 32-bit Mach-O files
Kevin Enderby [Tue, 16 Dec 2014 01:14:45 +0000 (01:14 +0000)]
Fix a bug in llvm-objdump’s -private-headers for 32-bit Mach-O files
printing the section header.  And add some tests for this for 32-bit files.

llvm-svn: 224302

9 years agoComment out the breaking tests until I figure out what's going on here.
Marshall Clow [Tue, 16 Dec 2014 00:59:59 +0000 (00:59 +0000)]
Comment out the breaking tests until I figure out what's going on here.

llvm-svn: 224301

9 years agoFix installheaders target's permissions
Jonathan Roelofs [Tue, 16 Dec 2014 00:48:13 +0000 (00:48 +0000)]
Fix installheaders target's permissions

llvm-svn: 224300

9 years agoSema: Check value dependent casts when possible
David Majnemer [Tue, 16 Dec 2014 00:46:30 +0000 (00:46 +0000)]
Sema: Check value dependent casts when possible

We know that const_cast<char *>((void)Something) is ill-formed, even if
'Something' is dependent because you can't cast from void to a pointer
type.

This fixes PR21845.

llvm-svn: 224299

9 years agoOnce more w/o the typo.
Marshall Clow [Tue, 16 Dec 2014 00:46:23 +0000 (00:46 +0000)]
Once more w/o the typo.

llvm-svn: 224298

9 years agoFix the literal string that I said would be six elements long to actually be six...
Marshall Clow [Tue, 16 Dec 2014 00:45:47 +0000 (00:45 +0000)]
Fix the literal string that I said would be six elements long to actually be six elements long. Octal. Sheesh.

llvm-svn: 224297

9 years agoAdd test to ensure that iterator_traits<NotAnIterator> doesn't have a value type
Marshall Clow [Tue, 16 Dec 2014 00:30:07 +0000 (00:30 +0000)]
Add test to ensure that iterator_traits<NotAnIterator> doesn't have a value type

llvm-svn: 224295

9 years agoARM/AArch64: Attach the FrameSetup MIFlag to CFI instructions.
Adrian Prantl [Tue, 16 Dec 2014 00:20:49 +0000 (00:20 +0000)]
ARM/AArch64: Attach the FrameSetup MIFlag to CFI instructions.
Debug info marks the first instruction without the FrameSetup flag
as being the end of the function prologue. Any CFI instructions in the
middle of the function prologue would cause debug info to end the prologue
too early and worse, attach the line number of the CFI instruction, which
incidentally is often 0.

llvm-svn: 224294

9 years ago[Hexagon] Adding doubleword multiplies with and without accumulation.
Colin LeMahieu [Tue, 16 Dec 2014 00:07:24 +0000 (00:07 +0000)]
[Hexagon] Adding doubleword multiplies with and without accumulation.

llvm-svn: 224293

9 years agoImplement LWG 2217 - operator==(sub_match, string) slices on embedded '\0's
Marshall Clow [Mon, 15 Dec 2014 23:57:56 +0000 (23:57 +0000)]
Implement LWG 2217 - operator==(sub_match, string) slices on embedded '\0's

llvm-svn: 224292

9 years agoSink the isa into the assert
Michael Ilseman [Mon, 15 Dec 2014 23:41:21 +0000 (23:41 +0000)]
Sink the isa into the assert

llvm-svn: 224291

9 years agoNow that AddressOf() does sane things with const results, this check is wrong. Since...
Enrico Granata [Mon, 15 Dec 2014 23:36:23 +0000 (23:36 +0000)]
Now that AddressOf() does sane things with const results, this check is wrong. Since this is actually quite orthogonal to what this test is all about, actually get rid of the assertions

llvm-svn: 224290

9 years ago[Hexagon] Adding halfword to doubleword multiplies.
Colin LeMahieu [Mon, 15 Dec 2014 23:29:37 +0000 (23:29 +0000)]
[Hexagon] Adding halfword to doubleword multiplies.

llvm-svn: 224289

9 years ago[Hexagon] Adding logical-logical accumulation instructions and tests.
Colin LeMahieu [Mon, 15 Dec 2014 23:19:07 +0000 (23:19 +0000)]
[Hexagon] Adding logical-logical accumulation instructions and tests.

llvm-svn: 224288

9 years agoDiagnose function template definitions inside functions
Reid Kleckner [Mon, 15 Dec 2014 23:16:32 +0000 (23:16 +0000)]
Diagnose function template definitions inside functions

The parser can only be tricked into parsing a function template
definition by inserting a typename keyword before the function template
declaration. This used to make us crash, and now it's fixed.

While here, remove an unneeded boolean parameter from ParseDeclGroup.
This boolean always corresponded to non-typedef declarators at file
scope. ParseDeclGroup already has precise diagnostics for the function
definition typedef case, so we can let that through.

Fixes PR21839.

llvm-svn: 224287

9 years ago[asan] introduce __sanitizer_set_death_callback, deprecate __asan_set_death_callback
Kostya Serebryany [Mon, 15 Dec 2014 23:02:57 +0000 (23:02 +0000)]
[asan] introduce __sanitizer_set_death_callback, deprecate __asan_set_death_callback

llvm-svn: 224286

9 years agoTeach ScalarEvolution to exploit min and max expressions when proving
Sanjoy Das [Mon, 15 Dec 2014 22:50:15 +0000 (22:50 +0000)]
Teach ScalarEvolution to exploit min and max expressions when proving
isKnownPredicate.

The motivation for this change is to optimize away checks in loops
like this:

    limit = min(t, len)
    for (i = 0 to limit)
      if (i >= len || i < 0) throw_array_of_of_bounds();
      a[i] = ...

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

llvm-svn: 224285

9 years agoAdded missing tests for X86vzmovl folding. NFC.
Simon Pilgrim [Mon, 15 Dec 2014 22:45:48 +0000 (22:45 +0000)]
Added missing tests for X86vzmovl folding. NFC.

llvm-svn: 224284

9 years agox86: Emit LOCK prefix after DATA16
JF Bastien [Mon, 15 Dec 2014 22:34:58 +0000 (22:34 +0000)]
x86: Emit LOCK prefix after DATA16

Summary: x86 allows either ordering for the LOCK and DATA16 prefixes, but using GCC+GAS leads to different code generation than using LLVM. This change matches the order that GAS emits the x86 prefixes when a semicolon isn't used in inline assembly (see tc-i386.c comment before define LOCK_PREFIX), and helps simplify tooling that operates on the instruction's byte sequence (such as NaCl's validator). This change shouldn't have any performance impact.

Test Plan: ninja check

Reviewers: craig.topper, jvoung

Subscribers: jfb, llvm-commits

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

llvm-svn: 224283

9 years ago[Hexagon] Adding a number of additional multiply forms with tests.
Colin LeMahieu [Mon, 15 Dec 2014 22:10:37 +0000 (22:10 +0000)]
[Hexagon] Adding a number of additional multiply forms with tests.

llvm-svn: 224282

9 years agoClean up warning about unused variable
Michael Ilseman [Mon, 15 Dec 2014 21:47:09 +0000 (21:47 +0000)]
Clean up warning about unused variable

llvm-svn: 224281

9 years agoHand-modify a testcase (still PR21532)
Duncan P. N. Exon Smith [Mon, 15 Dec 2014 21:43:20 +0000 (21:43 +0000)]
Hand-modify a testcase (still PR21532)

Bot was still tripping [1] on a testcase the upgrade script didn't
handle in 224269.  This is still fallout from r224257.

[1]: http://lab.llvm.org:8011/builders/polly-amd64-linux/builds/25435

llvm-svn: 224280

9 years agoSilene -Wreorder warning.
Roman Divacky [Mon, 15 Dec 2014 21:41:59 +0000 (21:41 +0000)]
Silene -Wreorder warning.

llvm-svn: 224279

9 years agoRevert "LiveRangeCalc: Rewrite subrange calculation"
Matthias Braun [Mon, 15 Dec 2014 21:36:35 +0000 (21:36 +0000)]
Revert "LiveRangeCalc: Rewrite subrange calculation"

Revert until I find out why non-subreg enabled targets break.

This reverts commit 6097277eefb9c5fb35a7f493c783ee1fd1b9d6a7.

llvm-svn: 224278

9 years agoRevert of r223763, in spirit.
Michael Ilseman [Mon, 15 Dec 2014 21:36:29 +0000 (21:36 +0000)]
Revert of r223763, in spirit.

r223763 was made to work around a temporary issue where a user of the
JIT was passing down a declaration (incorrectly). This shouldn't
occur, so assert rather than silently continue.

llvm-svn: 224277

9 years agoUpdate lib/profile tests for metadata assembly change
Duncan P. N. Exon Smith [Mon, 15 Dec 2014 21:34:19 +0000 (21:34 +0000)]
Update lib/profile tests for metadata assembly change

Running the upgrade script from PR21532.  Hopefully this will unstick
compiler-rt bots [1] after r224257.

[1]: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA_check/181/

llvm-svn: 224276

9 years agoProvide a SBFrame.register/.reg helper on the Python side of SBFrame to vend a flatte...
Enrico Granata [Mon, 15 Dec 2014 21:30:36 +0000 (21:30 +0000)]
Provide a SBFrame.register/.reg helper on the Python side of SBFrame to vend a flattened view of registers

Our actual view of registers is a set of register sets, each one of which contains a subset of the actual registers
This makes trivial scripting operations tedious ("I just want to read r7!")

This helper allows things like: print lldb.frame.reg["r7"]

Fixes rdar://19185662

llvm-svn: 224275

9 years agoClarify HowFarToZero computation when the step is a positive power of two. Functiona...
Mark Heffernan [Mon, 15 Dec 2014 21:19:53 +0000 (21:19 +0000)]
Clarify HowFarToZero computation when the step is a positive power of two.  Functionally this should be identical to the existing code except for the case where Step is maximally negative (eg, INT_MIN).  We now punt in that one corner case to make reasoning about the code easier.

llvm-svn: 224274

9 years ago[Hexagon] Adding misc multiply encodings and tests.
Colin LeMahieu [Mon, 15 Dec 2014 21:17:03 +0000 (21:17 +0000)]
[Hexagon] Adding misc multiply encodings and tests.

llvm-svn: 224273

9 years agoLiveRangeCalc: Rewrite subrange calculation
Matthias Braun [Mon, 15 Dec 2014 21:16:21 +0000 (21:16 +0000)]
LiveRangeCalc: Rewrite subrange calculation

This changes subrange calculation to calculate subranges sequentially
instead of in parallel. The code is easier to understand that way and
addresses the code review issues raised about LiveOutData being
hard to understand/needing more comments by removing them :)

llvm-svn: 224272

9 years agoHandle errors in lambda prototype instantiation correctly
Reid Kleckner [Mon, 15 Dec 2014 21:07:16 +0000 (21:07 +0000)]
Handle errors in lambda prototype instantiation correctly

Previously we would attempt to build a TypeSourceInfo for a null type,
and then we would forget to pop the function scope before returning an
error.

Reviewers: rsmith

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

llvm-svn: 224271

9 years agoprofile: Add the relevant parts of lib/profile to cc_kext on darwin
Justin Bogner [Mon, 15 Dec 2014 20:44:05 +0000 (20:44 +0000)]
profile: Add the relevant parts of lib/profile to cc_kext on darwin

Patch by Lawrence D'Anna. Thanks!

llvm-svn: 224270

9 years agoRun upgrade script from PR21532 to match LLVM changes
Duncan P. N. Exon Smith [Mon, 15 Dec 2014 20:28:50 +0000 (20:28 +0000)]
Run upgrade script from PR21532 to match LLVM changes

Update tests for LLVM assembly format change in r224257 using the script
attached to PR21532.  I'm hoping this unsticks the bot [1].

[1]: http://lab.llvm.org:8011/builders/polly-amd64-linux/builds/25432

llvm-svn: 224269

9 years agoSema: Cleanup and improve string-plus-char checking.
Daniel Marjamaki [Mon, 15 Dec 2014 20:22:33 +0000 (20:22 +0000)]
Sema: Cleanup and improve string-plus-char checking.

Patch by Anders Rönnholm

llvm-svn: 224268

9 years ago[Hexagon] Adding doubleworld accumulating multiplies of halfwords.
Colin LeMahieu [Mon, 15 Dec 2014 20:17:46 +0000 (20:17 +0000)]
[Hexagon] Adding doubleworld accumulating multiplies of halfwords.

llvm-svn: 224267

9 years ago[Hexagon] Adding accumulating half word multiplies.
Colin LeMahieu [Mon, 15 Dec 2014 20:10:28 +0000 (20:10 +0000)]
[Hexagon] Adding accumulating half word multiplies.

llvm-svn: 224266

9 years ago[Hexagon] Adding multiply with rnd/sat/rndsat
Colin LeMahieu [Mon, 15 Dec 2014 20:01:59 +0000 (20:01 +0000)]
[Hexagon] Adding multiply with rnd/sat/rndsat

llvm-svn: 224265

9 years ago[X86] And also test INSERTPS shuffle mask pretty-printing.
Ahmed Bougacha [Mon, 15 Dec 2014 19:47:35 +0000 (19:47 +0000)]
[X86] And also test INSERTPS shuffle mask pretty-printing.

For r224260.

llvm-svn: 224264

9 years agoLiveRangeCalc: use more range based for loops; NFC
Matthias Braun [Mon, 15 Dec 2014 19:40:46 +0000 (19:40 +0000)]
LiveRangeCalc: use more range based for loops; NFC

llvm-svn: 224263

9 years agoUpdate this testcase for the new metadata assembler syntax.
Adrian Prantl [Mon, 15 Dec 2014 19:25:33 +0000 (19:25 +0000)]
Update this testcase for the new metadata assembler syntax.

llvm-svn: 224262

9 years ago[Hexagon] Adding encoding bits for halfword multiplies.
Colin LeMahieu [Mon, 15 Dec 2014 19:22:07 +0000 (19:22 +0000)]
[Hexagon] Adding encoding bits for halfword multiplies.

llvm-svn: 224261

9 years ago[X86] Also pretty-print shuffle mask for INSERTPS rm variants.
Ahmed Bougacha [Mon, 15 Dec 2014 19:17:54 +0000 (19:17 +0000)]
[X86] Also pretty-print shuffle mask for INSERTPS rm variants.

llvm-svn: 224260

9 years agoIR: Make metadata typeless in assembly, clang side
Duncan P. N. Exon Smith [Mon, 15 Dec 2014 19:10:08 +0000 (19:10 +0000)]
IR: Make metadata typeless in assembly, clang side

Match LLVM changes from r224257.

llvm-svn: 224259

9 years agoReplace ioctl with select to reduce processor usage by lldb-mi on OSX.
Hafiz Abid Qadeer [Mon, 15 Dec 2014 19:09:40 +0000 (19:09 +0000)]
Replace ioctl with select to reduce processor usage by lldb-mi on OSX.
This saga started with a hang on OSX. 2 solutions were proposed.
1) 'select' based solution works ok on OSX but slows down test completion time
on Linux many times.
2) 'ioctl' base solution also works but it causes heavy processor usage on OSX
as reported by Ilia K.

But as the original hang did not occur on Linux so this commit re-introduces the
'select' in conditional code so that it only runs for OSX. There is no need for
this 'fix' to run on Linux.

Initial patch by Ilia K <ki.stfu@gmail.com>. A few changes were made by me.

llvm-svn: 224258

9 years agoIR: Make metadata typeless in assembly
Duncan P. N. Exon Smith [Mon, 15 Dec 2014 19:07:53 +0000 (19:07 +0000)]
IR: Make metadata typeless in assembly

Now that `Metadata` is typeless, reflect that in the assembly.  These
are the matching assembly changes for the metadata/value split in
r223802.

  - Only use the `metadata` type when referencing metadata from a call
    intrinsic -- i.e., only when it's used as a `Value`.

  - Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
    when referencing it from call intrinsics.

So, assembly like this:

    define @foo(i32 %v) {
      call void @llvm.foo(metadata !{i32 %v}, metadata !0)
      call void @llvm.foo(metadata !{i32 7}, metadata !0)
      call void @llvm.foo(metadata !1, metadata !0)
      call void @llvm.foo(metadata !3, metadata !0)
      call void @llvm.foo(metadata !{metadata !3}, metadata !0)
      ret void, !bar !2
    }
    !0 = metadata !{metadata !2}
    !1 = metadata !{i32* @global}
    !2 = metadata !{metadata !3}
    !3 = metadata !{}

turns into this:

    define @foo(i32 %v) {
      call void @llvm.foo(metadata i32 %v, metadata !0)
      call void @llvm.foo(metadata i32 7, metadata !0)
      call void @llvm.foo(metadata i32* @global, metadata !0)
      call void @llvm.foo(metadata !3, metadata !0)
      call void @llvm.foo(metadata !{!3}, metadata !0)
      ret void, !bar !2
    }
    !0 = !{!2}
    !1 = !{i32* @global}
    !2 = !{!3}
    !3 = !{}

I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines).  I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.

This is part of PR21532.

llvm-svn: 224257

9 years agoWarn when attribute 'optnone' conflicts with attributes on a
Paul Robinson [Mon, 15 Dec 2014 18:57:28 +0000 (18:57 +0000)]
Warn when attribute 'optnone' conflicts with attributes on a
different declaration of the same function.

llvm-svn: 224256

9 years agoSilence more static analyzer warnings.
Michael Ilseman [Mon, 15 Dec 2014 18:48:43 +0000 (18:48 +0000)]
Silence more static analyzer warnings.

Add in definedness checks for shift operators, null checks when
pointers are assumed by the code to be non-null, and explicit
unreachables.

llvm-svn: 224255

9 years agoMove mips1 tests to test/MC/Disassembler/Mips/mips1
Reid Kleckner [Mon, 15 Dec 2014 17:56:02 +0000 (17:56 +0000)]
Move mips1 tests to test/MC/Disassembler/Mips/mips1

This matches the pattern of the mips2 and 3 tests, as well as our normal
conventions.

llvm-svn: 224254

9 years agoAdd disassembler tests for mips3 platform. There are no functional changes.
Vladimir Medic [Mon, 15 Dec 2014 16:19:34 +0000 (16:19 +0000)]
Add disassembler tests for mips3 platform. There are no functional changes.

llvm-svn: 224253

9 years agoAdd disassembler tests for mips2 platform. There are no functional changes.
Vladimir Medic [Mon, 15 Dec 2014 15:58:20 +0000 (15:58 +0000)]
Add disassembler tests for mips2 platform. There are no functional changes.

llvm-svn: 224252

9 years agoThis is the first in a series of patches that add missing disassembler tests for...
Vladimir Medic [Mon, 15 Dec 2014 15:22:33 +0000 (15:22 +0000)]
This is the first in a series of patches that add missing disassembler tests for mips platform. The patches are divided per version of mips CPU to keep the patches smaller and ease the review. There are no functional changes, code is changed only if new tests reveal a bug.This patch adds disassembler tests for mips1 CPU.

llvm-svn: 224251

9 years agoAdd voidType() matcher.
Samuel Benzaquen [Mon, 15 Dec 2014 15:09:22 +0000 (15:09 +0000)]
Add voidType() matcher.

Summary: Add voidType() matcher.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 224250

9 years agoChanging a cast from unsigned to uint64_t, should be NFC in practice.
Aaron Ballman [Mon, 15 Dec 2014 14:25:12 +0000 (14:25 +0000)]
Changing a cast from unsigned to uint64_t, should be NFC in practice.

llvm-svn: 224249

9 years agoAdded a test related to 224247 revision
Elena Demikhovsky [Mon, 15 Dec 2014 14:14:10 +0000 (14:14 +0000)]
Added a test related to 224247 revision

llvm-svn: 224248

9 years agoSink store based on alias analysis
Elena Demikhovsky [Mon, 15 Dec 2014 14:09:53 +0000 (14:09 +0000)]
Sink store based on alias analysis
 - by Ella Bolshinsky
The alias analysis is used define whether the given instruction
is a barrier for store sinking. For 2 identical stores, following
instructions are checked in the both basic blocks, to determine
whether they are sinking barriers.

http://reviews.llvm.org/D6420

llvm-svn: 224247

9 years ago[X86] Break false dependencies before partial register updates when the source operan...
Michael Kuperstein [Mon, 15 Dec 2014 13:18:21 +0000 (13:18 +0000)]
[X86] Break false dependencies before partial register updates when the source operand is in memory

Adds the various "rm" instruction variants into the list of instructions that have a partial register update. Also adds all variants of SQRTSD that were missing in the original list.

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

llvm-svn: 224246

9 years agoReplace ReaderError with DynamicError.
Rui Ueyama [Mon, 15 Dec 2014 12:20:13 +0000 (12:20 +0000)]
Replace ReaderError with DynamicError.

ReaderErrorCategory was used only at one place. We now have a
DynamicErrorCategory for this kind of one-time error, so use it.
The calling function doesn't really care the type of an error, so
ReaderErrorCategory was actually dead code.

llvm-svn: 224245

9 years agoTypo Correction in Test Case. NFC.
Suyog Sarda [Mon, 15 Dec 2014 12:19:46 +0000 (12:19 +0000)]
Typo Correction in Test Case. NFC.

llvm-svn: 224244

9 years ago[ubsan][arm] supporting misaligned testcase
Kumar Sukhani [Mon, 15 Dec 2014 12:16:36 +0000 (12:16 +0000)]
[ubsan][arm] supporting misaligned testcase

After previous commit: http://reviews.llvm.org/rL224242, misaligned testcase is now supported on ARM also

llvm-svn: 224243

9 years ago[UBSan][MIPS] Adding support of MIPS64 in UBSan testing
Kumar Sukhani [Mon, 15 Dec 2014 10:52:06 +0000 (10:52 +0000)]
[UBSan][MIPS] Adding support of MIPS64 in UBSan testing

On mips64 addresses are 40-bit. Where as a 48 bit address is used in TypeCheck/misaligned.cpp.
Using regular expression for that address.

reviewed by : samsonov
submitted by: sagar

llvm-svn: 224242

9 years agoAVX-512: Added EXPAND instructions and intrinsics.
Elena Demikhovsky [Mon, 15 Dec 2014 10:03:52 +0000 (10:03 +0000)]
AVX-512: Added EXPAND instructions and intrinsics.

llvm-svn: 224241

9 years agoSema: Don't diagnose string + int if the int is value dependent
David Majnemer [Mon, 15 Dec 2014 10:00:35 +0000 (10:00 +0000)]
Sema: Don't diagnose string + int if the int is value dependent

Don't send a value dependent expression into the expression evaluator,
HandleSizeof would crash.  Making HandleSizeof handle dependent types
would noisily warn about the operation even if everything turns out OK
after instantiation.

This fixes PR21848.

llvm-svn: 224240

9 years ago[UBSan][MIPS] Adding support for MIPS64
Kumar Sukhani [Mon, 15 Dec 2014 09:20:06 +0000 (09:20 +0000)]
[UBSan][MIPS] Adding support for MIPS64

No MIPS64 architecture dependant code

reviewed by : samsonov
submitted by: sagar

llvm-svn: 224239

9 years agoPreprocessor: Recover instead of mutating a token in ExpandBuiltinMacro
David Majnemer [Mon, 15 Dec 2014 09:03:58 +0000 (09:03 +0000)]
Preprocessor: Recover instead of mutating a token in ExpandBuiltinMacro

We would CreateString on arbitrary garbage instead of just skipping to
the end of the builtin macro.  Eventually, this would cause us to crash
because we would end up replacing the contents of a character token with
a numeric literal.

This fixes PR21825.

llvm-svn: 224238

9 years agoSema: Don't leave switch stack inconsistent when recovering
David Majnemer [Mon, 15 Dec 2014 07:46:12 +0000 (07:46 +0000)]
Sema: Don't leave switch stack inconsistent when recovering

We would exit Sema::ActOnFinishSwitchStmt early if we didn't have a
body.  This would leave an extra SwitchStmt on the SwitchStack.

This fixes PR21841.

llvm-svn: 224237

9 years agoRemove dead code.
Rui Ueyama [Mon, 15 Dec 2014 07:22:29 +0000 (07:22 +0000)]
Remove dead code.

This field was not even initialized properly.

llvm-svn: 224236

9 years agoProtect doParse() because that's not a public interface.
Rui Ueyama [Mon, 15 Dec 2014 07:14:32 +0000 (07:14 +0000)]
Protect doParse() because that's not a public interface.

llvm-svn: 224235

9 years agoTest for 'omp for' (for r224233).
Alexander Musman [Mon, 15 Dec 2014 07:08:38 +0000 (07:08 +0000)]
Test for 'omp for' (for r224233).

llvm-svn: 224234

9 years agoFirst patch with codegen of the 'omp for' directive. It implements
Alexander Musman [Mon, 15 Dec 2014 07:07:06 +0000 (07:07 +0000)]
First patch with codegen of the 'omp for' directive. It implements
the simplest case, which is used when no chunk_size is specified in
the schedule(static) or no 'schedule' clause is specified - the
iteration space is divided by the library into chunks that are
approximately equal in size, and at most one chunk is distributed
to each thread. In this case, we do not need an outer loop in each
thread - each thread requests once which iterations range it should
handle (using __kmpc_for_static_init runtime call) and then runs the
inner loop on this range.

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

llvm-svn: 224233

9 years agoParse: Don't reorder tokens using ConsumeToken
David Majnemer [Mon, 15 Dec 2014 07:00:05 +0000 (07:00 +0000)]
Parse: Don't reorder tokens using ConsumeToken

ConsumeToken doesn't work with special tokens.  Instead, just use PP.Lex
to eat the token.

This fixes PR21817.

llvm-svn: 224232

9 years agoFixed test/CodeGen/atomic_ops.c for compatibility with hexagon target
Alexey Bataev [Mon, 15 Dec 2014 06:12:42 +0000 (06:12 +0000)]
Fixed test/CodeGen/atomic_ops.c for compatibility with hexagon target

llvm-svn: 224231

9 years agoBugfix for Codegen of atomic load/store/other ops.
Alexey Bataev [Mon, 15 Dec 2014 05:25:25 +0000 (05:25 +0000)]
Bugfix for Codegen of atomic load/store/other ops.
Currently clang fires assertions on x86-64 on any atomic operations for long double operands. Patch fixes codegen for such operations.
Differential Revision: http://reviews.llvm.org/D6499

llvm-svn: 224230

9 years agoFix line mapping information in LLVM JIT profiling with Vtune
Alexey Bataev [Mon, 15 Dec 2014 04:45:43 +0000 (04:45 +0000)]
Fix line mapping information in LLVM JIT profiling with Vtune
The line mapping information for dynamic code is reported incorrectly. It causes VTune to map LLVM generated code to source lines incorrectly. This patch fix this issue.
Patch by Denis Pravdin.
Differential Revision: http://reviews.llvm.org/D6603

llvm-svn: 224229

9 years agoMSVC: A wide string literal from L#macro_arg in a macro
Alexey Bataev [Mon, 15 Dec 2014 04:18:11 +0000 (04:18 +0000)]
MSVC: A wide string literal from L#macro_arg in a macro
Clang should form a wide string literal from L#macro_arg in a function-like macro in -fms-compatibility mode.
Fix for http://llvm.org/PR9984.
Differential Revision: http://reviews.llvm.org/D6604

llvm-svn: 224228

9 years agoThreadLocal: Move Unix-specific code out of Support/ThreadLocal.cpp
David Majnemer [Mon, 15 Dec 2014 01:19:53 +0000 (01:19 +0000)]
ThreadLocal: Move Unix-specific code out of Support/ThreadLocal.cpp

Just a cleanup, no functionality change is intended.

llvm-svn: 224227

9 years agoStringPool: Cleanup typos in unittest comments
David Majnemer [Mon, 15 Dec 2014 01:04:49 +0000 (01:04 +0000)]
StringPool: Cleanup typos in unittest comments

No functional change intended.

llvm-svn: 224226

9 years agoThreadLocal: Return a mutable pointer if templated with a non-const type
David Majnemer [Mon, 15 Dec 2014 01:04:45 +0000 (01:04 +0000)]
ThreadLocal: Return a mutable pointer if templated with a non-const type

It makes more sense for ThreadLocal<const T>::get to return a const T*
and ThreadLocal<T>::get to return a T*.

llvm-svn: 224225

9 years agoUse unique_ptr to remove explicit delete.
Craig Topper [Mon, 15 Dec 2014 00:40:07 +0000 (00:40 +0000)]
Use unique_ptr to remove explicit delete.

llvm-svn: 224224

9 years agoDon't break single-line raw string literals.
Alexander Kornienko [Sun, 14 Dec 2014 20:47:11 +0000 (20:47 +0000)]
Don't break single-line raw string literals.

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 224223

9 years agoUpdate test case with more accurate column information now that Clang produces same
David Blaikie [Sun, 14 Dec 2014 18:49:31 +0000 (18:49 +0000)]
Update test case with more accurate column information now that Clang produces same

llvm-svn: 224222

9 years agoDebugInfo: More accurate line information for placement new.
David Blaikie [Sun, 14 Dec 2014 18:48:18 +0000 (18:48 +0000)]
DebugInfo: More accurate line information for placement new.

This actually came up as a break in UBSan tests (look for a follow-up
commit to this one to see the UBSan test fallout) when I tried a broader
fix to location information.

I have some other ideas about how to do that broader change & will keep
looking into it.

llvm-svn: 224221

9 years agoCodeGen: Compound literals with funny types shouldn't crash
David Majnemer [Sun, 14 Dec 2014 12:16:43 +0000 (12:16 +0000)]
CodeGen: Compound literals with funny types shouldn't crash

CodeGen assumed that a compound literal with array type should have a
corresponding LLVM IR array type.

We had two bugs in this area:
- Zero sized arrays in compound literals would lead to the creation of
  an opaque type.  This is unnecessary, we should just create an array
  type with a bound of zero.
- Funny record types (like unions) lead to exotic IR types for compound
  literals.  In this case, CodeGen must be prepared to deal with the
  possibility that it might not have an array IR type.

This fixes PR21912.

llvm-svn: 224219

9 years agoLoop Vectorizer minor changes in the code -
Elena Demikhovsky [Sun, 14 Dec 2014 09:43:50 +0000 (09:43 +0000)]
Loop Vectorizer minor changes in the code -
some comments, function names, identation.

Reviewed here: http://reviews.llvm.org/D6527

llvm-svn: 224218

9 years agoAPInt: udivrem should use machine instructions for single-word APInts
David Majnemer [Sun, 14 Dec 2014 09:41:56 +0000 (09:41 +0000)]
APInt: udivrem should use machine instructions for single-word APInts

This mirrors the behavior of APInt::udiv and APInt::urem.  Some
architectures, like X86, have a single instruction which can compute
both division and remainder.

llvm-svn: 224217

9 years agoScalarEvolution: Remove SCEVUDivision, it's unused
David Majnemer [Sun, 14 Dec 2014 09:12:33 +0000 (09:12 +0000)]
ScalarEvolution: Remove SCEVUDivision, it's unused

This is just a code simplification, no functionality change is intended.

llvm-svn: 224216

9 years agoAST: Limit zero-sized constexpr behavior to array types
David Majnemer [Sun, 14 Dec 2014 08:40:47 +0000 (08:40 +0000)]
AST: Limit zero-sized constexpr behavior to array types

Restricting this "extension" to array types maximizes our standards
conformance while not miscompiling real-world programs.

llvm-svn: 224215

9 years agoClean up #include dependency.
Rui Ueyama [Sun, 14 Dec 2014 07:57:35 +0000 (07:57 +0000)]
Clean up #include dependency.

Core/File.h does not use LinkingContext.h, so remove that dependency.

llvm-svn: 224214

9 years ago[PowerPC] Handle cmp op promotion for SELECT[_CC] nodes in PPCTL::DAGCombineExtBoolTrunc
Hal Finkel [Sun, 14 Dec 2014 05:53:19 +0000 (05:53 +0000)]
[PowerPC] Handle cmp op promotion for SELECT[_CC] nodes in PPCTL::DAGCombineExtBoolTrunc

PPCTargetLowering::DAGCombineExtBoolTrunc contains logic to remove unwanted
truncations and extensions when dealing with nodes of the form:
  zext(binary-ops(binary-ops(trunc(x), trunc(y)), ...)

There was a FIXME in the implementation (now removed) regarding the fact that
the function would abort the transformations if any of the non-output operands
of a SELECT or SELECT_CC node would need to be promoted (because they were
also output operands, for example). As a result, we continued to generate
unnecessary zero-extends for code such as this:

  unsigned foo(unsigned a, unsigned b) {
    return  (a <= b) ? a : b;
  }

which would produce:

  cmplw 0, 3, 4
  isel 3, 4, 3, 1
  rldicl 3, 3, 0, 32
  blr

and now we produce:

  cmplw 0, 3, 4
  isel 3, 4, 3, 1
  blr

which is better in the obvious way.

llvm-svn: 224213

9 years agoRemove PECOFFLibraryNode.
Rui Ueyama [Sun, 14 Dec 2014 05:08:53 +0000 (05:08 +0000)]
Remove PECOFFLibraryNode.

This class is empty, provides no additional feature to the base class.

llvm-svn: 224212

9 years agoMore WinLinkInputGraph cleanup.
Rui Ueyama [Sun, 14 Dec 2014 05:04:22 +0000 (05:04 +0000)]
More WinLinkInputGraph cleanup.

This function is called only from WinLinkDriver.cpp.
Move the function to that file and mark as static.

llvm-svn: 224211

9 years agoLex: Don't crash if both conflict markers are on the same line
David Majnemer [Sun, 14 Dec 2014 04:53:11 +0000 (04:53 +0000)]
Lex: Don't crash if both conflict markers are on the same line

We would check if the terminator marker is on a newline.  However, the
logic would end up out-of-bounds if the terminator marker immediately
follows the start marker.

This fixes PR21820.

llvm-svn: 224210