platform/upstream/llvm.git
10 years agoReland r219810 "Fix late template parsing leak with incremental processing"
Reid Kleckner [Wed, 22 Oct 2014 17:50:19 +0000 (17:50 +0000)]
Reland r219810 "Fix late template parsing leak with incremental processing"

Original message:
Add a second late template parser callback meant to cleanup any
resources allocated by late template parsing.  Call it from the
Sema::ActOnEndOfTranslationUnit method after all pending template
instantiations have been completed.  Teach Parser::ParseTopLevelDecl to
install the cleanup callback when incremental processing is enabled so
that Parser::TemplateIds can be freed.

Patch by Brad King!

llvm-svn: 220400

10 years agoFix VS2012 build; C++11 type aliases are not supported.
Hans Wennborg [Wed, 22 Oct 2014 17:47:49 +0000 (17:47 +0000)]
Fix VS2012 build; C++11 type aliases are not supported.

llvm-svn: 220399

10 years agoMS ABI: Emit more canonical vbptr stores and loads
Reid Kleckner [Wed, 22 Oct 2014 17:26:00 +0000 (17:26 +0000)]
MS ABI: Emit more canonical vbptr stores and loads

This eliminates some i8* GEPs and makes the IR that clang emits a bit
more canonical. More work is needed for vftables, but that isn't a clear
win so I plan to send it for review.

llvm-svn: 220398

10 years agoAmmending 220393 - Removing unused decoding tables.
Colin LeMahieu [Wed, 22 Oct 2014 17:23:01 +0000 (17:23 +0000)]
Ammending 220393 - Removing unused decoding tables.

llvm-svn: 220397

10 years agoAmmending 220393 - Removing unused functions.
Colin LeMahieu [Wed, 22 Oct 2014 17:03:19 +0000 (17:03 +0000)]
Ammending 220393 - Removing unused functions.

llvm-svn: 220396

10 years ago[PATCH] Support select-cc for VSFRC when VSX is enabled
Bill Schmidt [Wed, 22 Oct 2014 16:58:20 +0000 (16:58 +0000)]
[PATCH] Support select-cc for VSFRC when VSX is enabled

A previous patch enabled SELECT_VSRC and SELECT_CC_VSRC for VSX to
handle <2 x double> cases.  This patch adds SELECT_VSFRC and
SELECT_CC_VSFRC to allow use of all 64 vector-scalar registers for the
f64 type when VSX is enabled.  The changes are analogous to those in
the previous patch.  I've added a new variant to vsx.ll to test the
code generation.

(I also cleaned up a little formatting in PPCInstrVSX.td from the
previous patch.)

llvm-svn: 220395

10 years agoUse auto iteration in lib/Transforms/Scalar/SampleProfile.cpp. No functional changes.
Diego Novillo [Wed, 22 Oct 2014 16:51:50 +0000 (16:51 +0000)]
Use auto iteration in lib/Transforms/Scalar/SampleProfile.cpp. No functional changes.

llvm-svn: 220394

10 years ago[Hexagon] Adding basic disassembler.
Colin LeMahieu [Wed, 22 Oct 2014 16:49:14 +0000 (16:49 +0000)]
[Hexagon] Adding basic disassembler.
Marking all instructions as CodeGenOnly since encoding bits are not set yet.
http://reviews.llvm.org/D5829?vs=on&id=15023&whitespace=ignore-all#toc

llvm-svn: 220393

10 years agoPreserving 'nonnull' metadata in SimplifyCFG
Philip Reames [Wed, 22 Oct 2014 16:37:13 +0000 (16:37 +0000)]
Preserving 'nonnull' metadata in SimplifyCFG

When we hoist two loads above an if, we can preserve the nonnull metadata.  We could also do the same for sinking them, but we appear to not handle metadata at all in that case.

Thanks to Hal for the review.

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

llvm-svn: 220392

