platform/upstream/llvm.git
10 years agoDebugInfo: Simplify subprogram declaration creation/references and accidentally refix...
David Blaikie [Wed, 21 May 2014 18:04:33 +0000 (18:04 +0000)]
DebugInfo: Simplify subprogram declaration creation/references and accidentally refix PR11300.

Also simplifies the linkage name handling a little too.

llvm-svn: 209311

10 years agoUse cast<> instead of unchecked dyn_cast
Matt Arsenault [Wed, 21 May 2014 18:03:59 +0000 (18:03 +0000)]
Use cast<> instead of unchecked dyn_cast

llvm-svn: 209310

10 years agoMC: loosen an overzealous assertion
Saleem Abdulrasool [Wed, 21 May 2014 17:53:18 +0000 (17:53 +0000)]
MC: loosen an overzealous assertion

Permit active macro expansions when terminating the assembler if there were
errors during the expansion.  This would only trigger on invalid input when
built with assertions.

llvm-svn: 209309

10 years agoUse llvm-lit if LLVM source tree is unavailable.
Greg Fitzgerald [Wed, 21 May 2014 16:44:03 +0000 (16:44 +0000)]
Use llvm-lit if LLVM source tree is unavailable.

llvm-svn: 209308

10 years agoFix Bug 19678 - libc++ does not correctly handle the regex: '[^\0]*'
Marshall Clow [Wed, 21 May 2014 16:29:50 +0000 (16:29 +0000)]
Fix Bug 19678 - libc++ does not correctly handle the regex: '[^\0]*'

llvm-svn: 209307

10 years agoTest comment commit.
Dave Estes [Wed, 21 May 2014 16:19:51 +0000 (16:19 +0000)]
Test comment commit.

llvm-svn: 209306

10 years agoFix bug 19740; round-tripping a pointer through a stream doesn't work
Marshall Clow [Wed, 21 May 2014 16:02:20 +0000 (16:02 +0000)]
Fix bug 19740; round-tripping a pointer through a stream doesn't work

llvm-svn: 209305

10 years agoRemove outdated diagnostic.
Benjamin Kramer [Wed, 21 May 2014 15:57:22 +0000 (15:57 +0000)]
Remove outdated diagnostic.

llvm-svn: 209304

10 years agoUpdate for llvm api change in r209266.
Rafael Espindola [Wed, 21 May 2014 15:08:27 +0000 (15:08 +0000)]
Update for llvm api change in r209266.

llvm-svn: 209303

10 years agoImproved recovery of switch statement
Serge Pavlov [Wed, 21 May 2014 14:48:43 +0000 (14:48 +0000)]
Improved recovery of switch statement

Make better diagnostic produced by erroneous switch statement.
It fixes PR19022.

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

llvm-svn: 209302

10 years ago[sanitizer] Attempt to fix test.
Sergey Matveev [Wed, 21 May 2014 14:36:05 +0000 (14:36 +0000)]
[sanitizer] Attempt to fix test.

llvm-svn: 209301

10 years agoMove virtual methods out of line.
Rafael Espindola [Wed, 21 May 2014 14:19:22 +0000 (14:19 +0000)]
Move virtual methods out of line.

This is generally a good thing and in this case should also fix the
BUILD_SHARED_LIBS=ON build (see pr19774).

llvm-svn: 209300

10 years agoCorrect comment for thread name log option
Ed Maste [Wed, 21 May 2014 13:46:46 +0000 (13:46 +0000)]
Correct comment for thread name log option

llvm-svn: 209299

10 years ago[sanitizer] Add __sanitizer_maybe_open_cov_file().
Sergey Matveev [Wed, 21 May 2014 13:43:52 +0000 (13:43 +0000)]
[sanitizer] Add __sanitizer_maybe_open_cov_file().

Summary: Add a new interface function required for coverage sandboxing support.
llvm-svn: 209298

10 years agoMake the parent-map use significantly less memory.
Manuel Klimek [Wed, 21 May 2014 13:28:59 +0000 (13:28 +0000)]
Make the parent-map use significantly less memory.

