platform/upstream/llvm.git
9 years agoMRI scripts: Add addlib support.
Rafael Espindola [Tue, 21 Oct 2014 23:18:51 +0000 (23:18 +0000)]
MRI scripts: Add addlib support.

llvm-svn: 220346

9 years agoLTO: respect command-line options that disable vectorization.
JF Bastien [Tue, 21 Oct 2014 23:18:21 +0000 (23:18 +0000)]
LTO: respect command-line options that disable vectorization.

Summary: Patches 202051 and 208013 added calls to LTO's PassManager which unconditionally add LoopVectorizePass and SLPVectorizerPass instead of following the logic in PassManagerBuilder::populateModulePassManager and honoring the -vectorize-loops -run-slp-after-loop-vectorization flags.

Reviewers: nadav, aschwaighofer, yijiang

Subscribers: llvm-commits

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

llvm-svn: 220345

9 years agoUse a range loop. NFC.
Rafael Espindola [Tue, 21 Oct 2014 23:04:55 +0000 (23:04 +0000)]
Use a range loop. NFC.

llvm-svn: 220344

9 years agoPR21327 / C++ DR1652 / C++ DR73: comparing a past-the-end pointer for one
Richard Smith [Tue, 21 Oct 2014 23:01:04 +0000 (23:01 +0000)]
PR21327 / C++ DR1652 / C++ DR73: comparing a past-the-end pointer for one
complete object to a pointer to the start of another complete object does
not evaluate to the constant 'false'. All other comparisons between the
addresses of subobjects of distinct complete objects still do.

llvm-svn: 220343

9 years agoAdd minnum / maxnum codegen
Matt Arsenault [Tue, 21 Oct 2014 23:01:01 +0000 (23:01 +0000)]
Add minnum / maxnum codegen

llvm-svn: 220342

9 years agoAdd minnum / maxnum intrinsics
Matt Arsenault [Tue, 21 Oct 2014 23:00:20 +0000 (23:00 +0000)]
Add minnum / maxnum intrinsics

These are named following the IEEE-754 names for these
functions, rather than the libm fmin / fmax to avoid
possible ambiguities. Some languages may implement something
resembling fmin / fmax which return NaN if either operand is
to propagate errors. These implement the IEEE-754 semantics
of returning the other operand if either is a NaN representing
missing data.

llvm-svn: 220341

9 years agoIR: Reorder metadata bitcode serialization, NFC
Duncan P. N. Exon Smith [Tue, 21 Oct 2014 22:27:47 +0000 (22:27 +0000)]
IR: Reorder metadata bitcode serialization, NFC

Enumerate `MDNode`'s operands *before* the node itself, so that the
reader requires less RAUW.  Although this will cause different code
paths to be hit in the reader, this should effectively be no
functionality change.

llvm-svn: 220340

9 years agoR600: Update for div_fmas intrinsic change
Matt Arsenault [Tue, 21 Oct 2014 22:21:41 +0000 (22:21 +0000)]
R600: Update for div_fmas intrinsic change

llvm-svn: 220339

9 years agoR600/SI: Add missing parameter to div_fmas intrinsic
Matt Arsenault [Tue, 21 Oct 2014 22:20:55 +0000 (22:20 +0000)]
R600/SI: Add missing parameter to div_fmas intrinsic

llvm-svn: 220338

9 years agoIR: Remove dead code in metadata bitcode writing, NFC
Duncan P. N. Exon Smith [Tue, 21 Oct 2014 22:13:34 +0000 (22:13 +0000)]
IR: Remove dead code in metadata bitcode writing, NFC

No one cares how many uses each metadata value has, so don't bother
counting.

llvm-svn: 220337

9 years agoOverwrite instead of adding to archives when creating them in mri scripts.
Rafael Espindola [Tue, 21 Oct 2014 21:56:47 +0000 (21:56 +0000)]
Overwrite instead of adding to archives when creating them in mri scripts.

This matches the behavior of GNU ar and also makes it easier to implemnt
support for the addlib command.

llvm-svn: 220336

9 years agoPacify bots and simplify r220321
Arnaud A. de Grandmaison [Tue, 21 Oct 2014 21:50:49 +0000 (21:50 +0000)]
Pacify bots and simplify r220321

llvm-svn: 220335

9 years agoConvert a few std::string with StringRef. NFC.
Rafael Espindola [Tue, 21 Oct 2014 21:47:27 +0000 (21:47 +0000)]
Convert a few std::string with StringRef. NFC.

This is a micro optimization, but also makes the code a bit more flexible.

The MRIMembers variable is a short term hack. It is going away in the next
commit.

llvm-svn: 220334

9 years ago[PECOFF] Fix exported symbol in the import library
Rui Ueyama [Tue, 21 Oct 2014 21:41:28 +0000 (21:41 +0000)]
[PECOFF] Fix exported symbol in the import library