10 years agoShrinkify libcalls: use float versions of double libm functions with fast-math (bug...
Sanjay Patel [Wed, 22 Oct 2014 15:29:23 +0000 (15:29 +0000)]
Shrinkify libcalls: use float versions of double libm functions with fast-math (bug 17850)

When a call to a double-precision libm function has fast-math semantics
(via function attribute for now because there is no IR-level FMF on calls),
we can avoid fpext/fptrunc operations and use the float version of the call
if the input and output are both float.

We already do this optimization using a command-line option; this patch just
adds the ability for fast-math to use the existing functionality.

I moved the cl::opt from InstructionCombining into SimplifyLibCalls because
it's only ever used internally to that class.

Modified the existing test cases to use the unsafe-fp-math attribute rather
than repeating all tests.

This patch should solve: http://llvm.org/bugs/show_bug.cgi?id=17850

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

llvm-svn: 220390

10 years agoMake two helper functions static.
Rafael Espindola [Wed, 22 Oct 2014 15:05:51 +0000 (15:05 +0000)]
Make two helper functions static.

llvm-svn: 220389

10 years agor600: Fix get_work_dim range metadata
Jan Vesely [Wed, 22 Oct 2014 14:32:53 +0000 (14:32 +0000)]
r600: Fix get_work_dim range metadata

Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 220388

10 years agoRemove unused StmtVector& parameters from declaration parsing functions.
Rafael Espindola [Wed, 22 Oct 2014 14:27:08 +0000 (14:27 +0000)]
Remove unused StmtVector& parameters from declaration parsing functions.

Patch by Eelis van der Weegen!

llvm-svn: 220387

10 years agoChange error to warning when a profile cannot be found.
Diego Novillo [Wed, 22 Oct 2014 13:36:35 +0000 (13:36 +0000)]
Change error to warning when a profile cannot be found.

When the profile for a function cannot be applied, we use to emit an
error. This seems extreme. The compiler can continue, it's just that the
optimization opportunities won't include profile information.

llvm-svn: 220386

10 years ago[PowerPC] Support select-cc for VSX
Bill Schmidt [Wed, 22 Oct 2014 13:13:40 +0000 (13:13 +0000)]
[PowerPC] Support select-cc for VSX

The tests test/CodeGen/Generic/select-cc.ll and
test/CodeGen/PowerPC/select-cc.ll both fail with VSX enabled.  The
problem is that the lowering logic for the SELECT and SELECT_CC
operations doesn't currently support the VSX registers.  This patch
fixes that.

In lib/Target/PowerPC/PPCInstrInfo.td, we have pseudos to handle this
for other register classes.  Similar pseudos are added in
PPCInstrVSX.td (they must be there, because the "vsrc" register class
definition appears there) for the VSRC register class.  The
SELECT_VSRC pseudo is then used in pattern matching for SELECT_CC.

The rest of the patch just adds logic for SELECT_VSRC wherever similar
logic appears for SELECT_VRRC.

There are no new test cases because the existing tests above test
this, along with a variant in test/CodeGen/PowerPC/vsx.ll.

After discussion with Hal, a future patch will add similar _VSFRC
variants to override f64 type handling (currently using F8RC).

llvm-svn: 220385

10 years agoFixing a -Wsign-compare warning; NFC.
Aaron Ballman [Wed, 22 Oct 2014 13:09:43 +0000 (13:09 +0000)]
Fixing a -Wsign-compare warning; NFC.

I think it might make sense to make COFF::MaxNumberOfSections16 be a uint32_t, however, that may have wider-reaching implications in other projects, which is why I did not change that declaration.

llvm-svn: 220384

10 years agoSupport using sample profiles with partial debug info (driver)
Diego Novillo [Wed, 22 Oct 2014 13:00:05 +0000 (13:00 +0000)]
Support using sample profiles with partial debug info (driver)

Summary:
When using a profile, we used to require the use -gmlt so that we could
get access to the line locations. This is used to match line numbers in
the input profile to the line numbers in the function's IR.

But this is actually not necessary. The driver can provide source
location tracking without the emission of debug information. In these
cases, the annotation 'llvm.dbg.cu' is missing from the IR, but the
actual line location annotations are still present.

This patch tells the driver to only emit source location tracking
when -fprofile-sample-use is present in the command line.

Reviewers: echristo, dblaikie

Subscribers: llvm-commits

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

llvm-svn: 220383

10 years agoSupport using sample profiles with partial debug info.
Diego Novillo [Wed, 22 Oct 2014 12:59:00 +0000 (12:59 +0000)]
Support using sample profiles with partial debug info.

Summary:
When using a profile, we used to require the use -gmlt so that we could
get access to the line locations. This is used to match line numbers in
the input profile to the line numbers in the function's IR.

But this is actually not necessary. The driver can provide source
location tracking without the emission of debug information. In these
cases, the annotation 'llvm.dbg.cu' is missing from the IR, but the
actual line location annotations are still present.

This patch adds a new way of looking for the start of the current
function. Instead of looking through the compile units in llvm.dbg.cu,
we can walk up the scope for the first instruction in the function with
a debug loc. If that describes the function, we use it. Otherwise, we
keep looking until we find one.

If no such instruction is found, we then give up and produce an error.

Reviewers: echristo, dblaikie

Subscribers: llvm-commits

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

llvm-svn: 220382

10 years ago[AArch64] Cleanup A57PBQPConstraints
Arnaud A. de Grandmaison [Wed, 22 Oct 2014 12:40:20 +0000 (12:40 +0000)]
[AArch64] Cleanup A57PBQPConstraints

And add a long awaited testcase.

llvm-svn: 220381

10 years ago[InstSimplify] Support constant folding to vector of pointers
Bruno Cardoso Lopes [Wed, 22 Oct 2014 12:18:48 +0000 (12:18 +0000)]
[InstSimplify] Support constant folding to vector of pointers

ConstantFolding crashes when trying to InstSimplify the following load:

@a = private unnamed_addr constant %mst {
     i8* inttoptr (i64 -1 to i8*),
     i8* inttoptr (i64 -1 to i8*)
}, align 8

%x = load <2 x i8*>* bitcast (%mst* @a to <2 x i8*>*), align 8

This patch fix this by adding support to this type of folding:

%x = load <2 x i8*>* bitcast (%mst* @a to <2 x i8*>*), align 8
==> gets folded to:
  %x = <2 x i8*> <i8* inttoptr (i64 -1 to i8*), i8* inttoptr (i64 -1 to i8*)>

llvm-svn: 220380

10 years ago[Thumb/Thumb2] Implement restrictions on SP in register list on LDM, STM variants...
Jyoti Allur [Wed, 22 Oct 2014 10:41:14 +0000 (10:41 +0000)]
[Thumb/Thumb2] Implement restrictions on SP in register list on LDM, STM variants in thumb mode

llvm-svn: 220379

10 years ago[OCaml] Fix a typo in documentation.
Peter Zotov [Wed, 22 Oct 2014 10:24:05 +0000 (10:24 +0000)]
[OCaml] Fix a typo in documentation.

llvm-svn: 220377

10 years agoclang-format: Fix tests after recent change to ObjC block formatting.
Daniel Jasper [Wed, 22 Oct 2014 09:50:23 +0000 (09:50 +0000)]
clang-format: Fix tests after recent change to ObjC block formatting.

llvm-svn: 220376

10 years agoclang-format: Use AllowShortBlocksOnASingleLine for ObjC blocks, too.
Daniel Jasper [Wed, 22 Oct 2014 09:12:44 +0000 (09:12 +0000)]
clang-format: Use AllowShortBlocksOnASingleLine for ObjC blocks, too.

llvm-svn: 220375

10 years agoclang-format: Fix broken test.
Daniel Jasper [Wed, 22 Oct 2014 09:01:12 +0000 (09:01 +0000)]
clang-format: Fix broken test.

llvm-svn: 220374

10 years agoclang-format: Fix incorrect trailing return arrow detection.
Daniel Jasper [Wed, 22 Oct 2014 08:42:58 +0000 (08:42 +0000)]
clang-format: Fix incorrect trailing return arrow detection.

Before:
  auto doSomething(Aaaaaa* aaaaaa) -> decltype(aaaaaa -> f()) {}

After:
  auto doSomething(Aaaaaa* aaaaaa) -> decltype(aaaaaa->f()) {}

llvm-svn: 220373

10 years agoAdded functions to the C++ API, for the benefit of non-8-bit byte architectures.
Matthew Gardiner [Wed, 22 Oct 2014 07:22:56 +0000 (07:22 +0000)]
Added functions to the C++ API, for the benefit of non-8-bit byte architectures.

New functions to give client applications to tools to discover target byte sizes
for addresses prior to ReadMemory. Also added GetPlatform and ReadMemory to the
SBTarget class, since they seemed to be useful utilities to have.

Each new API has had a test case added.

http://reviews.llvm.org/D5867

llvm-svn: 220372

10 years agoR600/SI: Add another failing testcase for i1 copies
Matt Arsenault [Wed, 22 Oct 2014 05:30:42 +0000 (05:30 +0000)]
R600/SI: Add another failing testcase for i1 copies

It's not handling phis.

llvm-svn: 220371

10 years agoFix style issue from r220363. No functional change.
Richard Trieu [Wed, 22 Oct 2014 05:21:59 +0000 (05:21 +0000)]
Fix style issue from r220363.  No functional change.

llvm-svn: 220370

10 years ago[tsan] add a stub of another dynamic annotation
Kostya Serebryany [Wed, 22 Oct 2014 05:02:20 +0000 (05:02 +0000)]
[tsan] add a stub of another dynamic annotation

llvm-svn: 220369

10 years agoR600/SI: Add failing testcase reduced from OpenCV
Matt Arsenault [Wed, 22 Oct 2014 04:26:10 +0000 (04:26 +0000)]
R600/SI: Add failing testcase reduced from OpenCV

This fails the verifier with:
"Expected a VCSrc_32 register, but got a VReg_1 register"

llvm-svn: 220368

10 years agoHandle spaces and quotes in file names in MRI scripts.
Rafael Espindola [Wed, 22 Oct 2014 03:10:56 +0000 (03:10 +0000)]
Handle spaces and quotes in file names in MRI scripts.

llvm-svn: 220364

10 years agoDisable the uninitialized field warning in uninstantiated classes.
Richard Trieu [Wed, 22 Oct 2014 02:52:00 +0000 (02:52 +0000)]
Disable the uninitialized field warning in uninstantiated classes.

If a templated class is not instantiated, then the AST for it could be missing
some things that would throw the field checker off.  Wait until specialization
before emitting these warnings.

llvm-svn: 220363

10 years agoDriver: rename Windows to MSVCToolChain
Saleem Abdulrasool [Wed, 22 Oct 2014 02:37:29 +0000 (02:37 +0000)]
Driver: rename Windows to MSVCToolChain

This renames the Windows toolchain to MSVCToolChain.  This is a preparatory step
for adding a CrossWindowsToolChain which uses clang/libc++/(ld/lld) without the
standard GCC toolchain lookup.  NFC.

llvm-svn: 220362

10 years agoFix a gcc warning.
Rafael Espindola [Wed, 22 Oct 2014 02:23:31 +0000 (02:23 +0000)]
Fix a gcc warning.

Thanks to Filipe Cabecinhas for the report.

llvm-svn: 220361

10 years agoSilence gcc's -Wcomment
Filipe Cabecinhas [Wed, 22 Oct 2014 02:16:06 +0000 (02:16 +0000)]
Silence gcc's -Wcomment

gcc's (4.7, I think) -Wcomment warning is not "as smart" as clang's and
warns even if the line right after the backslash-newline sequence only has
a line comment that starts at the beginning of the line.

llvm-svn: 220360

10 years ago[modules] Initial support for explicitly loading .pcm files.
Richard Smith [Wed, 22 Oct 2014 02:05:46 +0000 (02:05 +0000)]
[modules] Initial support for explicitly loading .pcm files.

Implicit module builds are not well-suited to a lot of build systems. In
particular, they fare badly in distributed build systems, and they lead to
build artifacts that are not tracked as part of the usual dependency management
process. This change allows explicitly-built module files (which are already
supported through the -emit-module flag) to be explicitly loaded into a build,
allowing build systems to opt to manage module builds and dependencies
themselves.

This is only the first step in supporting such configurations, and it should
be considered experimental and subject to change or removal for now.

llvm-svn: 220359

10 years agoThe breakpoint location hit counts were getting incremented in
Jim Ingham [Wed, 22 Oct 2014 01:54:17 +0000 (01:54 +0000)]
The breakpoint location hit counts were getting incremented in
BreakpointLocation::ShouldStop.  That worked but wasn't really right,
since there's nothing to guarantee that won't get called more than
once.  So this change moves that responsibility to the StopInfoBreakpoint
directly, and then it uses the BreakpointSite to actually do the bumping.

Also fix a test case that was assuming if you had many threads running some
code with a breakpoint in it, the hit count when you stopped would always be
1.  Many of the threads could have hit it at the same time...

<rdar://problem/18577603>

llvm-svn: 220358

10 years ago[lit] Fix Python-3 compatibility, patch by Dan Liew.
Daniel Dunbar [Wed, 22 Oct 2014 01:26:06 +0000 (01:26 +0000)]
[lit] Fix Python-3 compatibility, patch by Dan Liew.

llvm-svn: 220357

10 years ago<float.h>: Don't seek #include_next if -ffreestanding for targeting mingw.
NAKAMURA Takumi [Wed, 22 Oct 2014 01:25:49 +0000 (01:25 +0000)]
<float.h>: Don't seek #include_next if -ffreestanding for targeting mingw.

llvm-svn: 220356

10 years ago[lit] Bump version number.
Daniel Dunbar [Wed, 22 Oct 2014 00:48:23 +0000 (00:48 +0000)]
[lit] Bump version number.

llvm-svn: 220355

10 years agoFix ShTest parsing error when a keyword line doesn't end with a newline.
Daniel Dunbar [Wed, 22 Oct 2014 00:34:31 +0000 (00:34 +0000)]
Fix ShTest parsing error when a keyword line doesn't end with a newline.

llvm-svn: 220354

10 years agoFix typo
Matt Arsenault [Wed, 22 Oct 2014 00:28:59 +0000 (00:28 +0000)]
Fix typo

llvm-svn: 220353

10 years agoTry to fix documentation bot warning
Matt Arsenault [Wed, 22 Oct 2014 00:15:53 +0000 (00:15 +0000)]
Try to fix documentation bot warning

llvm-svn: 220352

10 years ago[msan] Handle param-tls overflow.
Evgeniy Stepanov [Wed, 22 Oct 2014 00:12:40 +0000 (00:12 +0000)]
[msan] Handle param-tls overflow.

ParamTLS (shadow for function arguments) is of limited size. This change
makes all arguments that do not fit unpoisoned, and avoids writing
past the end of a TLS buffer.

llvm-svn: 220351

10 years ago[PECOFF] Do not write duplicate directives to .def file.
Rui Ueyama [Wed, 22 Oct 2014 00:05:30 +0000 (00:05 +0000)]
[PECOFF] Do not write duplicate directives to .def file.

This is a follow-up patch for r220333. r220333 renames exported symbols.
That raised another issue; if we have both decorated and undecorated names
for the same symbol, we'll end up have two duplicate exported symbol
entries.

This is a fix for that issue by removing duplciate entries.

llvm-svn: 220350

10 years agoRevert "Teach the load analysis to allow finding available values which require"...
Hans Wennborg [Tue, 21 Oct 2014 23:49:52 +0000 (23:49 +0000)]
Revert "Teach the load analysis to allow finding available values which require" (r220277)

This seems to have caused PR21330.

llvm-svn: 220349

10 years ago[mach-o] Support missing MH_SUBSECTIONS_VIA_SYMBOLS
Nick Kledzik [Tue, 21 Oct 2014 23:45:37 +0000 (23:45 +0000)]
[mach-o] Support missing MH_SUBSECTIONS_VIA_SYMBOLS

All compiler generated mach-o object files are marked with MH_SUBSECTIONS_VIA_SYMBOLS.
But hand written assembly files need to opt-in if they are written correctly.
The flag means the linker can break up a sections at symbol addresses and
dead strip or re-order functions.

This change recognizes object files without the flag and marks its atoms as
not dead strippable and adds a layout-after chain of references so that the
atoms cannot be re-ordered.

llvm-svn: 220348

10 years ago[MCJIT] Defer application of AArch64 MachO GOT relocations until resolve time.
Lang Hames [Tue, 21 Oct 2014 23:41:15 +0000 (23:41 +0000)]
[MCJIT] Defer application of AArch64 MachO GOT relocations until resolve time.

On AArch64, GOT references are page relative (ADRP + LDR), so they can't be
applied until we know exactly where, within a page, the GOT entry will be in
the target address space.

Fixes <rdar://problem/18693976>.

llvm-svn: 220347

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

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

llvm-svn: 220319

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

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

llvm-svn: 220299

10 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

10 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

10 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