platform/upstream/llvm.git
9 years ago[WinEH] Add 32-bit SEH state table emission prototype
Reid Kleckner [Tue, 9 Jun 2015 21:42:19 +0000 (21:42 +0000)]
[WinEH] Add 32-bit SEH state table emission prototype

This gets all the handler info through to the asm printer and we can
look at the .xdata tables now. I've convinced one small catch-all test
case to work, but other than that, it would be a stretch to say this is
functional.

The state numbering algorithm avoids doing any scope reconstruction as
we do for C++ to simplify the implementation.

llvm-svn: 239433

9 years ago[AArch64] Remove an overly conservative check when generating store pairs.
Chad Rosier [Tue, 9 Jun 2015 20:59:41 +0000 (20:59 +0000)]
[AArch64] Remove an overly conservative check when generating store pairs.

Store instructions do not modify register values and therefore it's safe
to form a store pair even if the source register has been read in between
the two store instructions.

Previously, the read of w1 (see below) prevented the formation of a stp.

        str      w0, [x2]
        ldr     w8, [x2, #8]
        add      w0, w8, w1
        str     w1, [x2, #4]
        ret

We now generate the following code.

        stp      w0, w1, [x2]
        ldr     w8, [x2, #8]
        add      w0, w8, w1
        ret

All correctness tests with -Ofast on A57 with Spec200x and EEMBC pass.
Performance results for SPEC2K were within noise.

llvm-svn: 239432

9 years agoUse AlignOf traits to enable static_assert.
Pete Cooper [Tue, 9 Jun 2015 20:58:03 +0000 (20:58 +0000)]
Use AlignOf traits to enable static_assert.

This is better than runtime asserts.  Thanks to David Blaikie for the help here.

llvm-svn: 239431

9 years agoReplace loop with std::equal. NFC intended.
Benjamin Kramer [Tue, 9 Jun 2015 20:41:21 +0000 (20:41 +0000)]
Replace loop with std::equal. NFC intended.

llvm-svn: 239430

9 years agoReduce duplication in MCSymbol Name handling. NFC>
Pete Cooper [Tue, 9 Jun 2015 20:41:08 +0000 (20:41 +0000)]
Reduce duplication in MCSymbol Name handling.  NFC>

Based on feedback to r239428 by David Blaikie, use const_cast to reduce
duplication of the const and non-const versions of getNameEntryPtr.

Also have that method return the pointer to the name directly instead
of users having to then get the name from the union.

Finally, add a FIXME that we should use a static_assert once available in
the new operator.

llvm-svn: 239429

9 years agoMake MCSymbol::Name be a union of uint64_t and a pointer.
Pete Cooper [Tue, 9 Jun 2015 19:56:05 +0000 (19:56 +0000)]
Make MCSymbol::Name be a union of uint64_t and a pointer.

This should hopefully fix the 32-bit bots which were allocating space for a pointer
but needed to be aligned to 64-bits.

Now we allocate enough space for a uint64_t and a pointer and cast to the appropriate storage

llvm-svn: 239428

9 years agoRemove DisableTailCalls from TargetOptions and the code in resetTargetOptions
Akira Hatanaka [Tue, 9 Jun 2015 19:07:19 +0000 (19:07 +0000)]
Remove DisableTailCalls from TargetOptions and the code in resetTargetOptions
that was resetting it.

Remove the uses of DisableTailCalls in subclasses of TargetLowering and use
the value of function attribute "disable-tail-calls" instead. Also,
unconditionally add pass TailCallElim to the pipeline and check the function
attribute at the start of runOnFunction to disable the pass on a per-function
basis.

This is part of the work to remove TargetMachine::resetTargetOptions, and since
DisableTailCalls was the last non-fast-math option that was being reset in that
function, we should be able to remove the function entirely after the work to
propagate IR-level fast-math flags to DAG nodes is completed.

Out-of-tree users should remove the uses of DisableTailCalls and make changes
to attach attribute "disable-tail-calls"="true" or "false" to the functions in
the IR.

rdar://problem/13752163

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

llvm-svn: 239427

9 years agoAttach attribute "disable-tail-calls" to the functions in the IR.
Akira Hatanaka [Tue, 9 Jun 2015 19:04:36 +0000 (19:04 +0000)]
Attach attribute "disable-tail-calls" to the functions in the IR.

This commit adds back the code that seems to have been dropped unintentionally
in r176985.

rdar://problem/13752163

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

llvm-svn: 239426

9 years ago[bpf] enable BPF backend in autoconf build
Alexei Starovoitov [Tue, 9 Jun 2015 18:53:30 +0000 (18:53 +0000)]
[bpf] enable BPF backend in autoconf build

llvm-svn: 239425

9 years agoChange from alignof to llvm::alignOf to appease Visual Studio
Pete Cooper [Tue, 9 Jun 2015 18:50:18 +0000 (18:50 +0000)]
Change from alignof to llvm::alignOf to appease Visual Studio

llvm-svn: 239424

9 years agoAllocate space for MCSymbol::Name only if required.
Pete Cooper [Tue, 9 Jun 2015 18:36:13 +0000 (18:36 +0000)]
Allocate space for MCSymbol::Name only if required.

Similarly to User which allocates a number of Use's prior to the this pointer,
allocate space for the Name* for MCSymbol only when we need a name.

Given that an MCSymbol is 48-bytes on 64-bit systems, this saves a decent % of space.

Given the verify_uselistorder test case with debug info and llc, 50k symbols have names
out of 700k so this optimises for the common case of temporary unnamed symbols.

Reviewed by David Blaikie.

llvm-svn: 239423

9 years agoMergeFunctions: Don't replace a weak function use by another equivalent weak function
Arnold Schwaighofer [Tue, 9 Jun 2015 18:19:17 +0000 (18:19 +0000)]
MergeFunctions: Don't replace a weak function use by another equivalent weak function

We don't know whether the weak functions definition is the definitive definition.

rdar://21303727

llvm-svn: 239422

9 years ago[ItaniumMangle] Mangle long double as __float128 for some Power targets
David Majnemer [Tue, 9 Jun 2015 18:05:33 +0000 (18:05 +0000)]
[ItaniumMangle] Mangle long double as __float128 for some Power targets

GCC mangles long double like __float128 in order to support
compatibility with ABI variants which had a different interpretation of
long double.

This fixes PR23791.

llvm-svn: 239421

9 years agoRevert "[DWARF] Fix a few corner cases in expression emission"
David Blaikie [Tue, 9 Jun 2015 18:01:51 +0000 (18:01 +0000)]
Revert "[DWARF] Fix a few corner cases in expression emission"

This reverts commit r239380 due to apparently GDB regressions:
http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/22562

llvm-svn: 239420

9 years agoRename `FileSpec::IsRelativeToCurrentWorkingDirectory` to `IsRelative`.
Chaoren Lin [Tue, 9 Jun 2015 17:54:27 +0000 (17:54 +0000)]
Rename `FileSpec::IsRelativeToCurrentWorkingDirectory` to `IsRelative`.

Summary:
`IsRelativeToCurrentWorkingDirectory` was misleading, because relative paths
are sometimes appended to other directories, not just the cwd. Plus, the new
name is shorter. Also added `IsAbsolute` for completeness.

Reviewers: clayborg, ovyalov

Reviewed By: ovyalov

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 239419

9 years agoCOFF: Split SymbolTable::addCombinedLTOObject. NFC.
Rui Ueyama [Tue, 9 Jun 2015 17:52:17 +0000 (17:52 +0000)]
COFF: Split SymbolTable::addCombinedLTOObject. NFC.

llvm-svn: 239418

9 years agoRevert "Re-land r236052, "[SEH] Add 32-bit lowering code for __try""
Reid Kleckner [Tue, 9 Jun 2015 17:49:42 +0000 (17:49 +0000)]
Revert "Re-land r236052, "[SEH] Add 32-bit lowering code for __try""

This reverts commit r239415. This was committed accidentally, LLVM isn't
ready for this.

llvm-svn: 239417

9 years agoDisable style-on-command-line test on Windows
Reid Kleckner [Tue, 9 Jun 2015 17:47:59 +0000 (17:47 +0000)]
Disable style-on-command-line test on Windows

llvm-svn: 239416

9 years agoRe-land r236052, "[SEH] Add 32-bit lowering code for __try"
Reid Kleckner [Tue, 9 Jun 2015 17:47:50 +0000 (17:47 +0000)]
Re-land r236052, "[SEH] Add 32-bit lowering code for __try"

This reverts r236167.

LLVM should be ready for this now.

llvm-svn: 239415

9 years agoXFail pexpect tests for Windows hosts.
Chaoren Lin [Tue, 9 Jun 2015 17:39:27 +0000 (17:39 +0000)]
XFail pexpect tests for Windows hosts.

Reviewers: vharron, zturner

Subscribers: lldb-commits

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

llvm-svn: 239414

9 years agoCOFF: Update comment.
Rui Ueyama [Tue, 9 Jun 2015 16:52:56 +0000 (16:52 +0000)]
COFF: Update comment.

llvm-svn: 239413

9 years agoThe constant initialization for globals in NVPTX is generated as an
Samuel Antao [Tue, 9 Jun 2015 16:29:34 +0000 (16:29 +0000)]
The constant initialization for globals in NVPTX is generated as an
array of bytes. The generation of this byte arrays was expecting
the host to be little endian, which prevents big endian hosts to be
used in the generation of the PTX code. This patch fixes the
problem by changing the way the bytes are extracted so that it
works for either little and big endian.

llvm-svn: 239412

9 years agoAdd more wrappers for symbol APIs to the C API.
Eli Bendersky [Tue, 9 Jun 2015 15:57:30 +0000 (15:57 +0000)]
Add more wrappers for symbol APIs to the C API.

This represents some of the functionality we expose in the llvmlite Python
binding.

Patch by Antoine Pitrou

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

llvm-svn: 239411

9 years ago[bpf] make BPF backend non-experimental
Alexei Starovoitov [Tue, 9 Jun 2015 15:46:00 +0000 (15:46 +0000)]
[bpf] make BPF backend non-experimental

only cmake build change. autoconf build and docs will follow

email thread:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-June/thread.html#86523

llvm-svn: 239410

9 years agoRemove object_error::success and use std::error_code() instead
Rui Ueyama [Tue, 9 Jun 2015 15:20:42 +0000 (15:20 +0000)]
Remove object_error::success and use std::error_code() instead

make_error_code(object_error) is slow because object::object_category()
uses a ManagedStatic variable. But the real problem is that the function is
called too frequently. This patch uses std::error_code() instead of
object_error::success. In most cases, we return "success", so this patch
reduces number of function calls to that function.

http://reviews.llvm.org/D10333

llvm-svn: 239409

9 years ago[PowerPC] Reformat altivec.h with clang-format
Bill Seurer [Tue, 9 Jun 2015 14:39:47 +0000 (14:39 +0000)]
[PowerPC] Reformat altivec.h with clang-format

This revision just fixes the formatting of altivec.h.

llvm-svn: 239408

9 years agoMove target-specific Sema test to its own file.
Jonathan Roelofs [Tue, 9 Jun 2015 14:30:17 +0000 (14:30 +0000)]
Move target-specific Sema test to its own file.

Fixing the build-break introduced in r239406.

llvm-svn: 239407

9 years agoFix printing of GCCAsmExprs with input or output arguments.
Jonathan Roelofs [Tue, 9 Jun 2015 14:13:31 +0000 (14:13 +0000)]
Fix printing of GCCAsmExprs with input or output arguments.

Patch by Nick Sumner!

llvm-svn: 239406

9 years agoRecommit "[mips] [IAS] Restore STI.FeatureBits in .set pop." (r239144).
Toma Tabacu [Tue, 9 Jun 2015 13:33:26 +0000 (13:33 +0000)]
Recommit "[mips] [IAS] Restore STI.FeatureBits in .set pop." (r239144).

Specified the llvm namespace for the 2 calls to make_unique() which caused
compilation errors in Visual Studio 2013.

llvm-svn: 239405

9 years agoclang-format: Support //!-comments, increase test coverage.
Daniel Jasper [Tue, 9 Jun 2015 13:16:54 +0000 (13:16 +0000)]
clang-format: Support //!-comments, increase test coverage.

llvm-svn: 239404

9 years agoX86-MPX: Implemented encoding for MPX instructions.
Elena Demikhovsky [Tue, 9 Jun 2015 13:02:10 +0000 (13:02 +0000)]
X86-MPX: Implemented encoding for MPX instructions.
Added encoding tests.

llvm-svn: 239403

9 years agoRemove rm invocations where the file is immediately rewritten later.
Benjamin Kramer [Tue, 9 Jun 2015 12:41:02 +0000 (12:41 +0000)]
Remove rm invocations where the file is immediately rewritten later.

This may or may not help making this test less flaky on windows. There's
a race condition in lit somewhere.

llvm-svn: 239402

9 years agoRemove unused diagnostics.
Benjamin Kramer [Tue, 9 Jun 2015 12:17:19 +0000 (12:17 +0000)]
Remove unused diagnostics.

-Wreceiver-is-weak is unused but should be ignored, move it to the list
of diagnostic groups.

llvm-svn: 239401

9 years agoRemoving spurious semi colons; NFC.
Aaron Ballman [Tue, 9 Jun 2015 12:04:17 +0000 (12:04 +0000)]
Removing spurious semi colons; NFC.

llvm-svn: 239400

9 years agoRemoving spurious semi colons; NFC.
Aaron Ballman [Tue, 9 Jun 2015 12:03:46 +0000 (12:03 +0000)]
Removing spurious semi colons; NFC.

llvm-svn: 239399

9 years agoclang-format: [JS] Hotfix for runtime issue with deeply nested JS code.
Daniel Jasper [Tue, 9 Jun 2015 11:39:22 +0000 (11:39 +0000)]
clang-format: [JS] Hotfix for runtime issue with deeply nested JS code.

I have not succeeded in writing a proper test case for this yet and we
also need to solve the underlying fundamental problem of trying too
many combinations with nested blocks (basically this somewhat works
around our Dijkstra algorithm). Preventing this linebreak is good
anyways as usually the penalties never make us choose it (that's why I
can't create a test) and it also looks ugly.

Also cleaned up state comparison code that I discovered while hunting
this down.

llvm-svn: 239398

9 years agoRevert "[mips] [IAS] Add support for BNE and BEQ with an immediate operand." (r239396).
Toma Tabacu [Tue, 9 Jun 2015 10:43:49 +0000 (10:43 +0000)]
Revert "[mips] [IAS] Add support for BNE and BEQ with an immediate operand." (r239396).

It was breaking buildbots.

llvm-svn: 239397

9 years ago[mips] [IAS] Add support for BNE and BEQ with an immediate operand.
Toma Tabacu [Tue, 9 Jun 2015 10:34:31 +0000 (10:34 +0000)]
[mips] [IAS] Add support for BNE and BEQ with an immediate operand.

Summary:
For some branches, GAS accepts an immediate instead of the 2nd register operand.
We only implement this for BNE and BEQ for now. Other branch instructions can be added later, if needed.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: seanbruno, emaste, llvm-commits

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

llvm-svn: 239396

9 years ago[nvptx] Only support the 'm' inline assembly memory constraint. NFC.
Daniel Sanders [Tue, 9 Jun 2015 10:34:05 +0000 (10:34 +0000)]
[nvptx] Only support the 'm' inline assembly memory constraint. NFC.

Summary:
NVPTX doesn't seem to support any additional constraints. Therefore remove
the target hook.

No functional change intended.

Reviewers: jholewinski

Reviewed By: jholewinski

Subscribers: jholewinski, llvm-commits

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

llvm-svn: 239395

9 years ago[lldb-server][MIPS64] Assigning generic register numbers in register info for mips64
Sagar Thakur [Tue, 9 Jun 2015 10:29:29 +0000 (10:29 +0000)]
[lldb-server][MIPS64] Assigning generic register numbers in register info for mips64

    Use generic register numbers for argument registers, fp, ra and flag register in register info.

llvm-svn: 239394

9 years agoclang-cl: Ignore the /o option when /P is specified.
Greg Bedwell [Tue, 9 Jun 2015 10:24:06 +0000 (10:24 +0000)]
clang-cl: Ignore the /o option when /P is specified.

This matches the cl.exe behavior (tested with 18.00.31101).  In order to
specify an output file for /P, use the /Fi option instead.

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

llvm-svn: 239393

9 years ago[ADT] Assert that SmallVectorBase::grow_pod() successfully reallocates memory.
Daniel Sanders [Tue, 9 Jun 2015 09:47:46 +0000 (09:47 +0000)]
[ADT] Assert that SmallVectorBase::grow_pod() successfully reallocates memory.

Summary:
If malloc/realloc fails then the SmallVector becomes unusable since begin() and
end() will return NULL. This is unlikely to occur but was the cause of recent
bugpoint test failures on my machine.

It is not clear whether not checking for malloc/realloc failure is a deliberate
decision and adding checks has the potential to impact compiler performance.
Therefore, this patch only adds the check to builds with assertions enabled for
the moment.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: bkramer, llvm-commits

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

llvm-svn: 239392

9 years agoMergeFunctions: Fix gcc warning in condition
Denis Protivensky [Tue, 9 Jun 2015 09:28:37 +0000 (09:28 +0000)]
MergeFunctions: Fix gcc warning in condition

llvm-svn: 239391

9 years agollvm/test/DebugInfo/X86/expressions.ll: %llc_dwarf shouldn't be used with -mtriple...
NAKAMURA Takumi [Tue, 9 Jun 2015 08:03:33 +0000 (08:03 +0000)]
llvm/test/DebugInfo/X86/expressions.ll: %llc_dwarf shouldn't be used with -mtriple, since %llc_dwarf implies the triple.

In this case, use plain "llc".

llvm-svn: 239390

9 years agoReenable Misc/interpreter.c as r239388 correctly handles such targets
David Majnemer [Tue, 9 Jun 2015 06:33:13 +0000 (06:33 +0000)]
Reenable Misc/interpreter.c as r239388 correctly handles such targets

llvm-svn: 239389

9 years ago[Driver] Preserve the object file format in ComputeEffectiveClangTriple
David Majnemer [Tue, 9 Jun 2015 06:30:01 +0000 (06:30 +0000)]
[Driver] Preserve the object file format in ComputeEffectiveClangTriple

The object file format is sometimes overridden for MSVC targets to use
ELF instead of COFF.  Make sure we preserve this choice when setting the
msvc version number in the triple.

llvm-svn: 239388

9 years agoDisable clang/test/Misc/interpreter.c, for now, since r239273 mishandled *-msvc-elf.
NAKAMURA Takumi [Tue, 9 Jun 2015 06:27:21 +0000 (06:27 +0000)]
Disable clang/test/Misc/interpreter.c, for now, since r239273 mishandled *-msvc-elf.

llvm-svn: 239387

9 years agoCOFF: Handle references from LTO object to lazy symbols correctly.
Peter Collingbourne [Tue, 9 Jun 2015 04:29:54 +0000 (04:29 +0000)]
COFF: Handle references from LTO object to lazy symbols correctly.

The code generator may create references to runtime library symbols such as
__chkstk which were not visible via LTOModule. Handle these cases by loading
the object file from the library, but abort if we end up having loaded any
bitcode objects.

Because loading the object file may have introduced new undefined references,
call reportRemainingUndefines again to detect and report them.

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

llvm-svn: 239386

9 years agoCOFF: Allow the combined LTO object to define new symbols.
Peter Collingbourne [Tue, 9 Jun 2015 02:53:09 +0000 (02:53 +0000)]
COFF: Allow the combined LTO object to define new symbols.

The LLVM code generator can sometimes synthesize symbols, such as SSE
constants, that are not visible via the LTOModule interface. Allow such
symbols so long as they have definitions.

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

llvm-svn: 239385

9 years agoMove X86-only test case to appropriate directory
Keno Fischer [Tue, 9 Jun 2015 02:52:47 +0000 (02:52 +0000)]
Move X86-only test case to appropriate directory

llvm-svn: 239384

9 years ago[lli] Make the OptLevel (-O=<char>) option accessible to the lazy JIT.
Lang Hames [Tue, 9 Jun 2015 02:43:27 +0000 (02:43 +0000)]
[lli] Make the OptLevel (-O=<char>) option accessible to the lazy JIT.

No test case - this only affects generated code performance.

llvm-svn: 239383

9 years ago[MSVC Compatibility] Don't diagnose c-style cast from void-ptr to fn-ptr
David Majnemer [Tue, 9 Jun 2015 02:41:08 +0000 (02:41 +0000)]
[MSVC Compatibility] Don't diagnose c-style cast from void-ptr to fn-ptr

The machinery added to permit a static_cast from void-ptr to fn-ptr
unintentionally gets triggered for c-style casts and function-style
casts.  The observable effect was a diagnostic issued inappropriately.

llvm-svn: 239382

9 years agorange-for'ify Args->filtered_begin(...) loops
Sean Silva [Tue, 9 Jun 2015 01:57:17 +0000 (01:57 +0000)]
range-for'ify Args->filtered_begin(...) loops

We already have Args->filtered(...) which is a drop-in range-for
replacement.

llvm-svn: 239381

9 years ago[DWARF] Fix a few corner cases in expression emission
Keno Fischer [Tue, 9 Jun 2015 01:53:59 +0000 (01:53 +0000)]
[DWARF] Fix a few corner cases in expression emission

Summary: I noticed an object file with `DW_OP_reg4 DW_OP_breg4 0` as a DWARF expression,
which I traced to a missing break (and `++I`) in this code snippet.
While I was at it, I also added support for a few other corner cases
along the same lines that I could think of.

Test Plan: Hand-crafted test case to exercises these cases is included.

Reviewers: echristo, dblaikie, aprantl

Reviewed By: aprantl

Subscribers: llvm-commits

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

llvm-svn: 239380

9 years ago[asan] Prevent __attribute__((annotate)) triggering errors on Darwin
Anna Zaks [Tue, 9 Jun 2015 00:58:08 +0000 (00:58 +0000)]
[asan] Prevent __attribute__((annotate)) triggering errors on Darwin

The following code triggers a fatal error in the compiler instrumentation
of ASan on Darwin because we place the attribute into llvm.metadata section,
which does not have the proper MachO section name.

void foo() __attribute__((annotate("custom")));
void foo() {;}

This commit reorders the checks so that we skip everything in llvm.metadata
first. It also removes the hard failure in case the section name does not
parse. That check will be done lower in the compilation pipeline anyway.

(Reviewed in http://reviews.llvm.org/D9093.)

llvm-svn: 239379

9 years agoImplement computeKnownBits for min/max nodes
Matt Arsenault [Tue, 9 Jun 2015 00:52:41 +0000 (00:52 +0000)]
Implement computeKnownBits for min/max nodes

llvm-svn: 239378

9 years agoR600: Switch to using generic min / max nodes.
Matt Arsenault [Tue, 9 Jun 2015 00:52:37 +0000 (00:52 +0000)]
R600: Switch to using generic min / max nodes.

llvm-svn: 239377

9 years agoSimplify this code a bit.
Sean Silva [Tue, 9 Jun 2015 00:47:20 +0000 (00:47 +0000)]
Simplify this code a bit.

We weren't using the short-circuiting property anyway.

llvm-svn: 239376

9 years agoEnable DLL attribute propagation on explicit instantiation definitions (PR23770)
Hans Wennborg [Tue, 9 Jun 2015 00:39:09 +0000 (00:39 +0000)]
Enable DLL attribute propagation on explicit instantiation definitions (PR23770)

This is a follow-up to r225570 which enabled adding DLL attributes when a
class template goes from explicit instantiation declaration to explicit
instantiation definition.

llvm-svn: 239375

9 years agoMinGW: don't allow adding DLL attribute if template already has explicit instantiatio...
Hans Wennborg [Tue, 9 Jun 2015 00:39:05 +0000 (00:39 +0000)]
MinGW: don't allow adding DLL attribute if template already has explicit instantiation declaration

This is a follow-up to r238266 which failed to take MinGW into account.

llvm-svn: 239374

9 years agoEnable propagation of dll attributes to previously instantiated base class templates...
Hans Wennborg [Tue, 9 Jun 2015 00:39:03 +0000 (00:39 +0000)]
Enable propagation of dll attributes to previously instantiated base class templates in some cases

It is safe to add a dll attribute if the base class template previously only had
an explicit instantiation declaration, or was implicitly instantiated.

I both those cases, the members would not have been codegenned yet. In the case
of explicit instantiation declaration this is natural, and for implicit
instantiations, codegen is deferred (see r225570).

This is work towards fixing PR23770.

llvm-svn: 239373

9 years agoNarrow the -Wunsupported-dll-base-class-template warning.
Hans Wennborg [Tue, 9 Jun 2015 00:38:56 +0000 (00:38 +0000)]
Narrow the -Wunsupported-dll-base-class-template warning.

Don't warn about not being able to propagate dll attribute to a base class template
when that base already has a different attribute.

MSVC doesn't actually try to do this; the first attribute that was propagated
takes precedence, so Clang is already doing the right thing and there's no
need to warn.

(This is a step towards fixing PR21718.)

llvm-svn: 239372

9 years ago[modules] Fix some visibility issues with default template arguments.
Richard Smith [Tue, 9 Jun 2015 00:35:49 +0000 (00:35 +0000)]
[modules] Fix some visibility issues with default template arguments.

There are still problems here, but this is a better starting point.

The main part of the change is: when doing a lookup that would accept visible
or hidden declarations, prefer to produce the latest visible declaration if
there are any visible declarations, rather than always producing the latest
declaration.

Thus, when we inherit default arguments (and other properties) from a previous
declaration, we inherit them from the previous visible declaration; if the
previous declaration is hidden, we already suppress inheritance of default
arguments.

There are a couple of other changes here that fix latent bugs exposed by this
change.

llvm-svn: 239371

9 years agoMC: Add target hook to control symbol quoting
Matt Arsenault [Tue, 9 Jun 2015 00:31:39 +0000 (00:31 +0000)]
MC: Add target hook to control symbol quoting

llvm-svn: 239370

9 years agoFix unused variable warning
Arnold Schwaighofer [Tue, 9 Jun 2015 00:17:40 +0000 (00:17 +0000)]
Fix unused variable warning

llvm-svn: 239369

9 years ago[NVPTX] run SROA after NVPTXFavorNonGenericAddrSpaces
Jingyue Wu [Tue, 9 Jun 2015 00:05:56 +0000 (00:05 +0000)]
[NVPTX] run SROA after NVPTXFavorNonGenericAddrSpaces

Summary:
This cleans up most allocas NVPTXLowerKernelArgs emits for byval
parameters.

Test Plan: makes bug21465.ll more stronger to verify no redundant local load/store.

Reviewers: eliben, jholewinski

Reviewed By: eliben, jholewinski

Subscribers: jholewinski, llvm-commits

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

llvm-svn: 239368

9 years agoMergeFunctions: Impose a total order on the replacement of functions
Arnold Schwaighofer [Tue, 9 Jun 2015 00:03:29 +0000 (00:03 +0000)]
MergeFunctions: Impose a total order on the replacement of functions

We don't want to replace function A by Function B in one module and Function B
by Function A in another module.

If these functions are marked with linkonce_odr we would end up with a function
stub calling B in one module and a function stub calling A in another module. If
the linker decides to pick these two we will have two stubs calling each other.

rdar://21265586

llvm-svn: 239367

9 years agoRevert "Introduce a TypeSystem interface to support adding non-clang languages."
Pavel Labath [Mon, 8 Jun 2015 23:38:06 +0000 (23:38 +0000)]
Revert "Introduce a TypeSystem interface to support adding non-clang languages."

This seems to break expression evaluation on the linux build.

llvm-svn: 239366

9 years agoEliminate unnecessary namespace to prevent conflicts.
Tyler Nowicki [Mon, 8 Jun 2015 23:27:35 +0000 (23:27 +0000)]
Eliminate unnecessary namespace to prevent conflicts.

llvm-svn: 239365

9 years ago[asan] Fixup to r239134. This test does pass on darwin.
Anna Zaks [Mon, 8 Jun 2015 23:24:55 +0000 (23:24 +0000)]
[asan] Fixup to r239134. This test does pass on darwin.

This should restore the darwin buildbot.

llvm-svn: 239364

9 years agoCorrect Loop Hint Diagnostic Message
Tyler Nowicki [Mon, 8 Jun 2015 23:13:43 +0000 (23:13 +0000)]
Correct Loop Hint Diagnostic Message

When pragma clang loop unroll() is specified without an argument the diagnostic message should inform that user that 'full' and 'disable' are valid arguments (not 'enable').

llvm-svn: 239363

9 years agoMoved CPP CodeGen tests into CodeGenCXX.
Tyler Nowicki [Mon, 8 Jun 2015 22:53:36 +0000 (22:53 +0000)]
Moved CPP CodeGen tests into CodeGenCXX.

llvm-svn: 239362

9 years ago[WinEH] Cache declarations of frame intrinsics
Reid Kleckner [Mon, 8 Jun 2015 22:43:32 +0000 (22:43 +0000)]
[WinEH] Cache declarations of frame intrinsics

llvm-svn: 239361

9 years agoIntroduce a TypeSystem interface to support adding non-clang languages.
Pavel Labath [Mon, 8 Jun 2015 22:27:10 +0000 (22:27 +0000)]
Introduce a TypeSystem interface to support adding non-clang languages.

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8712
Original Author: Ryan Brown <ribrdb@google.com>

llvm-svn: 239360

9 years agoSkip TestInferiorChanged if host platform is windows.
Chaoren Lin [Mon, 8 Jun 2015 22:13:28 +0000 (22:13 +0000)]
Skip TestInferiorChanged if host platform is windows.

Summary: Opened files on Windows cannot be modified, so this test doesn't make sense.

Reviewers: ovyalov, zturner, flackr, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 239359

9 years agoFix TestSymbolContext for remote Windows to Android.
Chaoren Lin [Mon, 8 Jun 2015 22:12:58 +0000 (22:12 +0000)]
Fix TestSymbolContext for remote Windows to Android.

Summary: Denormalize path returned by SBFileSpec::GetDirectory().

Reviewers: zturner, clayborg

Reviewed By: clayborg

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 239358

9 years ago[MC] Use unsigned for the Kind bitfield in MCSymbol
Reid Kleckner [Mon, 8 Jun 2015 22:12:44 +0000 (22:12 +0000)]
[MC] Use unsigned for the Kind bitfield in MCSymbol

Fixes most of the test suite on Windows with clang-cl.

I'm not sure why the test suite was passing with MSVC 2013. Maybe they
changed their behavior and we are emulating their old sign extension
behavior. I think this deserves more investigation, but I want to green
the bot first.

llvm-svn: 239357

9 years agoConsider unsigned long for non-u/U decimal literals (C90/C++03)
Hubert Tong [Mon, 8 Jun 2015 21:59:59 +0000 (21:59 +0000)]
Consider unsigned long for non-u/U decimal literals (C90/C++03)

Summary:
This modifies Clang to reflect that under pre-C99 ISO C, decimal
constants may have type `unsigned long` even if they do not contain `u`
or `U` in their suffix (C90 subclause 6.1.3.2 paragraph 5). The same is
done for C++ without C++11 which--because of undefined behaviour--allows
for behaviour compatible with ISO C90 in the case of an unsuffixed
decimal literal and is otherwise identical to C90 in its treatment of
integer literals (C++03 subclause 2.13.1 [lex.icon] paragraph 2).

Messages are added to the `c99-compat` and `c++11-compat` groups to warn
on such literals, since they behave differently under the newer
standards.

Fixes PR 16678.

Test Plan:
A new test file is added to exercise both pre-C99/C++11 and C99/C++11-up
on decimal literals with no suffix or suffixes `l`/`L` for both 32-bit
and 64-bit `long`.

In the file, 2^31 (being `INT_MAX+1`) is tested for the expected type
using `__typeof__` and multiple declarations of the same entity. 2^63
is similarly tested when it is within the range of `unsigned long`.

Preprocessor arithmetic tests are added to ensure consistency given
that Clang (like GCC) uses greater than 32 bits for preprocessor
arithmetic even when `long` and `unsigned long` is 32 bits and a
pre-C99/C++11 mode is in effect.

Tests added:
  test/Sema/PR16678.c

Reviewers: fraggamuffin, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 239356

9 years agoFix clang-cl self-host -Wc++11-narrowing bug
Reid Kleckner [Mon, 8 Jun 2015 21:57:57 +0000 (21:57 +0000)]
Fix clang-cl self-host -Wc++11-narrowing bug

Use unsigned as the underlying storage type of the AMDGPU address space
enum.

llvm-svn: 239355

9 years agoIf we have a MachO file loaded from memory, make sure we can always get the symbol...
Greg Clayton [Mon, 8 Jun 2015 21:53:11 +0000 (21:53 +0000)]
If we have a MachO file loaded from memory, make sure we can always get the symbol table even if we don't have the __LINKEDIT load address set in the target.

<rdar://problem/21208168>

llvm-svn: 239354

9 years ago[AArch64] AsmParser should be case insensitive about accepting vector register names.
Ranjeet Singh [Mon, 8 Jun 2015 21:32:16 +0000 (21:32 +0000)]
[AArch64] AsmParser should be case insensitive about accepting vector register names.

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

llvm-svn: 239353

9 years ago[asan] Disable asan for aarch64.
Evgeniy Stepanov [Mon, 8 Jun 2015 21:07:24 +0000 (21:07 +0000)]
[asan] Disable asan for aarch64.

lib/Target/AArch64/AArch64FrameLowering.cpp:370: virtual void llvm::AArch64FrameLowering::emitPrologue(llvm::MachineFunction&, llvm::MachineBasicBlock&) const: Assertion `!(NeedsRealignment && NumBytes==0) && "NumBytes should never be 0 when realignment is needed"' failed.

llvm-svn: 239352

9 years agoCOFF: Skip internal symbols in bitcode files.
Peter Collingbourne [Mon, 8 Jun 2015 20:21:28 +0000 (20:21 +0000)]
COFF: Skip internal symbols in bitcode files.

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

llvm-svn: 239338

9 years agoRemove unused variables '__kmp_build_check_*'
Jonathan Peyton [Mon, 8 Jun 2015 20:18:10 +0000 (20:18 +0000)]
Remove unused variables '__kmp_build_check_*'

As an ongoing effort to sanitize the openmp code, this one word change
eliminates creating 1 byte arrays named __kmp_build_check_* and instead
creates one byte array types.  The KMP_BUILD_ASSERT macro still offers the same
functionality; array types with negative number of elements is illegal
and will cause a compiler failure.

llvm-svn: 239337

9 years ago[InstrInfo] Refactor foldOperandImpl to thread through InsertPt. NFC
Keno Fischer [Mon, 8 Jun 2015 20:09:58 +0000 (20:09 +0000)]
[InstrInfo] Refactor foldOperandImpl to thread through InsertPt. NFC

Summary:
This was a longstanding FIXME and is a necessary precursor to cases
where foldOperandImpl may have to create more than one instruction
(e.g. to constrain a register class). This is the split out NFC changes from
D6262.

Reviewers: pete, ributzka, uweigand, mcrosier

Reviewed By: mcrosier

Subscribers: mcrosier, ted, llvm-commits

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

llvm-svn: 239336

9 years agoFix a regression in .pop_section.
Rafael Espindola [Mon, 8 Jun 2015 20:08:55 +0000 (20:08 +0000)]
Fix a regression in .pop_section.

It was calling ChangeSection with the wrong current section, eventually leading
to a crash.

llvm-svn: 239335

9 years agoRemove unused variable warnings by deletion.
Jonathan Peyton [Mon, 8 Jun 2015 20:01:14 +0000 (20:01 +0000)]
Remove unused variable warnings by deletion.

As an ongoing effort to sanitize the openmp code, these changes delete
variables that aren't used at all.
http://lists.cs.uiuc.edu/pipermail/openmp-dev/2015-June/000701.html

Patch by Jack Howarth

llvm-svn: 239334

9 years ago[X86][SSE] Added lzcnt vector tests.
Simon Pilgrim [Mon, 8 Jun 2015 19:58:43 +0000 (19:58 +0000)]
[X86][SSE] Added lzcnt vector tests.

llvm-svn: 239333

9 years agoCOFF: Read symbol names lazily.
Rui Ueyama [Mon, 8 Jun 2015 19:43:59 +0000 (19:43 +0000)]
COFF: Read symbol names lazily.

This change seems to make the linker about 10% faster.
Reading symbol name is not very cheap because it needs strlen()
on the string table. We were wasting time on reading non-external
symbol names that would never be used by the linker.

llvm-svn: 239332

9 years agoRemove unused variable warnings by moving variables.
Jonathan Peyton [Mon, 8 Jun 2015 19:39:07 +0000 (19:39 +0000)]
Remove unused variable warnings by moving variables.

As an ongoing effort to sanitize the openmp code, these changes move
variables under already existing macro guards.

Patch by Jack Howarth

llvm-svn: 239331

9 years agoRemove unused variable warnings by adding proper macro guards.
Jonathan Peyton [Mon, 8 Jun 2015 19:25:25 +0000 (19:25 +0000)]
Remove unused variable warnings by adding proper macro guards.

As an ongoing effort to sanitize the openmp code, these changes remove unused variables
by adding proper macros around both variables and functions.

Patch by Jack Howarth

llvm-svn: 239330

9 years agoInclude header file <functional>.
Akira Hatanaka [Mon, 8 Jun 2015 19:03:32 +0000 (19:03 +0000)]
Include header file <functional>.

This is a follow-up to r239325.

llvm-svn: 239329

9 years agoPrefer copy init over direct init. NFC.
Benjamin Kramer [Mon, 8 Jun 2015 18:58:57 +0000 (18:58 +0000)]
Prefer copy init over direct init. NFC.

llvm-svn: 239327

9 years agoRemove unused variable warnings by fooling compiler.
Jonathan Peyton [Mon, 8 Jun 2015 18:56:33 +0000 (18:56 +0000)]
Remove unused variable warnings by fooling compiler.

Some variables are convenient to keep around even if they aren't
really used in a release build.  This is often seen in DEBUG guarded code where the variable
is only used in a DEBUG build.

Patch by Jack Howarth

llvm-svn: 239326

9 years ago[ARM] Pass a callback to FunctionPass constructors to enable skipping execution
Akira Hatanaka [Mon, 8 Jun 2015 18:50:43 +0000 (18:50 +0000)]
[ARM] Pass a callback to FunctionPass constructors to enable skipping execution
on a per-function basis.

Previously some of the passes were conditionally added to ARM's pass pipeline
based on the target machine's subtarget. This patch makes changes to add those
passes unconditionally and execute them conditonally based on the predicate
functor passed to the pass constructors. This enables running different sets of
passes for different functions in the module.

rdar://problem/20542263

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

llvm-svn: 239325

9 years agoUse a PointerUnion in MCSymbol for Section and Fragment. NFC.
Pete Cooper [Mon, 8 Jun 2015 18:41:57 +0000 (18:41 +0000)]
Use a PointerUnion in MCSymbol for Section and Fragment.  NFC.

The Fragment and Section, and a bool for HasFragment were all used to create
a PointerUnion.  Just use a pointer union instead.

llvm-svn: 239324

9 years agoRemoved unused functions.
Jonathan Peyton [Mon, 8 Jun 2015 18:38:23 +0000 (18:38 +0000)]
Removed unused functions.

As an ongoing effort to sanitize the openmp code, these changes remove unused functions.
The unused functions are:
__kmp_fini_allocator_thread(), __kmp_env_isDefined(), __kmp_strip_quotes(),
__kmp_convert_to_seconds(), and __kmp_convert_to_nanoseconds().

Patch by Jack Howarth

llvm-svn: 239323

9 years ago[asan] Enable AArch64 build of ASan runtime and tests.
Evgeniy Stepanov [Mon, 8 Jun 2015 18:19:26 +0000 (18:19 +0000)]
[asan] Enable AArch64 build of ASan runtime and tests.

llvm-svn: 239322

9 years ago[asan] Fix Android build for API >= 21.
Evgeniy Stepanov [Mon, 8 Jun 2015 18:15:52 +0000 (18:15 +0000)]
[asan] Fix Android build for API >= 21.

/code/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:971:8: error: address of function 'dl_iterate_phdr' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
  if (!dl_iterate_phdr)
      ~^~~~~~~~~~~~~~~
/code/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:971:8: note: prefix with the address-of operator to silence this warning
  if (!dl_iterate_phdr)
       ^
       &

llvm-svn: 239321

9 years ago[asan] Fix build of AsanNoinstTest on Android.
Evgeniy Stepanov [Mon, 8 Jun 2015 18:03:33 +0000 (18:03 +0000)]
[asan] Fix build of AsanNoinstTest on Android.

Some of the asan-ubsan build changes were not replicated in the android branch in CMakeLists.

llvm-svn: 239320