platform/upstream/llvm.git
10 years agoOk, 3 major changes for debug mode in one commit:
Howard Hinnant [Fri, 2 Aug 2013 00:26:35 +0000 (00:26 +0000)]
Ok, 3 major changes for debug mode in one commit:

1.  I had been detecting and trapping iterator == and \!= among iterators
    in different containers as an error.  But the trapping itself is actually
    an error.

    Consider:

    #include <iostream>
    #include <vector>
    #include <algorithm>

    template <class C>
    void
    display(const C& c)
    {
        std::cout << "{";
        bool first = true;
        for (const auto& x : c)
        {
            if (\!first)
                std::cout << ", ";
            first = false;
            std::cout << x;
        }
        std::cout << "}\n";
    }

    int
    main()
    {
        typedef std::vector<int> V;
        V v1 = {1, 3, 5};
        V v2 = {2, 4, 6};
        display(v1);
        display(v2);
        V::iterator i = std::find(v1.begin(), v1.end(), 1);
        V::iterator j = std::find(v2.begin(), v2.end(), 2);
        if (*i == *j)
            i = j;    // perfectly legal
        // ...
        if (i \!= j)   // the only way to check
            v2.push_back(*i);
        display(v1);
        display(v2);
    }

    It is legal to assign an iterator from one container to another of the
    same type.  This is required to work.  One might want to test whether or
    not such an assignment had been made.  The way one performs such a check
    is using the iterator's ==, \!= operator.  This is a logical and necessary
    function and does not constitute an error.

2.  I had a header circular dependence bug when _LIBCPP_DEBUG2 is defined.
    This caused a problem in several of the libc++ tests.
    Fixed.

3.  There is a serious problem when _LIBCPP_DEBUG2=1 at the moment in that
    std::basic_string is inoperable.  std::basic_string uses __wrap_iterator
    to implement its iterators.  __wrap_iterator has been rigged up in debug
    mode to support vector.  But string hasn't been rigged up yet.  This means
    that one gets false positives when using std::string in debug mode.  I've
    upped std::string's priority in www/debug_mode.html.

llvm-svn: 187636

10 years agoTeach InstructionSimplify about pointer address spaces
Matt Arsenault [Fri, 2 Aug 2013 00:10:44 +0000 (00:10 +0000)]
Teach InstructionSimplify about pointer address spaces

llvm-svn: 187635

10 years agoRevert "ObjectiveC migrator. Migrate to instancetype return type for mehods with...
Rafael Espindola [Fri, 2 Aug 2013 00:01:14 +0000 (00:01 +0000)]
Revert "ObjectiveC migrator. Migrate to instancetype return type for mehods with certain prefix selector matching their class names' suffix."

This reverts commit r187626.

It is breaking the bots.

llvm-svn: 187634

10 years agoRevert "If -fslp-vectorize or -fno-slp-vectorize are given, honor this selection...
Rafael Espindola [Thu, 1 Aug 2013 23:56:42 +0000 (23:56 +0000)]
Revert "If -fslp-vectorize or -fno-slp-vectorize are given, honor this selection. If no flag is given, enable it for -O3."

This reverts commit r187630.

Looks like it is breaking the bots.

llvm-svn: 187633

10 years ago[mips] Make load/store accumulator pseudo instructions codeGenOnly. Also,
Akira Hatanaka [Thu, 1 Aug 2013 23:14:16 +0000 (23:14 +0000)]
[mips] Make load/store accumulator pseudo instructions codeGenOnly. Also,
remove lines that are setting DecoderNamespace for pseudo atomic instructions.

No intended functionality change.

llvm-svn: 187632

10 years agoclang-format: Operator precendence in ObjC method exprs.
Daniel Jasper [Thu, 1 Aug 2013 23:13:03 +0000 (23:13 +0000)]
clang-format: Operator precendence in ObjC method exprs.

Patch (mostly) by Adam Strzelecki. Thanks!

Before:
  [self aaaaaa:bbbbbbbbbbbbb
      aaaaaaaaaa:bbbbbbbbbbbbbbbbb
           aaaaa:bbbbbbbbbbb +
      bbbbbbbbbbbb aaaa:bbb];

After:
  [self aaaaaa:bbbbbbbbbbbbb
      aaaaaaaaaa:bbbbbbbbbbbbbbbbb
           aaaaa:bbbbbbbbbbb + bbbbbbbbbbbb
            aaaa:bbb];

This fixes llvm.org/PR16150.

llvm-svn: 187631

10 years agoIf -fslp-vectorize or -fno-slp-vectorize are given, honor this selection. If no flag...
Nadav Rotem [Thu, 1 Aug 2013 22:56:53 +0000 (22:56 +0000)]
If -fslp-vectorize or -fno-slp-vectorize are given, honor this selection. If no flag is given, enable it for -O3.

llvm-svn: 187630

10 years agoTeach getOrEnforceKnownAlignment about address spaces
Matt Arsenault [Thu, 1 Aug 2013 22:42:18 +0000 (22:42 +0000)]
Teach getOrEnforceKnownAlignment about address spaces

llvm-svn: 187629

10 years agoMove the optlevel check to the frontend.
Nadav Rotem [Thu, 1 Aug 2013 22:41:58 +0000 (22:41 +0000)]
Move the optlevel check to the frontend.

llvm-svn: 187628