There are two ways to specify a symbol to be exported in the module
definition file.

1) EXPORT <external name> = <symbol>
2) EXPORT <symbol>

In (1), you give both external name and internal name. In that case,
the linker tries to find a symbol using the internal name, and write
that address to the export table with the external name. Thus, from
the outer world, the symbol seems to be exported as the external name.

In (2), internal name is basically the same as the external name
with an exception: if you give an undecorated symbol to the EXPORT
directive, and if the linker finds a decorated symbol, the external
name for the symbol will become the decorated symbol.

LLD didn't implement that exception correctly. This patch fixes that.

llvm-svn: 220333

9 years agoGCC has supported C++11 ref-qualifiers since 4.8.1
Reid Kleckner [Tue, 21 Oct 2014 21:15:45 +0000 (21:15 +0000)]
GCC has supported C++11 ref-qualifiers since 4.8.1

This requires incorporating __GNUC_PATCHLEVEL__ into our prerequisite
check, and renaming our __GNUC_PREREQ to LLVM_GNUC_PREREQ, since it is
now functionally different.

Patch by Chilledheart!

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

llvm-svn: 220332

9 years ago[modules] When building an injected-class-name type, we may have to insert it
Richard Smith [Tue, 21 Oct 2014 21:15:18 +0000 (21:15 +0000)]
[modules] When building an injected-class-name type, we may have to insert it
into multiple merged classes' TypeForDecl slots.

llvm-svn: 220331

9 years agoSubclass InputGraph to get darwin linker library semantics
Nick Kledzik [Tue, 21 Oct 2014 21:14:11 +0000 (21:14 +0000)]
Subclass InputGraph to get darwin linker library semantics

The darwin linker operates differently than the gnu linker with respect to
libraries. The darwin linker first links in all object files from the command
line, then to resolve any remaining undefines, it repeatedly iterates over
libraries on the command line until either all undefines are resolved or no
undefines were resolved in the last pass.

When Shankar made the InputGraph model, the plan for darwin was for the darwin
driver to place all libraries in a group at the end of the InputGraph. Thus
making the darwin model a subset of the gnu model. But it turns out that does
not work because the driver cannot tell if a file is an object or library until
it has been loaded, which happens later.

This solution is to subclass InputGraph for darwin and just iterate the graph
the way darwin linker needs.

llvm-svn: 220330

9 years agoR600: Use default GlobalDirective
Matt Arsenault [Tue, 21 Oct 2014 21:08:36 +0000 (21:08 +0000)]
R600: Use default GlobalDirective

The overridden one wasn't inserting a space,
so you would end up with .globalfoo

llvm-svn: 220329

9 years ago[sanitizer] Fix build with _FILE_OFFSET_BITS=64.
Evgeniy Stepanov [Tue, 21 Oct 2014 21:08:13 +0000 (21:08 +0000)]
[sanitizer] Fix build with _FILE_OFFSET_BITS=64.

Sanitizer source is not affected by _FILE_OFFSET_BITS in general,
but this one file must be built with 32-bit off_t. More details in the code.

llvm-svn: 220328

9 years agoUse a StringRef. No functionality change.
Rafael Espindola [Tue, 21 Oct 2014 21:07:49 +0000 (21:07 +0000)]
Use a StringRef. No functionality change.

llvm-svn: 220327

9 years agoUse __cxa_demangle on FreeBSD to fix buildbots.
Rui Ueyama [Tue, 21 Oct 2014 21:05:01 +0000 (21:05 +0000)]
Use __cxa_demangle on FreeBSD to fix buildbots.

llvm-svn: 220326

9 years agoTeach combineMetadata how to merge 'nonnull' metadata.
Philip Reames [Tue, 21 Oct 2014 21:02:19 +0000 (21:02 +0000)]
Teach combineMetadata how to merge 'nonnull' metadata.

combineMetadata is used when merging two instructions into one.  This change teaches it how to merge 'nonnull' - i.e. only preserve it on the new instruction if it's set on both sources.  This isn't actually used yet since I haven't adjusted any of the call sites to pass in nonnull as a 'known metadata'.

llvm-svn: 220325

9 years agoPreserve 'nonnull' when changing type of the load.
Philip Reames [Tue, 21 Oct 2014 21:00:03 +0000 (21:00 +0000)]
Preserve 'nonnull' when changing type of the load.

When changing the type of a load in Chandler's recent InstCombine changes, we can preserve the new 'nonnull' metadata.

I considered adding an assert since 'nonnull' is only valid on pointer types, but casting a pointer to a non-pointer would involve more than a bitcast anyways.  If someone extends this transform to handle more than bitcasts, the verifier will report the malformed IR, so a separate assertion isn't needed.  Also, the fpmath flags would have the same problem.

llvm-svn: 220324