On test files I ran this on, memory consumption overall went down from
2.5G to 2G, without performance regressions.
I also investigated making DynTypedNode by itself smaller (by pulling
out pointers for everything that doesn't fit in 8 bytes). This led to
another 200-300MB saved, but also introduced a significant regression in
performance due to the memory management overhead.

llvm-svn: 209297

10 years agoclang-format: Fix corner case working around one-per-line dict literals.
Daniel Jasper [Wed, 21 May 2014 13:26:58 +0000 (13:26 +0000)]
clang-format: Fix corner case working around one-per-line dict literals.

Before:
  var object_literal_with_long_name = {
    a: 'aaaaaaaaaaaaaaaaaa', b: 'bbbbbbbbbbbbbbbbbb'
  };

After:
  var object_literal_with_long_name = {
    a: 'aaaaaaaaaaaaaaaaaa',
    b: 'bbbbbbbbbbbbbbbbbb'
  };

llvm-svn: 209296

10 years ago[asan] add a test which ensures that we dump coverage after SEGV
Kostya Serebryany [Wed, 21 May 2014 13:20:14 +0000 (13:20 +0000)]
[asan] add a test which ensures that we dump coverage after SEGV

llvm-svn: 209295

10 years agoclang-format: Fix incorrect macro call detection.
Daniel Jasper [Wed, 21 May 2014 13:08:17 +0000 (13:08 +0000)]
clang-format: Fix incorrect macro call detection.

In:
  struct A {
    A()
        noexcept(....) {}
  };

'A()' is not a macro call.
This fixes llvm.org/PR19814.

llvm-svn: 209294

10 years agoUpdate for llvm's r209253.
Rafael Espindola [Wed, 21 May 2014 13:07:41 +0000 (13:07 +0000)]
Update for llvm's r209253.

llvm-svn: 209293

10 years ago[mips][mips64r6] Add bc[12](eq|ne)z
Daniel Sanders [Wed, 21 May 2014 12:56:39 +0000 (12:56 +0000)]
[mips][mips64r6] Add bc[12](eq|ne)z

Summary: Depends on D3691

Reviewers: jkolek, zoran.jovanovic, vmedic

Reviewed By: vmedic

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

llvm-svn: 209292

10 years agoclang-format: [JS] Support different function literal style.
Daniel Jasper [Wed, 21 May 2014 12:51:23 +0000 (12:51 +0000)]
clang-format: [JS] Support different function literal style.

Before:
  goog.array.forEach(array, function() {
                              doSomething();
                              doSomething();
                            },
                     this);

After:
  goog.array.forEach(array, function() {
    doSomething();
    doSomething();
  }, this);

llvm-svn: 209291

10 years agotsan: deflake test
Dmitry Vyukov [Wed, 21 May 2014 12:02:08 +0000 (12:02 +0000)]
tsan: deflake test

llvm-svn: 209290

10 years agoMake global named registers internal variables
Renato Golin [Wed, 21 May 2014 10:40:27 +0000 (10:40 +0000)]
Make global named registers internal variables

llvm-svn: 209289

10 years ago[asm matcher] Fix incorrect assertion when there are exactly 32 SubtargetFeatures
Daniel Sanders [Wed, 21 May 2014 10:11:24 +0000 (10:11 +0000)]
[asm matcher] Fix incorrect assertion when there are exactly 32 SubtargetFeatures

Summary:
The minimal type needs to hold a value of '1ULL << 31' but
getMinimalTypeForRange() is called with a value of '1ULL << 32'.

This patch will also reduce the size of the matcher table when there are 8
or 16 SubtargetFeatures.

Also added a dump of the SubtargetFeatures to the -debug output and corrected getMinimalTypeInRange() to consider 0xffffffffull to be a 32-bit value.

The testcase is that no existing code is broken and that LLVM still successfully
compiles after adding MIPS64r6 CodeGen support.

Reviewers: rafael

Reviewed By: rafael

Subscribers: llvm-commits

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

llvm-svn: 209288

10 years ago[msan] Implement MSAN_OPTIONS=print_stats=1.
Evgeniy Stepanov [Wed, 21 May 2014 09:56:28 +0000 (09:56 +0000)]
[msan] Implement MSAN_OPTIONS=print_stats=1.

llvm-svn: 209287

10 years ago[tsan] Fix gotsan build.
Evgeniy Stepanov [Wed, 21 May 2014 09:42:56 +0000 (09:42 +0000)]
[tsan] Fix gotsan build.

llvm-svn: 209286

10 years agoDeclVisitor is not used here.
Yaron Keren [Wed, 21 May 2014 09:02:49 +0000 (09:02 +0000)]
DeclVisitor is not used here.

llvm-svn: 209285

10 years ago[msan] Chained origins re-design.
Evgeniy Stepanov [Wed, 21 May 2014 09:02:13 +0000 (09:02 +0000)]
[msan] Chained origins re-design.

Generalize StackDepot and create a new specialized instance of it to
efficiently (i.e. without duplicating stack trace data) store the
origin history tree.

This reduces memory usage for chained origins roughly by an order of
magnitude.

Most importantly, this new design allows us to put two limits on
stored history data (exposed in MSAN_OPTIONS) that help avoid
exponential growth in used memory on certain workloads.

See comments in lib/msan/msan_origin.h for more details.

llvm-svn: 209284

10 years ago[lsan] disable lsan if wordsize is not 64
Kostya Serebryany [Wed, 21 May 2014 08:30:18 +0000 (08:30 +0000)]
[lsan] disable lsan if wordsize is not 64

llvm-svn: 209283

10 years ago[asan] Fix x86 asm instrumentation to preserve flags.
Evgeniy Stepanov [Wed, 21 May 2014 08:21:14 +0000 (08:21 +0000)]
[asan] Fix x86 asm instrumentation to preserve flags.

This change also enables asm instrumentation in asan tests that was
accidentally disabled yearlier, and adds a sanity test for that.

Patch by Yuri Gorshenin.

llvm-svn: 209282

10 years ago[sanitizer] fix linux_dirent for SANITIZER_X32; based on patch by H.J. Lu
Kostya Serebryany [Wed, 21 May 2014 08:21:13 +0000 (08:21 +0000)]
[sanitizer] fix linux_dirent for SANITIZER_X32; based on patch by H.J. Lu

llvm-svn: 209281

10 years ago[asan] Fix x86-32 asm instrumentation to preserve flags.
Evgeniy Stepanov [Wed, 21 May 2014 08:14:24 +0000 (08:14 +0000)]
[asan] Fix x86-32 asm instrumentation to preserve flags.

Patch by Yuri Gorshenin.

llvm-svn: 209280

10 years ago[sanitizer] define SANITIZER_X32 and use it in ThreadDescriptorSize; partially based...
Kostya Serebryany [Wed, 21 May 2014 08:01:44 +0000 (08:01 +0000)]
[sanitizer] define SANITIZER_X32 and use it in ThreadDescriptorSize; partially based on patch by H.J. Lu

llvm-svn: 209279

10 years agoCast pointers to uptr when calling internal_syscall
Kostya Serebryany [Wed, 21 May 2014 07:49:03 +0000 (07:49 +0000)]
Cast pointers to uptr when calling internal_syscall

For Linux/x86-64, pointers passed to internal_syscall should be casted
to uptr first.  Otherwise, they won't be properly extended to 64-bit for
x32.
Patch by H.J. Lu

llvm-svn: 209278

10 years agoUse 64-bit pointer to unwind stack for x86-64
Kostya Serebryany [Wed, 21 May 2014 07:34:03 +0000 (07:34 +0000)]
Use 64-bit pointer to unwind stack for x86-64

X32 uses ILP32 data model in 64-bit hardware mode.  This patch always
uses 64-bit pointer to unwind stack for x86-64.
Patch by H.J. Lu

llvm-svn: 209277

10 years agoPreprocessor: support defined() with operator names for MS compatibility
Alp Toker [Wed, 21 May 2014 06:13:51 +0000 (06:13 +0000)]
Preprocessor: support defined() with operator names for MS compatibility

Also flesh out missing tests, improve diagnostic QOI and fix a couple of corner
cases found in the process.

Fixes PR10606.

llvm-svn: 209276

10 years ago[C++11] Use 'nullptr'. Parser edition.
Craig Topper [Wed, 21 May 2014 06:02:52 +0000 (06:02 +0000)]
[C++11] Use 'nullptr'. Parser edition.

llvm-svn: 209275

10 years ago[PECOFF] Discard .debug sections.
Rui Ueyama [Wed, 21 May 2014 05:56:31 +0000 (05:56 +0000)]
[PECOFF] Discard .debug sections.

llvm-svn: 209274

10 years agoMC: mark COFF .drectve section as REMOVE
Saleem Abdulrasool [Wed, 21 May 2014 05:15:01 +0000 (05:15 +0000)]
MC: mark COFF .drectve section as REMOVE

The .drectve section should be marked as IMAGE_SCN_LNK_REMOVE.  This matches what
the MSVC toolchain does and accurately reflects that this section should not be
emitted into the final binary.  This section is merely information for the
linker, comprising of additional linker directives.

llvm-svn: 209273

10 years ago[C++11] Use 'nullptr'. CodeGen edition.
Craig Topper [Wed, 21 May 2014 05:09:00 +0000 (05:09 +0000)]
[C++11] Use 'nullptr'. CodeGen edition.

llvm-svn: 209272

10 years ago[PECOFF] Make COFFObjectReader thread-safe.
Rui Ueyama [Wed, 21 May 2014 04:17:05 +0000 (04:17 +0000)]
[PECOFF] Make COFFObjectReader thread-safe.

llvm-svn: 209271

10 years agoReExported symbols can point to a library that doesn't actually
Jim Ingham [Wed, 21 May 2014 03:58:03 +0000 (03:58 +0000)]
ReExported symbols can point to a library that doesn't actually
contain the symbol, but just reexports wholesale from another
library.  Handle this case.

<rdar://problem/16977589>

llvm-svn: 209270

10 years ago[modules] Add module maps for LLVM. These are not quite ready for prime-time
Richard Smith [Wed, 21 May 2014 02:46:14 +0000 (02:46 +0000)]
[modules] Add module maps for LLVM. These are not quite ready for prime-time
yet, but only a few more Clang patches need to land. (I have 'ninja check'
passing locally.)

llvm-svn: 209269

10 years agoutils/CmpDriver: add brief documentation to indicate what this does
Alp Toker [Wed, 21 May 2014 02:08:10 +0000 (02:08 +0000)]
utils/CmpDriver: add brief documentation to indicate what this does

llvm-svn: 209268

10 years agoARM: correct bundle generation for MOV32T relocations
Saleem Abdulrasool [Wed, 21 May 2014 01:25:24 +0000 (01:25 +0000)]
ARM: correct bundle generation for MOV32T relocations

Although the previous code would construct a bundle and add the correct elements
to it, it would not finalise the bundle.  This resulted in the InternalRead
markers not being added to the MachineOperands nor, more importantly, the
externally visible defs to the bundle itself.  So, although the bundle was not
exposing the def, the generated code would be correct because there was no
optimisations being performed.  When optimisations were enabled, the post
register allocator would kick in, and the hazard recognizer would reorder
operations around the load which would define the value being operated upon.

Rather than manually constructing the bundle, simply construct and finalise the
bundle via the finaliseBundle call after both MIs have been emitted.  This
improves the code generation with optimisations where IMAGE_REL_ARM_MOV32T
relocations are emitted.

The changes to the other tests are the result of the bundle generation
preventing the scheduler from hoisting the moves across the loads.  The net
effect of the generated code is equivalent, but, is much more identical to what
is actually being lowered.

llvm-svn: 209267

10 years agoSourceManager: Use setMainFileID() consistently
Alp Toker [Wed, 21 May 2014 01:12:41 +0000 (01:12 +0000)]
SourceManager: Use setMainFileID() consistently

Eliminate createMainFileID() / createMainFileIDForMemBuffer() utility
functions. These didn't add much convenience and conflated two distinct
operations.

This change makes things easier to follow by providing a consistent interface
and getting rid of a bunch of cast-to-voids.

llvm-svn: 209266

10 years ago[modules] Add initial module map for libc++.
Richard Smith [Wed, 21 May 2014 00:33:49 +0000 (00:33 +0000)]
[modules] Add initial module map for libc++.

llvm-svn: 209265

10 years ago[objcmt] Make sure we don't edit the return type to add 'instancetype' if the return...
Argyrios Kyrtzidis [Wed, 21 May 2014 00:24:20 +0000 (00:24 +0000)]
[objcmt] Make sure we don't edit the return type to add 'instancetype' if the return type is already that.

rdar://16961577

llvm-svn: 209264

10 years agoThis command line option is only used in one place. Move it there and
Eric Christopher [Wed, 21 May 2014 00:20:01 +0000 (00:20 +0000)]
This command line option is only used in one place. Move it there and
rename it to something more descriptive.

llvm-svn: 209263

10 years agoAdd a comment here.
Eric Christopher [Wed, 21 May 2014 00:02:50 +0000 (00:02 +0000)]
Add a comment here.

llvm-svn: 209262

10 years agoUpdate for paired llvm commit with AsmVerbose.
Eric Christopher [Wed, 21 May 2014 00:00:03 +0000 (00:00 +0000)]
Update for paired llvm commit with AsmVerbose.

llvm-svn: 209261

10 years agoRemove test. Replacing it with a backend test with the optimized IR.
Eric Christopher [Wed, 21 May 2014 00:00:01 +0000 (00:00 +0000)]
Remove test. Replacing it with a backend test with the optimized IR.

llvm-svn: 209260

10 years agoMove this test to the backend from the frontend.
Eric Christopher [Tue, 20 May 2014 23:59:54 +0000 (23:59 +0000)]
Move this test to the backend from the frontend.

llvm-svn: 209259

10 years agoMove the verbose asm option to be part of the options struct and
Eric Christopher [Tue, 20 May 2014 23:59:50 +0000 (23:59 +0000)]
Move the verbose asm option to be part of the options struct and
set appropriately.

llvm-svn: 209258

10 years agolibclang: Give each VirtualFileOverlay unit test its own name
Justin Bogner [Tue, 20 May 2014 23:52:11 +0000 (23:52 +0000)]
libclang: Give each VirtualFileOverlay unit test its own name

llvm-svn: 209257

10 years agoXFAIL ptrace test on arm
Greg Fitzgerald [Tue, 20 May 2014 23:31:26 +0000 (23:31 +0000)]
XFAIL ptrace test on arm

The patch adds better target_triple and target_arch defaults for lit tests,
which allows us to XFAIL tests based on architecture.

Was:
  target_triple = LLVM_DEFAULT_TARGET_TRIPLE
  target_arch = HOST_ARCH

Now:
  target_triple = COMPILER_RT_TEST_TARGET_TRIPLE
                , otherwise LLVM_DEFAULT_TARGET_TRIPLE
  target_arch = first item in COMPILER_RT_TEST_TARGET_TRIPLE

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

llvm-svn: 209256

10 years agoMake this test emit llvm IR rather than assembly.
Eric Christopher [Tue, 20 May 2014 23:23:51 +0000 (23:23 +0000)]
Make this test emit llvm IR rather than assembly.

llvm-svn: 209255

10 years ago[PECOFF] Acquire mutex before accessing shared objects.
Rui Ueyama [Tue, 20 May 2014 23:05:09 +0000 (23:05 +0000)]
[PECOFF] Acquire mutex before accessing shared objects.

addResolvableSymbols() queues input files, and readAllSymbols() reads
from them. In practice it's currently safe because they are called from
a single thread. But it's not guaranteed.

Also, acquiring the same mutex is needed not to see inconsistent memory
contents that is allowed in the C++ memory model.

llvm-svn: 209254

10 years agoUpdate MachOObjectFile::getSymbolAddress so it returns UnknownAddressOrSize
Kevin Enderby [Tue, 20 May 2014 23:04:47 +0000 (23:04 +0000)]
Update MachOObjectFile::getSymbolAddress so it returns UnknownAddressOrSize
for undefined symbols, so it matches what COFFObjectFile::getSymbolAddress
does.  This allows llvm-nm to print spaces instead of 0’s for the value
of undefined symbols in Mach-O files.

To make this change other uses of MachOObjectFile::getSymbolAddress
are updated to handle when the Value is returned as UnknownAddressOrSize.
Which is needed to keep two of the ExecutionEngine tests working for example.

llvm-svn: 209253

10 years agoFix test added in r209242: llc shouldn't create files in source tree
Alexey Samsonov [Tue, 20 May 2014 22:40:31 +0000 (22:40 +0000)]
Fix test added in r209242: llc shouldn't create files in source tree

llvm-svn: 209252

10 years agoRevert "DebugInfo: Assume all subprogram DIEs have been created before any abstract...
David Blaikie [Tue, 20 May 2014 22:33:09 +0000 (22:33 +0000)]
Revert "DebugInfo: Assume all subprogram DIEs have been created before any abstract subprograms are constructed."

This reverts commit r209178.

This seems to be asserting in an LTO build on some internal Apple
buildbots. No upstream reproduction (and I don't have an LLVM-aware gold
built right now to reproduce it personally) but it's a small patch & the
failure's semi-plausible so I'm going to revert first while I try to
reproduce this.

llvm-svn: 209251

10 years agoVirtualFileSystem: Fix false positives in YAMLVFSWriter::containedIn
Justin Bogner [Tue, 20 May 2014 22:12:58 +0000 (22:12 +0000)]
VirtualFileSystem: Fix false positives in YAMLVFSWriter::containedIn

Checking if a path starts with another path isn't sufficient for
determining if one is contained within the heirarchy of the other.
We need to ensure that the substring ends at a directory boundary.

llvm-svn: 209250

10 years ago[ubsan] fix vptr test on ARM
Greg Fitzgerald [Tue, 20 May 2014 22:07:58 +0000 (22:07 +0000)]
[ubsan] fix vptr test on ARM

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

llvm-svn: 209249

10 years agoRun common and profile tests in cross-compiled builds.
Greg Fitzgerald [Tue, 20 May 2014 22:04:27 +0000 (22:04 +0000)]
Run common and profile tests in cross-compiled builds.

Route target_cflags to common and profile tests

llvm-svn: 209248

10 years agoReduce string duplication
Alp Toker [Tue, 20 May 2014 22:03:47 +0000 (22:03 +0000)]
Reduce string duplication

If we're so keen on saving a dynamic allocation to add the trailing space, we
might as well do it in style.

llvm-svn: 209247

10 years agoRAV reunification: merge Lambda body visitation to DRAV
Alp Toker [Tue, 20 May 2014 22:03:39 +0000 (22:03 +0000)]
RAV reunification: merge Lambda body visitation to DRAV

llvm-svn: 209246

10 years agoRAV reunification: merge DISPATCH_STMT() macro back to standard RAV
Alp Toker [Tue, 20 May 2014 22:03:27 +0000 (22:03 +0000)]
RAV reunification: merge DISPATCH_STMT() macro back to standard RAV

Also add the missing undef in both files.

llvm-svn: 209245

10 years agoRAV reunification: merge r190728
Alp Toker [Tue, 20 May 2014 22:03:18 +0000 (22:03 +0000)]
RAV reunification: merge r190728

llvm-svn: 209244

10 years ago[PECOFF] Do not use anonymous namespace in a header.
Rui Ueyama [Tue, 20 May 2014 21:58:34 +0000 (21:58 +0000)]
[PECOFF] Do not use anonymous namespace in a header.

llvm-svn: 209243

10 years ago[ARM64] PR19792: Fix cycle in DAG after performPostLD1Combine
Adam Nemet [Tue, 20 May 2014 21:47:07 +0000 (21:47 +0000)]
[ARM64] PR19792: Fix cycle in DAG after performPostLD1Combine

Povray and dealII currently assert with "Overran sorted position" in
AssignTopologicalOrder.  The problem is that performPostLD1Combine can
introduce cycles.

Consider:

(insert_vector_elt (INSERT_SUBREG undef,
                                  (load (add %vreg0, Constant<8>), undef),  <= A
                                  TargetConstant<2>),
                   (load %vreg0, undef),                                    <= B
                   Constant<1>)

This is turned into a LD1LANEpost node.  However the address in A is not a
valid user of the post-incremented address of B in LD1LANEpost.

llvm-svn: 209242

10 years agoVirtualFileSystem: Add YAMLVFSWriter to generate VFS mapping files
Justin Bogner [Tue, 20 May 2014 21:43:27 +0000 (21:43 +0000)]
VirtualFileSystem: Add YAMLVFSWriter to generate VFS mapping files

This moves the logic to write a JSON VFS mapping from the C api into
VirtualFileSystem, so that we can use it internally.

No functional change.

llvm-svn: 209241

10 years agoUnbreak the sanitizer buildbots after r209226 due to SROA issue described in http...
David Blaikie [Tue, 20 May 2014 21:40:13 +0000 (21:40 +0000)]
Unbreak the sanitizer buildbots after r209226 due to SROA issue described in reviews.llvm.org/D3714

Undecided whether this should include a test case - SROA produces bad
dbg.value metadata describing a value for a reference that is actually
the value of the thing the reference refers to. For now, loosening the
assert lets this not assert, but it's still bogus/wrong output...

If someone wants to tell me to add a test, I'm willing/able, just
undecided. Hopefully we'll get SROA fixed soon & we can tighten up this
assertion again.

llvm-svn: 209240

10 years agoUpdate for llvm change to avoid having global flag setting in TargetMachine.
Eric Christopher [Tue, 20 May 2014 21:25:41 +0000 (21:25 +0000)]
Update for llvm change to avoid having global flag setting in TargetMachine.

llvm-svn: 209239

10 years agoMove the function and data section flags into the options struct and
Eric Christopher [Tue, 20 May 2014 21:25:34 +0000 (21:25 +0000)]
Move the function and data section flags into the options struct and
make the functions to set them non-static.
Move and rename the llvm specific backend options to avoid conflicting
with the clang option.

Paired with a backend commit to update.

llvm-svn: 209238

10 years agoUpdate .arcconfig to point to reviews.llvm.org
Reid Kleckner [Tue, 20 May 2014 21:24:59 +0000 (21:24 +0000)]
Update .arcconfig to point to reviews.llvm.org

Mostly a test review and commit.

Reviewers: tfiala

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

llvm-svn: 209237

10 years agoRevert r209235 as it broke two tests:
Kevin Enderby [Tue, 20 May 2014 21:10:15 +0000 (21:10 +0000)]
Revert r209235 as it broke two tests:
Failing Tests (2):
    LLVM :: ExecutionEngine/MCJIT/stubs-sm-pic.ll
    LLVM :: ExecutionEngine/MCJIT/stubs.ll

llvm-svn: 209236

10 years agoUpdate MachOObjectFile::getSymbolAddress so it returns UnknownAddressOrSize
Kevin Enderby [Tue, 20 May 2014 20:32:18 +0000 (20:32 +0000)]
Update MachOObjectFile::getSymbolAddress so it returns UnknownAddressOrSize
for undefined symbols.  Allowing llvm-nm to print spaces instead of 0’s for
the value of undefined symbols in Mach-O files.

llvm-svn: 209235

10 years agoChange gdb remote test support multi-request format.
Todd Fiala [Tue, 20 May 2014 20:02:08 +0000 (20:02 +0000)]
Change gdb remote test support multi-request format.

The multi request-response test infrastructure support was adding
the optional request suffix iteration index as decimal but it needed
to be hex per spec.  This change fixes that.

llvm-svn: 209234

10 years agoCleaning up some range-based for loops so that the automatic type deduction is more...
Aaron Ballman [Tue, 20 May 2014 19:47:14 +0000 (19:47 +0000)]
Cleaning up some range-based for loops so that the automatic type deduction is more explicit about pointers and const. Did some minor drive-by const correctness fixes and identifier updates as well. No functional changes.

llvm-svn: 209233

10 years agoRevert r209231, "Update AttributeReference.rst."
Peter Collingbourne [Tue, 20 May 2014 19:38:07 +0000 (19:38 +0000)]
Revert r209231, "Update AttributeReference.rst."

According to Aaron, this is being generated on the server now.

llvm-svn: 209232

10 years agoUpdate AttributeReference.rst.
Peter Collingbourne [Tue, 20 May 2014 19:27:39 +0000 (19:27 +0000)]
Update AttributeReference.rst.

llvm-svn: 209231

10 years ago[LSR] Canonicalize reg1 + ... + regN into reg1 + ... + 1*regN.
Quentin Colombet [Tue, 20 May 2014 19:25:04 +0000 (19:25 +0000)]
[LSR] Canonicalize reg1 + ... + regN into reg1 + ... + 1*regN.

This commit introduces a canonical representation for the formulae.
Basically, as soon as a formula has more that one base register, the scaled
register field is used for one of them. The register put into the scaled
register is preferably a loop variant.
The commit refactors how the formulae are built in order to produce such
representation.
This yields a more accurate, but still perfectible, cost model.

<rdar://problem/16731508>

llvm-svn: 209230

10 years agoFix testcase from r209228
Duncan P. N. Exon Smith [Tue, 20 May 2014 19:20:23 +0000 (19:20 +0000)]
Fix testcase from r209228

llvm-svn: 209229

10 years agoGlobalValue: Testcase for hidden visibility and local linkage
Duncan P. N. Exon Smith [Tue, 20 May 2014 19:04:31 +0000 (19:04 +0000)]
GlobalValue: Testcase for hidden visibility and local linkage

This is a testcase for r209227, a change in LLVM that automatically sets
visibility to default when the linkage is changed to local (rather than
asserting).

What this testcase triggers is hard to reproduce otherwise:  the
`GlobalValue` is created (with non-local linkage), the visibility is set
to hidden, and then the linkage is set to local.

PR19760

llvm-svn: 209228

10 years agoGlobalValue: Automatically reset visibility when setting local linkage
Duncan P. N. Exon Smith [Tue, 20 May 2014 19:00:58 +0000 (19:00 +0000)]
GlobalValue: Automatically reset visibility when setting local linkage

r208264 started asserting in `setLinkage()` and `setVisibility()` that
visibility and linkage are compatible.  There are a few places in clang
where visibility is set first, and then linkage later, so the assert
fires.  In `setLinkage()`, it's clear what the visibility *should* be,
so rather than updating all the call sites just automatically fix the
visibility.

The testcase for this is for *clang*, so it'll follow separately in cfe.

PR19760

llvm-svn: 209227

10 years agoFix test breakage introduced in r209223.
David Blaikie [Tue, 20 May 2014 18:36:35 +0000 (18:36 +0000)]
Fix test breakage introduced in r209223.

Oops, broke the broken enum constants again.

llvm-svn: 209226

10 years agoRewrite calculateDbgValueHistory to make it (hopefully) more transparent.
Alexey Samsonov [Tue, 20 May 2014 18:34:54 +0000 (18:34 +0000)]
Rewrite calculateDbgValueHistory to make it (hopefully) more transparent.

This change preserves the original algorithm of generating history
for user variables, but makes it more clear.

High-level description of algorithm:
Scan all the machine basic blocks and machine instructions in the order
they are emitted to the object file. Do the following:
1) If we see a DBG_VALUE instruction, add it to the history of the
corresponding user variable. Keep track of all user variables, whose
locations are described by a register.
2) If we see a regular instruction, look at all the registers it clobbers,
and terminate the location range for all variables described by these registers.
3) At the end of the basic block, terminate location ranges for all
user variables described by some register.