10 years agoObjectiveC migrator. Migrate to instancetype return type
Fariborz Jahanian [Thu, 1 Aug 2013 22:29:32 +0000 (22:29 +0000)]
ObjectiveC migrator. Migrate to instancetype return type
for mehods with certain prefix selector matching their class names'
suffix.

llvm-svn: 187626

10 years ago[analyzer] Don't process autorelease counts in synthesized function bodies.
Jordan Rose [Thu, 1 Aug 2013 22:16:36 +0000 (22:16 +0000)]
[analyzer] Don't process autorelease counts in synthesized function bodies.

We process autorelease counts when we exit functions, but if there's an
issue in a synthesized body the report will get dropped. Just skip the
processing for now and let it get handled when the caller gets around to
processing autoreleases.

(This is still suboptimal: objects autoreleased in the caller context
should never be warned about when exiting a callee context, synthesized
or not.)

Second half of <rdar://problem/14611722>

llvm-svn: 187625

10 years ago[analyzer] Silently drop all reports within synthesized bodies.
Jordan Rose [Thu, 1 Aug 2013 22:16:30 +0000 (22:16 +0000)]
[analyzer] Silently drop all reports within synthesized bodies.

Much of our diagnostic machinery is set up to assume that the report
end path location is valid. Moreover, the user may be quite confused
when something goes wrong in our BodyFarm-synthesized function bodies,
which may be simplified or modified from the real implementations.
Rather than try to make this all work somehow, just drop the report so
that we don't try to go on with an invalid source location.

Note that we still handle reports whose /paths/ go through invalid
locations, just not those that are reported in one.

We do have to be careful not to lose warnings because of this.
The impetus for this change was an autorelease being processed within
the synthesized body, and there may be other possible issues that are
worth reporting in some way. We'll take these as they come, however.

<rdar://problem/14611722>

llvm-svn: 187624

10 years agofix for LLVM debug info on llvm-mips-linux where the label name uses % instead of...
Carlo Kok [Thu, 1 Aug 2013 22:15:34 +0000 (22:15 +0000)]
fix for LLVM debug info on llvm-mips-linux where the label name uses % instead of L as a prefix.

llvm-svn: 187623

10 years agoclang-format: Don't break empty 2nd operand of ternary expr.
Daniel Jasper [Thu, 1 Aug 2013 22:05:00 +0000 (22:05 +0000)]
clang-format: Don't break empty 2nd operand of ternary expr.

Before:
  some_quite_long_variable_name_ptr
      ?
      : argv[9] ? ptr : argv[8] ? : argv[7] ? ptr : argv[6];
After:
  some_quite_long_variable_name_ptr
      ?: argv[9] ? ptr : argv[8] ?: argv[7] ? ptr : argv[6];

Patch by Adam Strzelecki, thank you!!

This fixed llvm.org/PR16758.

llvm-svn: 187622

10 years agoRe-enable fast stepping for arm targets. The issue being worked
Jason Molenda [Thu, 1 Aug 2013 21:50:20 +0000 (21:50 +0000)]
Re-enable fast stepping for arm targets.  The issue being worked
around was fixed in llvm commit r186846.
<rdar://problem/14489274>

llvm-svn: 187620

10 years agoUse llvm::sys::fs::UniqueID for windows and unix.
Rafael Espindola [Thu, 1 Aug 2013 21:42:11 +0000 (21:42 +0000)]
Use llvm::sys::fs::UniqueID for windows and unix.

This unifies the unix and windows versions of FileManager::UniqueDirContainer
and FileManager::UniqueFileContainer by using UniqueID.

We cannot just replace "struct stat" with llvm::sys::fs::file_status, since we
want to be able to construct fake ones, and file_status has different members
on unix and windows.

What the patch does is:

* Record only the information that clang is actually using.
* Use llvm::sys::fs::status instead of stat and fstat.
* Use llvm::sys::fs::UniqueID
* Delete the old windows versions of UniqueDirContainer and
UniqueFileContainer since the "unix" one now works on windows too.

llvm-svn: 187619

10 years agoUse function attributes to indicate that we don't want to realign the stack.
Bill Wendling [Thu, 1 Aug 2013 21:42:05 +0000 (21:42 +0000)]
Use function attributes to indicate that we don't want to realign the stack.

Function attributes are the future! So just query whether we want to realign the
stack directly from the function instead of through a random target options
structure.

llvm-svn: 187618

10 years agoUse function attributes to indicate if we don't want to realign the stack.
Bill Wendling [Thu, 1 Aug 2013 21:41:02 +0000 (21:41 +0000)]
Use function attributes to indicate if we don't want to realign the stack.

llvm-svn: 187617

10 years agoExpose that the unique file ID has a device and a file component.
Rafael Espindola [Thu, 1 Aug 2013 21:36:02 +0000 (21:36 +0000)]
Expose that the unique file ID has a device and a file component.

The use of sd_dev and st_ino has reached libclang, so expose the two components
in UniqueID so that we can use it in clang.

llvm-svn: 187616

10 years agoFixed the Intel-syntax X86 disassembler to respect the (existing) option for hexadeci...
Daniel Malea [Thu, 1 Aug 2013 21:18:16 +0000 (21:18 +0000)]
Fixed the Intel-syntax X86 disassembler to respect the (existing) option for hexadecimal immediates, to match AT&T syntax. This also brings a new option for C-vs-MASM-style hex.

Patch by Richard Mitton
Reviewed: http://llvm-reviews.chandlerc.com/D1243