9 years agoExtend the verifier to check usage of 'nonnull' metadata.
Philip Reames [Tue, 21 Oct 2014 20:56:29 +0000 (20:56 +0000)]
Extend the verifier to check usage of 'nonnull' metadata.

The recently added !nonnull metadata is only valid on loads of pointer type.

llvm-svn: 220323

9 years agoExpose the type-info flags at the public API layer. These flags provide much more...
Enrico Granata [Tue, 21 Oct 2014 20:52:14 +0000 (20:52 +0000)]
Expose the type-info flags at the public API layer. These flags provide much more informational content to consumers of the LLDB API than the existing TypeClass. Part of the fix for rdar://18517593

llvm-svn: 220322

9 years ago[PBQP] Teach PassConfig to tell if the default register allocator is used.
Arnaud A. de Grandmaison [Tue, 21 Oct 2014 20:47:22 +0000 (20:47 +0000)]
[PBQP] Teach PassConfig to tell if the default register allocator is used.

This enables targets to adapt their pass pipeline to the register
allocator in use. For example, with the AArch64 backend, using PBQP
with the cortex-a57, the FPLoadBalancing pass is no longer necessary.

llvm-svn: 220321

9 years agoMove anonymous types declared in an anonymous union to
Eric Christopher [Tue, 21 Oct 2014 20:39:34 +0000 (20:39 +0000)]
Move anonymous types declared in an anonymous union to
outside the anonymous union as it's a language extension
we don't normally support.

llvm-svn: 220320

9 years agoRemove unused variable.
Eric Christopher [Tue, 21 Oct 2014 20:36:17 +0000 (20:36 +0000)]
Remove unused variable.

llvm-svn: 220319

9 years agoFix implicit conversion of NULL constant to 'bool'.
Eric Christopher [Tue, 21 Oct 2014 20:35:35 +0000 (20:35 +0000)]
Fix implicit conversion of NULL constant to 'bool'.

llvm-svn: 220318

9 years agoMove code a bit to avoid a few declarations. NFC.
Rafael Espindola [Tue, 21 Oct 2014 20:34:57 +0000 (20:34 +0000)]
Move code a bit to avoid a few declarations. NFC.

llvm-svn: 220317

9 years ago[PBQP] Add a testcase for r220302: Fix coalescing benefits
Arnaud A. de Grandmaison [Tue, 21 Oct 2014 20:10:21 +0000 (20:10 +0000)]
[PBQP] Add a testcase for r220302: Fix coalescing benefits

llvm-svn: 220316

9 years agoAssume cxxabi.h exists on FreeBSD
Rui Ueyama [Tue, 21 Oct 2014 20:02:00 +0000 (20:02 +0000)]
Assume cxxabi.h exists on FreeBSD

HAVE_CXXABI_H is not defined on FreeBSD but the system actually
has the header. CMake test fails because the header depends on size_t.

llvm-svn: 220315

9 years agoInstCombine: Simplify FoldICmpCstShrCst
David Majnemer [Tue, 21 Oct 2014 19:51:55 +0000 (19:51 +0000)]
InstCombine: Simplify FoldICmpCstShrCst

This function was complicated by the fact that it tried to perform
canonicalizations that were already preformed by InstSimplify.  Remove
this extra code and move the tests over to InstSimplify.  Add asserts to
make sure our preconditions hold before we make any assumptions.

llvm-svn: 220314

9 years agoRemoving unused variable (assigned into, but never read from); NFC.
Aaron Ballman [Tue, 21 Oct 2014 19:37:56 +0000 (19:37 +0000)]
Removing unused variable (assigned into, but never read from); NFC.

llvm-svn: 220313

9 years agoFollow-up commit to r211657 which introduced these macros, but not for MSVC. This...
Aaron Ballman [Tue, 21 Oct 2014 19:24:06 +0000 (19:24 +0000)]
Follow-up commit to r211657 which introduced these macros, but not for MSVC. This turns out to break our freestanding tests on Windows when compiling in MSVC-compatible mode. It was decided (lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20141020/116942.html is the start of the thread) to support this as part of Clang's interface on all platforms.

llvm-svn: 220312

9 years agoTreat -g1 as -gline-tables-only
Hal Finkel [Tue, 21 Oct 2014 19:20:21 +0000 (19:20 +0000)]
Treat -g1 as -gline-tables-only