Although this change shouldn't be user-visible (the contents of .debug_loc section
should be the same), it changes some internal assumptions about the set
of instructions used to track the variable locations. Watching the bots.

llvm-svn: 209225

10 years agoFixed spelling.
Yaron Keren [Tue, 20 May 2014 18:23:05 +0000 (18:23 +0000)]
Fixed spelling.

llvm-svn: 209224

10 years agoPR19767: DebugInfo emission of pointer constants.
David Blaikie [Tue, 20 May 2014 18:21:51 +0000 (18:21 +0000)]
PR19767: DebugInfo emission of pointer constants.

In refactoring DwarfUnit::isUnsignedDIType I restricted it to only work
on values with signedness (unsigned or signed), asserting on anything
else (which did uncover some bugs). But it turns out that we do need to
emit constants of signless data, such as pointer constants - only null
pointer constants are known to need this so far, but it's conceivable
that there might be non-null pointer constants at some point (hardcoded
address offsets for device drivers?).

This patch just uses 'unsigned' for signless data such as pointer
constants. Arguably we could use signless representations
(DW_FORM_dataN) instead, allowing a trinary result from isUnsignedDIType
(signed, unsigned, signless), but this seems reasonable for now.

llvm-svn: 209223

10 years agoAvoids DCE on write_register
Renato Golin [Tue, 20 May 2014 17:40:03 +0000 (17:40 +0000)]
Avoids DCE on write_register