llvm-svn: 187614

10 years agoFix some issues with Mips16 floating when certain intrinsics are present.
Reed Kotler [Thu, 1 Aug 2013 21:17:53 +0000 (21:17 +0000)]
Fix some issues with Mips16 floating when certain intrinsics are present.
This is actually an LLVM bug in the way it generates signatures for these
when soft float is enabled. For example, floor ends up having the signature
of int64(int64). The signature part is not the same as where the actual
parameter types are recorded, and those ARE of course int64(int64) when
soft float is enabled. (Yes, Mips16 hard float uses soft float but with
different runtime rounes but then has to interoperate with Mips32 using
normal floating point). This logic will eventually be moved to the
Mips16HardFloat pass so it's not worth sorting out these issues in LLVM
since nobody but Mips16 cares about these signatures, as far as I know,
and even I won't eventually either.

llvm-svn: 187613

10 years agoDebugInfo: Don't prefer declarations over definitions in -flimit-debug-info in C
David Blaikie [Thu, 1 Aug 2013 20:57:40 +0000 (20:57 +0000)]
DebugInfo: Don't prefer declarations over definitions in -flimit-debug-info in C

Without an ODR, the -flimit-debug-info debug info size optimization of
emitting declarations for fully defined types when only a declaration is
needed by the TU, is incorrect. Emit the full definition whenever it's
available in non-C++.

llvm-svn: 187611

10 years agoARM/Hexagon testcases can't compile x86 only testcase. Reverting change to testcase...
Carlo Kok [Thu, 1 Aug 2013 20:53:57 +0000 (20:53 +0000)]
ARM/Hexagon testcases can't compile x86 only testcase. Reverting change to testcase & fixing check for all.

llvm-svn: 187610

10 years agoDebug Info Finder|Verifier: handle DbgLoc attached to instructions.
Manman Ren [Thu, 1 Aug 2013 20:52:39 +0000 (20:52 +0000)]
Debug Info Finder|Verifier: handle DbgLoc attached to instructions.

Also remove checking of llvm.dbg.sp since it is not used in generating dwarf.

Current state of Finder:
DebugInfoFinder tries to list all debug info MDNodes used in a module. To
list debug info MDNodes used by an instruction, DebugInfoFinder provides
processDeclare, processValue and processLocation to handle DbgDeclareInst,
DbgValueInst and DbgLoc attached to instructions. processModule will go
through all DICompileUnits in llvm.dbg.cu and list debug info MDNodes
used by the CUs.

TODO:
1> Finder has a list of CUs, SPs, Types, Scopes and global variables. We
need to add a list of variables that are used by DbgDeclareInst and
DbgValueInst.
2> MDString fields should be null or isa<MDString> and MDNode fields should be
null or isa<MDNode>. We currently use empty string or int 0 to represent null.
3> Go though Verify functions and make sure that they check field types.
4> Clean up existing testing cases to remove llvm.dbg.sp and make sure each
testing case has a llvm.dbg.cu.

llvm-svn: 187609

10 years agoDebugInfo: Emit template arguments for limited types used for context.
David Blaikie [Thu, 1 Aug 2013 20:31:40 +0000 (20:31 +0000)]
DebugInfo: Emit template arguments for limited types used for context.

We emit definitions with no members when a nested type is
referenced/required (GCC does the same, to be fair) but failed to attach
the template arguments in such a case.

llvm-svn: 187608

10 years agoDebugInfo: Emit definitions for types with no members.
David Blaikie [Thu, 1 Aug 2013 20:30:22 +0000 (20:30 +0000)]
DebugInfo: Emit definitions for types with no members.

The absence of members was a poor/incorrect proxy for "is definition".

llvm-svn: 187607

10 years agochange the inlinefnlocalvar testcase so it uses a triple that's not coff (doesn't...
Carlo Kok [Thu, 1 Aug 2013 20:17:37 +0000 (20:17 +0000)]
change the inlinefnlocalvar testcase so it uses a triple that's not coff (doesn't seem to matter for the testcase itself, what it tests isn't triple specific), as coff has a slightly different way of emitting what it checks for.

llvm-svn: 187604

10 years agoDisable test on Mac OS X due to llvm.org/pr16769
Daniel Malea [Thu, 1 Aug 2013 20:03:36 +0000 (20:03 +0000)]
Disable test on Mac OS X due to llvm.org/pr16769

llvm-svn: 187603

10 years agoOptions.td: O0 and O4 are not Joined options
Hans Wennborg [Thu, 1 Aug 2013 19:46:33 +0000 (19:46 +0000)]
Options.td: O0 and O4 are not Joined options

(I'm not sure how to test this because the Driver will still accept
 e.g. "-O4foo", but it goes in the catch-all -O option instead of -O4.)

llvm-svn: 187602

10 years agoTemporarily xfail a test that breaks on OS X when building with LTO.
Bob Wilson [Thu, 1 Aug 2013 19:29:26 +0000 (19:29 +0000)]
Temporarily xfail a test that breaks on OS X when building with LTO.

This is another case where internalize hides a symbol that is needed by
a loadable module.  I am currently investigating a proper fix but this patch
will get our buildbot to pass in the meantime. <rdar://problem/14578094>

llvm-svn: 187601