-g1 on gcc (and also IBM's xlc) are documented to be very similar to
-gline-tables-only. Our -gline-tables-only might still be more verbose than -g1
on other compilers, but currently we treat -g1 as -g, and so we're producing
much more debug info at -g1 than everybody else. Treating -g1 as
-gline-tables-only brings us much closer to what everyone else is doing.

For more information, see the discussion on
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-October/039649.html

llvm-svn: 220311

9 years agoDrop support for an old version of ld64 (from darwin 9).
Rafael Espindola [Tue, 21 Oct 2014 18:31:09 +0000 (18:31 +0000)]
Drop support for an old version of ld64 (from darwin 9).

llvm-svn: 220310

9 years agoremove function names from comments; NFC
Sanjay Patel [Tue, 21 Oct 2014 18:26:57 +0000 (18:26 +0000)]
remove function names from comments; NFC

llvm-svn: 220309

9 years agoConvert two tests to use llvm-readobj.
Rafael Espindola [Tue, 21 Oct 2014 18:24:31 +0000 (18:24 +0000)]
Convert two tests to use llvm-readobj.

llvm-svn: 220308

9 years agoDriver: Quote the command in crash reproduction scripts.
Justin Bogner [Tue, 21 Oct 2014 18:03:08 +0000 (18:03 +0000)]
Driver: Quote the command in crash reproduction scripts.

This fixes crash report generation when filenames have spaces. It also
removes an awkward workaround that quoted *some* arguments when
generating crash reports.

llvm-svn: 220307

9 years agoAdd typemaps to handle the transformation of Python list of strings into a 'char...
Enrico Granata [Tue, 21 Oct 2014 17:49:24 +0000 (17:49 +0000)]
Add typemaps to handle the transformation of Python list of strings into a 'char const **'. This fixes zephyr's issue with SBTarget::Launch without splitting the API into multiple names

llvm-svn: 220306

9 years agoDriver: Move crash report command mangling into Command::Print
Justin Bogner [Tue, 21 Oct 2014 17:24:44 +0000 (17:24 +0000)]
Driver: Move crash report command mangling into Command::Print

This pushes the logic for generating a crash reproduction script
entirely into Command::Print, instead of Command doing half of the
work and then relying on textual substitution for the rest. This makes
this logic much easier to read and will simplify fixing a couple of
issues in this area.

llvm-svn: 220305

9 years agoR600/SI: Add pattern for bswap
Matt Arsenault [Tue, 21 Oct 2014 16:25:08 +0000 (16:25 +0000)]
R600/SI: Add pattern for bswap

llvm-svn: 220304

9 years ago[PBQP] Check for out of bound access in DEBUG builds
Arnaud A. de Grandmaison [Tue, 21 Oct 2014 16:24:21 +0000 (16:24 +0000)]
[PBQP] Check for out of bound access in DEBUG builds

It is just too easy to use a virtual register intead of a NodeId without a
compiler warning. This does not fix the fundamental problem, i.e. both
have the same underlying types, but increases the likelyhood to detect it.

llvm-svn: 220303

9 years ago[PBQP] Fix coalescing benefits
Arnaud A. de Grandmaison [Tue, 21 Oct 2014 16:24:15 +0000 (16:24 +0000)]
[PBQP] Fix coalescing benefits

As coalescing registers is a benefit, the cost should be improved (i.e. made smaller) when coalescing is possible.

llvm-svn: 220302

9 years agoX86AsmInstrumentation.cpp: Dissolve initializer-ranged-for. MSC17 disliked it.
NAKAMURA Takumi [Tue, 21 Oct 2014 16:22:52 +0000 (16:22 +0000)]
X86AsmInstrumentation.cpp: Dissolve initializer-ranged-for. MSC17 disliked it.

llvm-svn: 220301

9 years agoSilence a -Wcast-qual warning; NFC.
Aaron Ballman [Tue, 21 Oct 2014 16:12:37 +0000 (16:12 +0000)]
Silence a -Wcast-qual warning; NFC.

llvm-svn: 220300

9 years agoTest commit
Colin LeMahieu [Tue, 21 Oct 2014 16:03:10 +0000 (16:03 +0000)]
Test commit
Fixing brief comment.

llvm-svn: 220299

9 years agoComment cleanup. NFC.
Rafael Espindola [Tue, 21 Oct 2014 15:49:46 +0000 (15:49 +0000)]
Comment cleanup. NFC.

Don't duplicate names in comments and remove useless ones. Hopefully anyone
reading this knows what main is.

llvm-svn: 220298

9 years agoThe nodebug attribute has a C++11-style spelling supported by GCC as well. This modif...
Aaron Ballman [Tue, 21 Oct 2014 15:46:57 +0000 (15:46 +0000)]
The nodebug attribute has a C++11-style spelling supported by GCC as well. This modifies it so we support that spelling as well.

llvm-svn: 220297

9 years agoSome tests used __typeof__ instead of decltype. Replace these usages.
Marshall Clow [Tue, 21 Oct 2014 15:07:09 +0000 (15:07 +0000)]
Some tests used __typeof__ instead of decltype. Replace these usages.

llvm-svn: 220296

9 years agoLWG #2212 (not yet adopted) mandates that tuple_size/tuple_element are available...
Marshall Clow [Tue, 21 Oct 2014 15:05:31 +0000 (15:05 +0000)]
LWG #2212 (not yet adopted) mandates that tuple_size/tuple_element are available if <array> or <utility> are included (not just <tuple>). We already do this. Add some tests to make sure that this remains true.

llvm-svn: 220295

9 years agoAdd support for addmod to mri scripts.
Rafael Espindola [Tue, 21 Oct 2014 14:46:17 +0000 (14:46 +0000)]
Add support for addmod to mri scripts.

llvm-svn: 220294

9 years agoFixing the MSVC build by removing friendship with CodeGenFunction; NFC.
Aaron Ballman [Tue, 21 Oct 2014 13:39:56 +0000 (13:39 +0000)]
Fixing the MSVC build by removing friendship with CodeGenFunction; NFC.

llvm-svn: 220293

9 years ago[Tsan] Add FreeBSD support to longjmp-related definitions
Viktor Kutuzov [Tue, 21 Oct 2014 13:38:05 +0000 (13:38 +0000)]
[Tsan] Add FreeBSD support to longjmp-related definitions
Differential Revision: http://reviews.llvm.org/D5857

llvm-svn: 220292

9 years ago[Tsan] Fix sigaction_t to match system definition on FreeBSD
Viktor Kutuzov [Tue, 21 Oct 2014 13:31:05 +0000 (13:31 +0000)]
[Tsan] Fix sigaction_t to match system definition on FreeBSD
Differential Revision: http://reviews.llvm.org/D5856

llvm-svn: 220291

9 years ago[PowerPC] Avoid VSX FMA mutate when killed product reg = addend reg
Bill Schmidt [Tue, 21 Oct 2014 13:02:37 +0000 (13:02 +0000)]
[PowerPC] Avoid VSX FMA mutate when killed product reg = addend reg

With VSX enabled, test/CodeGen/PowerPC/recipest.ll exposes a bug in
the FMA mutation pass.  If we have a situation where a killed product
register is the same register as the FMA target, such as:

   %vreg5<def,tied1> = XSNMSUBADP %vreg5<tied0>, %vreg11, %vreg5,
                       %RM<imp-use>; VSFRC:%vreg5 F8RC:%vreg11

then the substitution makes no sense.  We end up getting a crash when
we try to extend the interval associated with the killed product
register, as there is already a live range for %vreg5 there.  This
patch just disables the mutation under those circumstances.

Since recipest.ll generates different code with VMX enabled, I've
modified that test to use -mattr=-vsx.  I've borrowed the code from
that test that exposed the bug and placed it in fma-mutate.ll, where
it tests several mutation opportunities including the "bad" one.

llvm-svn: 220290

9 years ago[analyzer] Move the NewDeleteLeaks checker from CplusplusAlpha to Cplusplus package.
Anton Yartsev [Tue, 21 Oct 2014 12:41:36 +0000 (12:41 +0000)]
[analyzer] Move the NewDeleteLeaks checker from CplusplusAlpha to Cplusplus package.

llvm-svn: 220289

9 years ago[ARM] NEON 32-bit scalar moves are also available in VFPv2
Oliver Stannard [Tue, 21 Oct 2014 11:49:14 +0000 (11:49 +0000)]
[ARM] NEON 32-bit scalar moves are also available in VFPv2

The 32-bit variants of the NEON scalar<->GPR move instructions are
also available in VFPv2. The 8- and 16-bit variants do require NEON.

Note that the checks in the test file are all -DAG because they are
checking a mixture of stdout and stderr, and the ordering is not
guaranteed.

llvm-svn: 220288

9 years agoclang-format: [Java] Understand string literal concatenation.
Daniel Jasper [Tue, 21 Oct 2014 11:34:53 +0000 (11:34 +0000)]
clang-format: [Java] Understand string literal concatenation.

Before:
  String someString = "abc" + "cde";

After:
  String someString = "abc"
                      + "cde";

llvm-svn: 220287

9 years agoclang-format: [Java] Fix formatting of multiple annotations.
Daniel Jasper [Tue, 21 Oct 2014 11:17:56 +0000 (11:17 +0000)]
clang-format: [Java] Fix formatting of multiple annotations.

Before:
  @SuppressWarnings(value = "unchecked")
  @Author(name = "abc") public void doSomething() {
  }

After:
  @SuppressWarnings(value = "unchecked")
  @Author(name = "abc")
  public void doSomething() {
  }

llvm-svn: 220286

9 years agoclang-format: [Java] Fix space in generic method calls.
Daniel Jasper [Tue, 21 Oct 2014 11:13:31 +0000 (11:13 +0000)]
clang-format: [Java] Fix space in generic method calls.

Before:
  A.<B>doSomething();

After:
  A.<B>doSomething();

llvm-svn: 220285

9 years agoclang-format: [Java] Improve annotation handling.
Daniel Jasper [Tue, 21 Oct 2014 10:58:14 +0000 (10:58 +0000)]
clang-format: [Java] Improve annotation handling.

Before:
@SuppressWarnings(
    value = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") public static int iiiiiiiiiiiiiiiiiiiiiiii;

After:
  @SuppressWarnings(value = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
  public static int iiiiiiiiiiiiiiiiiiiiiiii;

llvm-svn: 220284

9 years ago[asan-asm-instrumentation] Fixed memory accesses with rbp as a base or an index register.
Yuri Gorshenin [Tue, 21 Oct 2014 10:22:27 +0000 (10:22 +0000)]
[asan-asm-instrumentation] Fixed memory accesses with rbp as a base or an index register.

Summary: Fixed memory accesses with rbp as a base or an index register.

Reviewers: eugenis

Subscribers: llvm-commits

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

llvm-svn: 220283

9 years agoclang-format: [Java] Make annotation formatting more consistent.
Daniel Jasper [Tue, 21 Oct 2014 10:02:03 +0000 (10:02 +0000)]
clang-format: [Java] Make annotation formatting more consistent.

Before:
  DoSomething(new A() {
    @Override public String toString() {
    }
  });

After:
  DoSomething(new A() {
    @Override
    public String toString() {
    }
  });

llvm-svn: 220282

9 years agoclang-format: [Java] Improve generic support.
Daniel Jasper [Tue, 21 Oct 2014 09:57:09 +0000 (09:57 +0000)]
clang-format: [Java] Improve generic support.

Before:
  Iterable< ? > a;
  Iterable< ? extends SomeObject > a;

After:
  Iterable<?> a;
  Iterable<? extends SomeObject> a;

llvm-svn: 220281

9 years agoclang-format: [Java] Support extending inner classes.
Daniel Jasper [Tue, 21 Oct 2014 09:31:29 +0000 (09:31 +0000)]
clang-format: [Java] Support extending inner classes.

Before:
  class A extends B
  .C {}

After:
  class A extends B.C {}

llvm-svn: 220280

9 years agoclang-format: [Java] Support annotations with parameters.
Daniel Jasper [Tue, 21 Oct 2014 09:25:39 +0000 (09:25 +0000)]
clang-format: [Java] Support annotations with parameters.

Before:
  @SuppressWarnings
  (value = "unchecked") public void doSomething() { .. }

After:
  @SuppressWarnings(value = "unchecked")
  public void doSomething() { .. }

llvm-svn: 220279

9 years ago[Thumb2] LDRS?[BH] cannot load to the PC
Oliver Stannard [Tue, 21 Oct 2014 09:14:15 +0000 (09:14 +0000)]
[Thumb2] LDRS?[BH] cannot load to the PC

The Thumb2 LDRS?[BH] instructions are not valid when the destination
register is the PC (these encodings are used for preload hints).

llvm-svn: 220278

9 years agoTeach the load analysis to allow finding available values which require
Chandler Carruth [Tue, 21 Oct 2014 09:00:40 +0000 (09:00 +0000)]
Teach the load analysis to allow finding available values which require
inttoptr or ptrtoint cast provided there is datalayout available.
Eventually, the datalayout can just be required but in practice it will
always be there today.

To go with the ability to expose available values requiring a ptrtoint
or inttoptr cast, helpers are added to perform one of these three casts.

These smarts are necessary to finish canonicalizing loads and stores to
the operational type requirements without regressing fundamental
combines.

I've added some test cases. These should actually improve as the load
combining and store combining improves, but they may fundamentally be
highlighting some missing combines for select in addition to exercising
the specific added logic to load analysis.

llvm-svn: 220277

9 years ago[mips][microMIPS] Implement ADDU16 and SUBU16 instructions
Zoran Jovanovic [Tue, 21 Oct 2014 08:44:58 +0000 (08:44 +0000)]
[mips][microMIPS] Implement ADDU16 and SUBU16 instructions
Differential Revision: http://reviews.llvm.org/D5118

llvm-svn: 220276

9 years ago[mips][microMIPS] Implement AND16, NOT16, OR16 and XOR16 instructions
Zoran Jovanovic [Tue, 21 Oct 2014 08:32:40 +0000 (08:32 +0000)]
[mips][microMIPS] Implement AND16, NOT16, OR16 and XOR16 instructions
Differential Revision: http://reviews.llvm.org/D5117

llvm-svn: 220275

9 years agoclang-format: [Java] Wrap after each function annotation.
Daniel Jasper [Tue, 21 Oct 2014 08:24:18 +0000 (08:24 +0000)]
clang-format: [Java] Wrap after each function annotation.

Before:
  @Override public String toString() { .. }

After:
  @Override
  public String toString() { .. }

llvm-svn: 220274

9 years ago[mips][microMIPS] Implement microMIPS 16-bit instructions registers
Zoran Jovanovic [Tue, 21 Oct 2014 08:23:11 +0000 (08:23 +0000)]
[mips][microMIPS] Implement microMIPS 16-bit instructions registers
Differential Revision: http://reviews.llvm.org/D5116

llvm-svn: 220273

9 years agoTest case B: fixed check rule
Evgeny Astigeevich [Tue, 21 Oct 2014 08:16:42 +0000 (08:16 +0000)]
Test case B: fixed check rule

llvm-svn: 220272

9 years agoTest case B is updated to work for 32-bit and 64-bit platforms
Evgeny Astigeevich [Tue, 21 Oct 2014 08:01:37 +0000 (08:01 +0000)]
Test case B is updated to work for 32-bit and 64-bit platforms

llvm-svn: 220271

9 years agoclang-format: [ObjC] Fix spacing in block variable parameters.
Daniel Jasper [Tue, 21 Oct 2014 07:57:50 +0000 (07:57 +0000)]
clang-format: [ObjC] Fix spacing in block variable parameters.

Before:
  { void (^block)(Object * x); }

After:
  { void (^block)(Object *x); }

llvm-svn: 220270

9 years agoclang-format: Fix space in direct destructor calls.
Daniel Jasper [Tue, 21 Oct 2014 07:51:54 +0000 (07:51 +0000)]
clang-format: Fix space in direct destructor calls.

Before:
  void F(int& i) { i. ~int(); }

After:
  void F(int& i) { i.~int(); }

Also, some cleanups.

llvm-svn: 220269

9 years agoAdd missing qualifier to documentation.
Nick Lewycky [Tue, 21 Oct 2014 06:44:23 +0000 (06:44 +0000)]
Add missing qualifier to documentation.

llvm-svn: 220268

9 years agoUpdate documentation to match API change in r215323.
Nick Lewycky [Tue, 21 Oct 2014 06:43:08 +0000 (06:43 +0000)]
Update documentation to match API change in r215323.

llvm-svn: 220267

9 years agoOpenMPClause.h: Fix a warning. [-Wdocumentation]
NAKAMURA Takumi [Tue, 21 Oct 2014 06:40:57 +0000 (06:40 +0000)]
OpenMPClause.h: Fix a warning. [-Wdocumentation]

llvm-svn: 220266

9 years agoDriver: Tighten up crash report tests
Justin Bogner [Tue, 21 Oct 2014 05:13:09 +0000 (05:13 +0000)]
Driver: Tighten up crash report tests

These tests were a little bit too flexible in terms of filenames.

llvm-svn: 220265

9 years agoRemove unused member variable.
Craig Topper [Tue, 21 Oct 2014 04:19:18 +0000 (04:19 +0000)]
Remove unused member variable.

llvm-svn: 220264

9 years ago[Gnu] Move certain options to a different group.
Shankar Easwaran [Tue, 21 Oct 2014 04:02:32 +0000 (04:02 +0000)]
[Gnu] Move certain options to a different group.

The -mllvm option is not specific to LTO.

llvm-svn: 220263

9 years ago[OPENMP] Codegen for 'private' clause in 'parallel' directive.
Alexey Bataev [Tue, 21 Oct 2014 03:16:40 +0000 (03:16 +0000)]
[OPENMP] Codegen for 'private' clause in 'parallel' directive.
This patch generates some helper variables which used as a private copies of the corresponding original variables inside an OpenMP 'parallel' directive. These generated variables are initialized by default (with the default constructor, if any). In outlined function references to original variables are replaced by the references to these private helper variables. At the end of the initialization of the private variables and implicit barier is set by calling __kmpc_barrier(...) runtime function to be sure that all threads were initialized using original values of the variables.
Differential Revision: http://reviews.llvm.org/D4752

llvm-svn: 220262

9 years ago[ELF] Remove duplicate code.
Shankar Easwaran [Tue, 21 Oct 2014 03:12:57 +0000 (03:12 +0000)]
[ELF] Remove duplicate code.

The base class ELFObjectReader/ELFDSOReader implement the canParse functionaity
with this change.

llvm-svn: 220261

9 years agoRemove dead buildbot link
Eric Fiselier [Tue, 21 Oct 2014 02:46:31 +0000 (02:46 +0000)]
Remove dead buildbot link

llvm-svn: 220260

9 years ago[PECOFF] Look for decorated entry symbol name.
Rui Ueyama [Tue, 21 Oct 2014 02:28:28 +0000 (02:28 +0000)]
[PECOFF] Look for decorated entry symbol name.

Entry symbol name can be decorated. When we look for _WinMain, we
also have to look for _WinMain@16.

llvm-svn: 220259

9 years agoRemove including <complex.h> in test case, and change to use _Complex instead.
Jiangning Liu [Tue, 21 Oct 2014 02:19:58 +0000 (02:19 +0000)]
Remove including <complex.h> in test case, and change to use _Complex instead.

llvm-svn: 220258

9 years agoLower compound assignment for the missing type llvm::Type::FP128TyID.
Jiangning Liu [Tue, 21 Oct 2014 01:34:34 +0000 (01:34 +0000)]
Lower compound assignment for the missing type llvm::Type::FP128TyID.

llvm-svn: 220257

9 years agoFix a bit of confusion about .set and produce more readable assembly.
Rafael Espindola [Tue, 21 Oct 2014 01:17:30 +0000 (01:17 +0000)]
Fix a bit of confusion about .set and produce more readable assembly.

Every target we support has support for assembly that looks like

a = b - c
.long a

What is special about MachO is that the above combination suppresses the
production of a relocation.

With this change we avoid producing the intermediary labels when they don't
add any value.

llvm-svn: 220256

9 years agoDo not attribute static allocas to the call site's DebugLoc.
Paul Robinson [Tue, 21 Oct 2014 01:00:55 +0000 (01:00 +0000)]
Do not attribute static allocas to the call site's DebugLoc.

When functions are inlined, instructions without debug information are
attributed to the call site's DebugLoc. After inlining, inlined static
allocas are moved to the caller's entry block, adjacent to the caller's
original static alloca instructions. By retaining the call site's
DebugLoc, these instructions could cause instructions that were
subsequently inserted at the entry block to pick up the same DebugLoc.

Patch by Wolfgang Pieb!

llvm-svn: 220255

9 years agoMake the "synchronous" mode actually work without race conditions.
Greg Clayton [Tue, 21 Oct 2014 01:00:42 +0000 (01:00 +0000)]
Make the "synchronous" mode actually work without race conditions.

There were many issues with synchronous mode that we discovered when started to try and add a "batch" mode. There was a race condition where the event handling thread might consume events when in sync mode and other times the Process::WaitForProcessToStop() would consume them. This also led to places where the Process IO handler might or might not get popped when it needed to be.

llvm-svn: 220254

9 years agoMake this test a bit more strict.
Rafael Espindola [Tue, 21 Oct 2014 00:47:49 +0000 (00:47 +0000)]
Make this test a bit more strict.

llvm-svn: 220253

9 years agoTeach lit to filter the host LDFLAGS down from the build system and into
Chandler Carruth [Tue, 21 Oct 2014 00:36:28 +0000 (00:36 +0000)]
Teach lit to filter the host LDFLAGS down from the build system and into
the CGO build environment. This lets things like -rpath propagate down
to the C++ code that is built along side the Go bindings when testing
them.

Patch by Peter Collingbourne, and verified that it works by me.

llvm-svn: 220252

9 years agoPR21202: Memory leak in Windows RWMutexImpl when using SRWLOCK
David Blaikie [Tue, 21 Oct 2014 00:34:39 +0000 (00:34 +0000)]
PR21202: Memory leak in Windows RWMutexImpl when using SRWLOCK

llvm-svn: 220251

9 years agoMake AsmPrinter::EmitLabelOffsetDifference a static helper and simplify.
Rafael Espindola [Tue, 21 Oct 2014 00:25:49 +0000 (00:25 +0000)]
Make AsmPrinter::EmitLabelOffsetDifference a static helper and simplify.

It had exactly one caller in a position where we know hasSetDirective is true.

llvm-svn: 220250

9 years ago[MCJIT] Temporarily revert r220245 - it broke several bots.
Lang Hames [Tue, 21 Oct 2014 00:24:02 +0000 (00:24 +0000)]
[MCJIT] Temporarily revert r220245 - it broke several bots.

(See e.g. http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/17653)

llvm-svn: 220249

9 years agoIntroduce enum values for previously defined metadata types. (NFC)
Philip Reames [Tue, 21 Oct 2014 00:13:20 +0000 (00:13 +0000)]
Introduce enum values for previously defined metadata types. (NFC)

Our metadata scheme lazily assigns IDs to string metadata, but we have a mechanism to preassign them as well.  Using a preassigned ID is helpful since we get compile time type checking, and avoid some (minimal) string construction and comparison.  This change adds enum value for three existing metadata types:
+    MD_nontemporal = 9, // "nontemporal"
+    MD_mem_parallel_loop_access = 10, // "llvm.mem.parallel_loop_access"
+    MD_nonnull = 11 // "nonnull"

I went through an updated various uses as well.  I made no attempt to get all uses; I focused on the ones which were easily grepable and easily to translate.  For example, there were several items in LoopInfo.cpp I chose not to update.

llvm-svn: 220248

9 years agoRemove unused local variable
Alexey Samsonov [Mon, 20 Oct 2014 23:58:08 +0000 (23:58 +0000)]
Remove unused local variable

llvm-svn: 220247