llvm-svn: 209222

10 years agoAdd a check for tautological bitwise comparisons to -Wtautological-compare.
Jordan Rose [Tue, 20 May 2014 17:31:11 +0000 (17:31 +0000)]
Add a check for tautological bitwise comparisons to -Wtautological-compare.

This catches issues like:

if ((x & 8) == 4) { ... }
if ((x | 4) != 3) { ... }

Patch by Anders Rönnholm!

llvm-svn: 209221

10 years agoMake the wording for the flatten docs a little clearer.
Peter Collingbourne [Tue, 20 May 2014 17:30:03 +0000 (17:30 +0000)]
Make the wording for the flatten docs a little clearer.

llvm-svn: 209220

10 years ago[PowerPC] PR19796: Also match ISD::TargetConstant in isIntS16Immediate
Adam Nemet [Tue, 20 May 2014 17:20:34 +0000 (17:20 +0000)]
[PowerPC] PR19796: Also match ISD::TargetConstant in isIntS16Immediate

The SplitIndexingFromLoad changes exposed a latent isel bug in the PowerPC64
backend.  We matched an immediate offset with STWX8 even though it only
supports register offset.

The culprit is the complex-pattern predicate, SelectAddrIdx, which decides
that if the offset is not ISD::Constant it must be a register.