10 years agoUpdates TestLongjump to ensure that compiler optimizations don't affect the
Ashok Thirumurthi [Thu, 1 Aug 2013 18:52:01 +0000 (18:52 +0000)]
Updates TestLongjump to ensure that compiler optimizations don't affect the
mapping of source to assembly so that the same test script can be used
with more compilers.

Patch by Andy Kaylor!

Also marks the LLDB test of template parameters as xfail on icc.

llvm-svn: 187600

10 years agoFix Linux Host::GetCurrentThreadID() to return real tid (not pthread_t).
Michael Sartain [Thu, 1 Aug 2013 18:51:08 +0000 (18:51 +0000)]
Fix Linux Host::GetCurrentThreadID() to return real tid (not pthread_t).
This fixes threadname logging (--thread-name)
Add "-t" to TestLogging.py script to enable threadsafe and disable threadname logging

llvm-svn: 187599

10 years agoUpdate incorrect file headers.
Sean Silva [Thu, 1 Aug 2013 18:42:28 +0000 (18:42 +0000)]
Update incorrect file headers.

One of these was spotted in review by Rafael.

llvm-svn: 187598

10 years agoBugfix for making the DWARF debug strings and labels to code emitted as secrel32...
Carlo Kok [Thu, 1 Aug 2013 18:38:14 +0000 (18:38 +0000)]
Bugfix for making the DWARF debug strings and labels to code emitted as secrel32 instead of long opcodes (only for coff). This makes them debuggable with GDB.

fixes Bug 16249 - LLVM generates broken debug info on Windows

llvm-svn: 187597

10 years agoEnable the SLP-vectorizer by default
Nadav Rotem [Thu, 1 Aug 2013 18:28:23 +0000 (18:28 +0000)]
Enable the SLP-vectorizer by default

llvm-svn: 187596

10 years agoOnly enable SLP-vectorization on O3 builds.
Nadav Rotem [Thu, 1 Aug 2013 18:28:15 +0000 (18:28 +0000)]
Only enable SLP-vectorization on O3 builds.

llvm-svn: 187595

10 years agoReduce a variable's scope (no functionality change)
David Blaikie [Thu, 1 Aug 2013 18:23:24 +0000 (18:23 +0000)]
Reduce a variable's scope (no functionality change)

llvm-svn: 187594

10 years agoNico Rieck: Currently _MSC_VER and _WIN32 are used to guard code which is
Howard Hinnant [Thu, 1 Aug 2013 18:17:34 +0000 (18:17 +0000)]
Nico Rieck:  Currently _MSC_VER and _WIN32 are used to guard code which is
MSVC-specific, MSVCRT-specific, or Windows-specific. Because Clang can
also define _MSC_VER, and MSVCRT is not necessarily the only C runtime,
these macros should not be used interchangeably.

This patch divides all Windows-related bits into the aforementioned
categories. Two new macros are introduced:

- _LIBCPP_MSVC: Defined when compiling with MSVC. Detected using
  _MSC_VER, excluding Clang.
- _LIBCPP_MSVCRT: Defined when using the Microsoft CRT. This is the default
   when _WIN32 is defined.

This leaves _WIN32 for code using the Windows API.

This also corrects the spelling of _LIBCP_HAS_IS_BASE_OF to _LIBCPP_HAS_IS_BASE_OF.

Nico, please prepare a patch for CREDITS.TXT, thanks.

llvm-svn: 187593

10 years agoSimplify git-clang-format by using new -lines option.
Daniel Jasper [Thu, 1 Aug 2013 18:17:13 +0000 (18:17 +0000)]
Simplify git-clang-format by using new -lines option.

Patch by Mark Lodato. Thank you!

llvm-svn: 187592

10 years agoPass -G argument to cmake with the same generator's name as used for the
Simon Atanasyan [Thu, 1 Aug 2013 18:04:07 +0000 (18:04 +0000)]
Pass -G argument to cmake with the same generator's name as used for the
initial cmake invocation.

Patch reviewed by Reid Kleckner.

llvm-svn: 187591

10 years agoAllow test categories to be skipped.
Stefanus Du Toit [Thu, 1 Aug 2013 17:59:20 +0000 (17:59 +0000)]
Allow test categories to be skipped.

This adds a new parameter, --skip-category, that can be used to list
categories that should be skipped. For example, to run all tests except for
Objective-C ones, one can now write:

  ./dotest.py --skip-category objc [...]

llvm-svn: 187590

10 years agoTeach clang-format to understand static_asserts better.
Daniel Jasper [Thu, 1 Aug 2013 17:58:23 +0000 (17:58 +0000)]
Teach clang-format to understand static_asserts better.

Before:
  template <bool B, bool C>
  class A {
    static_assert(B &&C, "Something is wrong");
  };

After:
  template <bool B, bool C>
  class A {
    static_assert(B && C, "Something is wrong");
  };

(Note the spacing around '&&'). Also change the identifier table to always
understand all C++11 keywords (which seems like the right thing to do).

llvm-svn: 187589

10 years agoFix typo in comment.
Joey Gouly [Thu, 1 Aug 2013 17:54:08 +0000 (17:54 +0000)]
Fix typo in comment.

Thanks Artyom Skrobov!

llvm-svn: 187588

10 years agoTaking another swing at correctly optimizing fill_n.
Howard Hinnant [Thu, 1 Aug 2013 17:29:28 +0000 (17:29 +0000)]
Taking another swing at correctly optimizing fill_n.

llvm-svn: 187587

10 years agoAST: Treat inline function declarations in -fms-compatibility as if it were in C...
David Majnemer [Thu, 1 Aug 2013 17:26:42 +0000 (17:26 +0000)]
AST: Treat inline function declarations in -fms-compatibility as if it were in C++ when in C mode

This essentially fixes PR16766.

llvm-svn: 187586

10 years agoUpdate failing tests on Linux for clang and gcc to only fail on Linux instead of...
Matt Kopec [Thu, 1 Aug 2013 17:22:24 +0000 (17:22 +0000)]
Update failing tests on Linux for clang and gcc to only fail on Linux instead of all platforms.

Thanks Stefanus!

llvm-svn: 187585

10 years agoremove executable permission from IntrinsicsXCore.td
Robert Lytton [Thu, 1 Aug 2013 17:17:59 +0000 (17:17 +0000)]
remove executable permission from IntrinsicsXCore.td

llvm-svn: 187584

10 years agoOptions: Use AliasArgs for -O -> -O2 translation.
Hans Wennborg [Thu, 1 Aug 2013 16:21:57 +0000 (16:21 +0000)]
Options: Use AliasArgs for -O -> -O2 translation.

This way we can do the translation in the .td file rather than manually.

llvm-svn: 187583

10 years agoR600: Add 64-bit float load/store support
Tom Stellard [Thu, 1 Aug 2013 15:23:42 +0000 (15:23 +0000)]
R600: Add 64-bit float load/store support

* Added R600_Reg64 class
* Added T#Index#.XY registers definition
* Added v2i32 register reads from parameter and global space
* Added f32 and i32 elements extraction from v2f32 and v2i32
* Added v2i32 -> v2f32 conversions

Tom Stellard:
  - Mark vec2 operations as expand.  The addition of a vec2 register
    class made them all legal.

Patch by: Dmitry Cherkassov

Signed-off-by: Dmitry Cherkassov <dcherkassov@gmail.com>
llvm-svn: 187582

10 years agoR600: Use 64-bit alignment for 64-bit kernel arguments
Tom Stellard [Thu, 1 Aug 2013 15:23:31 +0000 (15:23 +0000)]
R600: Use 64-bit alignment for 64-bit kernel arguments

llvm-svn: 187581

10 years agoR600/SI: Custom lower i64 ZERO_EXTEND
Tom Stellard [Thu, 1 Aug 2013 15:23:26 +0000 (15:23 +0000)]
R600/SI: Custom lower i64 ZERO_EXTEND

llvm-svn: 187580

10 years ago[lsan] Add leak_check_at_exit flag.
Sergey Matveev [Thu, 1 Aug 2013 14:57:07 +0000 (14:57 +0000)]
[lsan] Add leak_check_at_exit flag.

We needed a way to tell LSan to invoke leak checking only if __do_leak_check()
is called explicitly. This can now be achieved by setting
leak_check_at_exit=false.

llvm-svn: 187578

10 years agoclang-format: Improve line breaks in @property.
Daniel Jasper [Thu, 1 Aug 2013 13:46:58 +0000 (13:46 +0000)]
clang-format: Improve line breaks in @property.

Before:
  @property(nonatomic, assign,
            readonly) NSString *looooooooooooooooooooooooooooongName;

After:
  @property(nonatomic, assign, readonly)
      NSString *looooooooooooooooooooooooooooongName;

llvm-svn: 187577

10 years agoEVEX and compressed displacement encoding for AVX512
Elena Demikhovsky [Thu, 1 Aug 2013 13:34:06 +0000 (13:34 +0000)]
EVEX and compressed displacement encoding for AVX512

llvm-svn: 187576

10 years ago[msan] Intercept setenv, putenv.
Evgeniy Stepanov [Thu, 1 Aug 2013 11:14:14 +0000 (11:14 +0000)]
[msan] Intercept setenv, putenv.

llvm-svn: 187575

10 years agoMake helper function static.
Benjamin Kramer [Thu, 1 Aug 2013 11:08:06 +0000 (11:08 +0000)]
Make helper function static.

llvm-svn: 187574

10 years ago[SystemZ] Reuse CC results for integer comparisons with zero
Richard Sandiford [Thu, 1 Aug 2013 10:39:40 +0000 (10:39 +0000)]
[SystemZ] Reuse CC results for integer comparisons with zero

This also fixes a bug in the predication of LR to LOCR: I'd forgotten
that with these in-place instruction builds, the implicit operands need
to be added manually.  I think this was latent until now, but is tested
by int-cmp-45.c.  It also adds a CC valid mask to STOC, again tested by
int-cmp-45.c.

llvm-svn: 187573

10 years agoSilence unused variable warning in non-assert builds.
Daniel Jasper [Thu, 1 Aug 2013 10:30:11 +0000 (10:30 +0000)]
Silence unused variable warning in non-assert builds.

llvm-svn: 187572

10 years ago[SystemZ] Prefer comparisons with zero
Richard Sandiford [Thu, 1 Aug 2013 10:29:45 +0000 (10:29 +0000)]
[SystemZ] Prefer comparisons with zero

Convert >= 1 to > 0, etc.  Using comparison with zero isn't a win on its own,
but it exposes more opportunities for CC reuse (the next patch).

llvm-svn: 187571

10 years agoAdd tests for Mips DSP instructions.
Vladimir Medic [Thu, 1 Aug 2013 09:35:25 +0000 (09:35 +0000)]
Add tests for Mips DSP instructions.