Many thanks to Bill Schmidt for testing this.

llvm-svn: 209219

10 years agoFix testcase for case.
Eric Christopher [Tue, 20 May 2014 17:15:31 +0000 (17:15 +0000)]
Fix testcase for case.

llvm-svn: 209218

10 years agoImplement the flatten attribute.
Peter Collingbourne [Tue, 20 May 2014 17:12:51 +0000 (17:12 +0000)]
Implement the flatten attribute.

This is a GNU attribute that causes calls within the attributed function
to be inlined where possible. It is implemented by giving such calls the
alwaysinline attribute.

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

llvm-svn: 209217

10 years agoClean up language and grammar.
Eric Christopher [Tue, 20 May 2014 17:11:11 +0000 (17:11 +0000)]
Clean up language and grammar.

Based on a patch by jfcaron3@gmail.com!
PR19806

llvm-svn: 209216

10 years agoClean up language and grammar.
Eric Christopher [Tue, 20 May 2014 17:10:39 +0000 (17:10 +0000)]
Clean up language and grammar.

Based on a patch by jfcaron3@gmail.com!
PR19806

llvm-svn: 209215

10 years agoGo via uintptr_t when casting away constness, otherwise GCC will warn
Joerg Sonnenberger [Tue, 20 May 2014 16:37:07 +0000 (16:37 +0000)]
Go via uintptr_t when casting away constness, otherwise GCC will warn
when using -Wcast-qual.

llvm-svn: 209214

10 years agoFix typos
Alp Toker [Tue, 20 May 2014 16:17:53 +0000 (16:17 +0000)]
Fix typos

llvm-svn: 209213

10 years agoclang/test/SemaCXX/err_init_conversion_failed.cpp: Tweak for i686-msvc.
NAKAMURA Takumi [Tue, 20 May 2014 15:44:42 +0000 (15:44 +0000)]
clang/test/SemaCXX/err_init_conversion_failed.cpp: Tweak for i686-msvc.

For targeting i686-msvc, declarations are seen as thiscall like;

  void (template_test::S::*)(const int &) __attribute__((thiscall))
  void (template_test::S::*)(int) __attribute__((thiscall))

It didn't affect x86_64-msvc.

llvm-svn: 209212