llvm-svn: 187570

10 years agoMoving definition of MnemonicContainsDot field from class Instruction to class AsmPar...
Vladimir Medic [Thu, 1 Aug 2013 09:25:27 +0000 (09:25 +0000)]
Moving definition of MnemonicContainsDot field from class Instruction to class AsmParser as suggested.

llvm-svn: 187569

10 years agoAArch64: initial NEON support
Tim Northover [Thu, 1 Aug 2013 09:23:19 +0000 (09:23 +0000)]
AArch64: initial NEON support

Patch by Ana Pazos

- Completed implementation of instruction formats:
AdvSIMD three same
AdvSIMD modified immediate
AdvSIMD scalar pairwise

- Completed implementation of instruction classes
(some of the instructions in these classes
belong to yet unfinished instruction formats):
Vector Arithmetic
Vector Immediate
Vector Pairwise Arithmetic

- Initial implementation of instruction formats:
AdvSIMD scalar two-reg misc
AdvSIMD scalar three same

- Intial implementation of instruction class:
Scalar Arithmetic

- Initial clang changes to support arm v8 intrinsics.
Note: no clang changes for scalar intrinsics function name mangling yet.

- Comprehensive test cases for added instructions
To verify auto codegen, encoding, decoding, diagnosis, intrinsics.

llvm-svn: 187568

10 years agoAArch64: add initial NEON support
Tim Northover [Thu, 1 Aug 2013 09:20:35 +0000 (09:20 +0000)]
AArch64: add initial NEON support

Patch by Ana Pazos.

- Completed implementation of instruction formats:
AdvSIMD three same
AdvSIMD modified immediate
AdvSIMD scalar pairwise

- Completed implementation of instruction classes
(some of the instructions in these classes
belong to yet unfinished instruction formats):
Vector Arithmetic
Vector Immediate
Vector Pairwise Arithmetic

- Initial implementation of instruction formats:
AdvSIMD scalar two-reg misc
AdvSIMD scalar three same

- Intial implementation of instruction class:
Scalar Arithmetic

- Initial clang changes to support arm v8 intrinsics.
Note: no clang changes for scalar intrinsics function name mangling yet.

- Comprehensive test cases for added instructions
To verify auto codegen, encoding, decoding, diagnosis, intrinsics.

llvm-svn: 187567

10 years agoXCore target: add GCCBuiltin to four intrinsics
Robert Lytton [Thu, 1 Aug 2013 08:41:32 +0000 (08:41 +0000)]
XCore target: add GCCBuiltin to four intrinsics

The following are made available by clang in the XCore ABI
__builtin_bitrev
__builtin_getid
__builtin_getps
__builtin_setps

llvm-svn: 187566

10 years agoXCore target: Fix Vararg handling
Robert Lytton [Thu, 1 Aug 2013 08:29:44 +0000 (08:29 +0000)]
XCore target: Fix Vararg handling

llvm-svn: 187565

10 years agoCheck dynamic_cast is not used with -fno-rtti, unless it is a noop or can be resolved...
Arnaud A. de Grandmaison [Thu, 1 Aug 2013 08:28:32 +0000 (08:28 +0000)]
Check dynamic_cast is not used with -fno-rtti, unless it is a noop or can be resolved statically.

llvm-svn: 187564

10 years agoXCore target: Add byval handling
Robert Lytton [Thu, 1 Aug 2013 08:18:55 +0000 (08:18 +0000)]
XCore target: Add byval handling

llvm-svn: 187563

10 years agoXcore target
Robert Lytton [Thu, 1 Aug 2013 07:52:05 +0000 (07:52 +0000)]
Xcore target
Fix emitArrayBound() calling OutStreamer.Emit*() multiple times when trying to print a single line

llvm-svn: 187562

10 years agoRemove more odd code that tries to account for an off by 1 problem in vec3 shuffles...
Craig Topper [Thu, 1 Aug 2013 06:59:29 +0000 (06:59 +0000)]
Remove more odd code that tries to account for an off by 1 problem in vec3 shuffles that doesn't really exist.

llvm-svn: 187561

10 years agoFix to handle all non-power-of-2 vector sizes in the mask form of _builtin_shuffle_ve...
Craig Topper [Thu, 1 Aug 2013 06:42:40 +0000 (06:42 +0000)]
Fix to handle all non-power-of-2 vector sizes in the mask form of _builtin_shuffle_vector.

Previously a 2-bit mask was used to mask each element of a vec6 mask before doing the extracts instead of 3-bit mask necessary to cover 0-5. vec3 was the only non-power-of-2 that worked correctly because a +1 conditionally added before calculating floor(log2(elements)).

llvm-svn: 187560

10 years agoSema: Diagnose explicitly bound unresolved member expressions decaying into pointers...
David Majnemer [Thu, 1 Aug 2013 06:13:59 +0000 (06:13 +0000)]
Sema: Diagnose explicitly bound unresolved member expressions decaying into pointers to function type

We would disallow the case where the overloaded member expression is
coming from an address-of operator but we wouldn't issue any diagnostics
when the overloaded member expression comes by way of a function to
pointer decay cast.

Clang's implementation of DR61 is now seemingly complete.

llvm-svn: 187559

10 years agoRemove broken and unnecessary vec3 handling from VisitShuffleVectorExpr.
Craig Topper [Thu, 1 Aug 2013 04:51:48 +0000 (04:51 +0000)]
Remove broken and unnecessary vec3 handling from VisitShuffleVectorExpr.

llvm-svn: 187558

10 years agoParse: Don't consider attributes of broken member declarators
David Majnemer [Thu, 1 Aug 2013 04:22:55 +0000 (04:22 +0000)]
Parse: Don't consider attributes of broken member declarators

ParseCXXClassMemberDeclaration was trying to use the result of
ActOnCXXMemberDeclarator to attach it to some late parsed attributes.

However when failures arise, we have no decl to attach to which
eventually leads us to a NULL pointer dereference.

While we are here, clean up the code a bit.

Fixes PR16765

llvm-svn: 187557

10 years agoFix assert when instantiating a default argument of a template defined in a
Richard Smith [Thu, 1 Aug 2013 04:12:04 +0000 (04:12 +0000)]
Fix assert when instantiating a default argument of a template defined in a
module.

llvm-svn: 187556

10 years agoFix some misc. issues with Mips16 fp stubs.
Reed Kotler [Thu, 1 Aug 2013 02:26:31 +0000 (02:26 +0000)]
Fix some misc. issues with Mips16 fp stubs.
1) They should never be inlined.
2) A naming inconsistency with gcc mips16
3) Stubs should not have the global attribute

llvm-svn: 187555

10 years agoFormatting.
Eric Christopher [Thu, 1 Aug 2013 01:38:16 +0000 (01:38 +0000)]
Formatting.

llvm-svn: 187554

10 years agoAdd an omitted IsCall=1.
Reed Kotler [Thu, 1 Aug 2013 00:59:06 +0000 (00:59 +0000)]
Add an omitted IsCall=1.

llvm-svn: 187553

10 years agoConstrain fill_n -> memset operations to include implicit convertibility to unsigned...
Howard Hinnant [Thu, 1 Aug 2013 00:41:55 +0000 (00:41 +0000)]
Constrain fill_n -> memset operations to include implicit convertibility to unsigned char.  This fixes llvm.org/bugs/show_bug.cgi?id=16764.  Also a drive-by fix on a chrono test suite bug.

llvm-svn: 187552

10 years agoRemove the SUPPORT_ALIASARGS define
Hans Wennborg [Thu, 1 Aug 2013 00:12:38 +0000 (00:12 +0000)]
Remove the SUPPORT_ALIASARGS define

It is not needed after LLVM r187546.

llvm-svn: 187551

10 years agoRemove the SUPPORT_ALIASARGS define
Hans Wennborg [Thu, 1 Aug 2013 00:12:13 +0000 (00:12 +0000)]
Remove the SUPPORT_ALIASARGS define

It is not needed after LLVM r187546.

llvm-svn: 187550

10 years agoclang-format: Make alignment of trailing comments optional ..
Daniel Jasper [Wed, 31 Jul 2013 23:55:15 +0000 (23:55 +0000)]
clang-format: Make alignment of trailing comments optional ..

.. in order to support WebKit style properly.

llvm-svn: 187549

10 years agoUse StringRef::equals_lower(). No functionality change.
Rui Ueyama [Wed, 31 Jul 2013 23:53:58 +0000 (23:53 +0000)]
Use StringRef::equals_lower(). No functionality change.

llvm-svn: 187548

10 years agoMake -m[no-]pascal-strings an alias of -f[no]pascal-strings in the .td file
Hans Wennborg [Wed, 31 Jul 2013 23:39:13 +0000 (23:39 +0000)]
Make -m[no-]pascal-strings an alias of -f[no]pascal-strings in the .td file

This way we don't have to translate it manually in Clang::ConstructJob.

Differential Revision: http://llvm-reviews.chandlerc.com/D1249

llvm-svn: 187547

10 years agoOption parsing: remove non-SUPPORT_ALIASARGS fall-back
Hans Wennborg [Wed, 31 Jul 2013 23:28:51 +0000 (23:28 +0000)]
Option parsing: remove non-SUPPORT_ALIASARGS fall-back

The clients of this code have been updated to all support AliasArgs.

This depends on Clang r187538 and lld r187541.

llvm-svn: 187546

10 years agoFix thread name updating in Linux. "thread list" should report correct names always...
Michael Sartain [Wed, 31 Jul 2013 23:27:46 +0000 (23:27 +0000)]
Fix thread name updating in Linux. "thread list" should report correct names always now.
Created new LinuxThread class inherited from POSIXThread and removed linux / freebsd ifdefs
Removed several un-needed set thread name calls

CR (and multiple suggestions): mkopec

llvm-svn: 187545

10 years ago[PECOFF][Driver] Prefer "/" over "-" as the indicator of the option.
Rui Ueyama [Wed, 31 Jul 2013 23:23:25 +0000 (23:23 +0000)]
[PECOFF][Driver] Prefer "/" over "-" as the indicator of the option.

This patch does not change the behavior of LLD, but changes the output of the
help text. We want to show the help text with Windows style indicator rather
than Unix style indicator.

llvm-svn: 187544

10 years agoObjectiveC ARC: finishing off issuing error when
Fariborz Jahanian [Wed, 31 Jul 2013 23:19:34 +0000 (23:19 +0000)]
ObjectiveC ARC: finishing off issuing error when
retainable pointer is passed to an audited CF function
expecting CF type. // rdar://14569171

llvm-svn: 187543

10 years agoOptimize Host::GetThreadName() to read from /proc/$TID per Matt's suggestion.
Michael Sartain [Wed, 31 Jul 2013 23:19:14 +0000 (23:19 +0000)]
Optimize Host::GetThreadName() to read from /proc/$TID per Matt's suggestion.

CR: mkopec
llvm-svn: 187542

10 years agoOption parsing tables: pick up AliasArgs from the OPTION macro.
Hans Wennborg [Wed, 31 Jul 2013 23:17:41 +0000 (23:17 +0000)]
Option parsing tables: pick up AliasArgs from the OPTION macro.

This depends on LLVM r187537.

The SUPPORT_ALIASARGS macro will be removed once all option parsing
clients have been updated.

llvm-svn: 187541

10 years agoclang-format: Add more options to namespace indentation.
Daniel Jasper [Wed, 31 Jul 2013 23:16:02 +0000 (23:16 +0000)]
clang-format: Add more options to namespace indentation.

With this patch, clang-format can be configured to:
* not indent in namespace at all (former behavior).
* indent in namespace as in other blocks.
* indent only in inner namespaces (as required by WebKit style).

Also fix alignment of access specifiers in WebKit style.

Patch started by Marek Kurdej. Thank you!

llvm-svn: 187540

10 years ago[PECOFF][Driver] Rewrite the tablegen def file using multiclass to remove duplicates.
Rui Ueyama [Wed, 31 Jul 2013 23:12:06 +0000 (23:12 +0000)]
[PECOFF][Driver] Rewrite the tablegen def file using multiclass to remove duplicates.

llvm-svn: 187539

10 years agoOption parsing tables: pick up AliasArgs from the OPTION macro.
Hans Wennborg [Wed, 31 Jul 2013 23:07:21 +0000 (23:07 +0000)]
Option parsing tables: pick up AliasArgs from the OPTION macro.

This depends on LLVM r187537.

The SUPPORT_ALIASARGS macro will be removed once all option parsing
clients have been updated.

llvm-svn: 187538

10 years agoOption parsing: add support for alias arguments.
Hans Wennborg [Wed, 31 Jul 2013 22:44:41 +0000 (22:44 +0000)]
Option parsing: add support for alias arguments.

This makes option aliases more powerful by enabling them to
pass along arguments to the option they're aliasing.

For example, if we have a joined option "-foo=", we can now
specify a flag option "-bar" to be an alias of that, with the
argument "baz".

This is especially useful for the cl.exe compatible clang driver,
where many options are aliases. For example, this patch enables
us to alias "/Ox" to "-O3" (-O is a joined option), and "/WX" to
"-Werror" (again, -W is a joined option).

Differential Revision: http://llvm-reviews.chandlerc.com/D1245

llvm-svn: 187537

10 years agoRemove dead #includes.
Hans Wennborg [Wed, 31 Jul 2013 22:28:46 +0000 (22:28 +0000)]
Remove dead #includes.

llvm-svn: 187536

10 years ago80-col
Nadav Rotem [Wed, 31 Jul 2013 22:17:45 +0000 (22:17 +0000)]
80-col

llvm-svn: 187535

10 years agoRevert "[PECOFF][Driver] Remove quotes from command line arguments."
Rui Ueyama [Wed, 31 Jul 2013 22:13:15 +0000 (22:13 +0000)]
Revert "[PECOFF][Driver] Remove quotes from command line arguments."

This reverts commit r187390 because we should not handle argv's quotes ourselves.

In Windows, unlike Unix, quotes are not processed by the shell. Instead the C
startup routine parses it as described in
http://msdn.microsoft.com/en-us/library/a1y7w461.aspx and pass the results to
main(). So, at the time when the control reaches main(), quotes that should be
removed has already been removed.

We still need to handle quotes in the response file and in .drectve section
ourselves. That will be addressed in different patches.

llvm-svn: 187534

10 years agoMark some tests as explicitly failing on clang/gcc as they pass on icc.
Matt Kopec [Wed, 31 Jul 2013 21:52:25 +0000 (21:52 +0000)]
Mark some tests as explicitly failing on clang/gcc as they pass on icc.
Also, rework the signed types test to check for signed or char type in the output as char is signed by default.

llvm-svn: 187533

10 years agoObjectiveC ARC: Do not issue bridge cast diagnostic when
Fariborz Jahanian [Wed, 31 Jul 2013 21:40:51 +0000 (21:40 +0000)]
ObjectiveC ARC: Do not issue bridge cast diagnostic when
passing a retainable object arg to a CF audited function
expecting a CF object type. Issue a normal type mismatch
diagnostic. This is wip // rdar://14569171

llvm-svn: 187532

10 years agocomment typo.
Andrew Trick [Wed, 31 Jul 2013 21:05:54 +0000 (21:05 +0000)]
comment typo.

llvm-svn: 187531

10 years agoAdded the B9.3.19 SUBS PC, LR, #imm (Thumb2) system instruction.
Kevin Enderby [Wed, 31 Jul 2013 21:05:30 +0000 (21:05 +0000)]
Added the B9.3.19 SUBS PC, LR, #imm (Thumb2) system instruction.
While the .td entry is nice and all, it takes a pretty gross hack in
ARMAsmParser::ParseInstruction() because of handling of other "subs"
instructions to get it to match.  Ran it by Jim Grosbach and he said it was
about what he expected to make this work given the existing code.

rdar://14214063

llvm-svn: 187530