platform/upstream/llvm.git
10 years agoRequire an x86 registered target for this test by splitting it out
Reid Kleckner [Sat, 12 Jul 2014 00:40:59 +0000 (00:40 +0000)]
Require an x86 registered target for this test by splitting it out

This is a shot in the dark to fix the hexagon bot, so I'm not 100% sure
this is the issue.

llvm-svn: 212871

10 years agoR600: Add missing tests for some intrinsics
Matt Arsenault [Sat, 12 Jul 2014 00:36:19 +0000 (00:36 +0000)]
R600: Add missing tests for some intrinsics

llvm-svn: 212870

10 years agoclang-cl: Make all x86 CPU feature flags available, such as -msse3
Reid Kleckner [Sat, 12 Jul 2014 00:29:05 +0000 (00:29 +0000)]
clang-cl: Make all x86 CPU feature flags available, such as -msse3

Ideally, we would use the /arch cl.exe flag for this stuff.
Unfortunately, MSVC supports only 5 /arch flag values, which isn't
nearly enough to cover all the CPU features that LLVM cares about.  At
the very least, we need to know about SSE3 and SSE4.1 in addition to
SSE, SSE2, AVX, and AVX2.

In the future we should add the relevant /arch mappings in addition to
these gcc-style -m flags.

llvm-svn: 212869

10 years agoBFI: Add constructor for Weight
Duncan P. N. Exon Smith [Sat, 12 Jul 2014 00:26:00 +0000 (00:26 +0000)]
BFI: Add constructor for Weight

llvm-svn: 212868

10 years agolldb needs to support DW_op_piece masks for values in subregister and also to be...
Greg Clayton [Sat, 12 Jul 2014 00:24:33 +0000 (00:24 +0000)]
lldb needs to support DW_op_piece masks for values in subregister and also to be able to piece together a value that is spread across multiple registers.

Patch from Adrian Prantl.

<rdar://problem/16040521>

llvm-svn: 212867

10 years agoBFI: Clean up BlockMass
Duncan P. N. Exon Smith [Sat, 12 Jul 2014 00:21:30 +0000 (00:21 +0000)]
BFI: Clean up BlockMass

Implementation is small now -- the interesting logic was moved to
`BranchProbability` a while ago.  Move it into `bfi_detail` and get rid
of the related TODOs.

I was originally planning to define it within `BlockFrequencyInfoImpl`
(or `BFIIBase`), but it seems cleaner in a namespace.  Besides,
`isPodLike` needs to be specialized before `BlockMass` can be used in
some of the other data structures, and there isn't a clear way to do
that.

llvm-svn: 212866

10 years agoOption: Propagate flags from groups to options in each group
Reid Kleckner [Sat, 12 Jul 2014 00:18:58 +0000 (00:18 +0000)]
Option: Propagate flags from groups to options in each group

This should make it easy to set a flag for a whole group of clang driver
options.

llvm-svn: 212865

10 years ago[RuntimeDyld] Fix stub size and offset for AArch64 in RuntimeDyldMachO.h.
Lang Hames [Sat, 12 Jul 2014 00:16:47 +0000 (00:16 +0000)]
[RuntimeDyld] Fix stub size and offset for AArch64 in RuntimeDyldMachO.h.

<rdar://problem/17648000>

llvm-svn: 212864

10 years agoAllow generic ARM cores to match any more specific ARM architecture.
Greg Clayton [Sat, 12 Jul 2014 00:11:34 +0000 (00:11 +0000)]
Allow generic ARM cores to match any more specific ARM architecture.

<rdar://problem/15932248>

llvm-svn: 212863

10 years agoAvoid a warning from MSVC on "*/" in this code by inserting a space
Reid Kleckner [Sat, 12 Jul 2014 00:06:46 +0000 (00:06 +0000)]
Avoid a warning from MSVC on "*/" in this code by inserting a space

llvm-svn: 212862

10 years agoBFI: Mark the end of namespaces
Duncan P. N. Exon Smith [Fri, 11 Jul 2014 23:56:50 +0000 (23:56 +0000)]
BFI: Mark the end of namespaces

llvm-svn: 212861

10 years agoForm a CallExpr from __noop without parens
Reid Kleckner [Fri, 11 Jul 2014 23:54:29 +0000 (23:54 +0000)]
Form a CallExpr from __noop without parens

MSVC accepts __noop without any trailing parens and treats it like a
literal zero.  We don't treat __noop as an integer literal, but now at
least we can parse a naked __noop expression.

Reviewers: rsmith

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

llvm-svn: 212860

10 years ago[RuntimeDyld] Add GOT support for AArch64 to RuntimeDyldMachO.
Lang Hames [Fri, 11 Jul 2014 23:52:07 +0000 (23:52 +0000)]
[RuntimeDyld] Add GOT support for AArch64 to RuntimeDyldMachO.

Test cases to follow once RuntimeDyldChecker supports introspection of stubs.

Fixes <rdar://problem/17648000>

llvm-svn: 212859

10 years ago[Driver] clang::driver::getARMCPUForMArch() moved to llvm::Triple::getARMCPUForArch().
Argyrios Kyrtzidis [Fri, 11 Jul 2014 23:47:48 +0000 (23:47 +0000)]
[Driver] clang::driver::getARMCPUForMArch() moved to llvm::Triple::getARMCPUForArch().

Depends on llvm r212846.
Suggested by Eric Christopher.

llvm-svn: 212858

10 years ago[ASan] Improve ODR-violation error reports.
Alexey Samsonov [Fri, 11 Jul 2014 23:34:26 +0000 (23:34 +0000)]
[ASan] Improve ODR-violation error reports.

Demangle names of involved globals. Print a more consistent summary line.

llvm-svn: 212857

10 years agoRemove assert now that we have a 'i' character that might come through as well as...
Greg Clayton [Fri, 11 Jul 2014 23:15:11 +0000 (23:15 +0000)]
Remove assert now that we have a 'i' character that might come through as well as the 'q' character on the interrupt pipe.

<rdar://problem/15840749>

llvm-svn: 212856

10 years agoRevert "[FastISel][X86] Implement the FastLowerIntrinsicCall hook."
Juergen Ributzka [Fri, 11 Jul 2014 23:10:08 +0000 (23:10 +0000)]
Revert "[FastISel][X86] Implement the FastLowerIntrinsicCall hook."

This reverts commit r212851, because it broke the memset lowering.

llvm-svn: 212855

10 years agoAdded llgs --named-pipe support and program_name-version_number printout support.
Todd Fiala [Fri, 11 Jul 2014 22:50:13 +0000 (22:50 +0000)]
Added llgs --named-pipe support and program_name-version_number printout support.

Added a unit test to test debugserver and llgs compliance on --named-pipe support.

Modified llgs to implement --named-pipe support.  (Note: need to revisit with
new generic pipe support).

llvm-svn: 212854

10 years agoDon't crash when a SBType is handed out through the API and later used after the...
Greg Clayton [Fri, 11 Jul 2014 22:43:15 +0000 (22:43 +0000)]
Don't crash when a SBType is handed out through the API and later used after the module that owns the type is deleted.

The fix adds a std::weak_ptr<Module> into the TypeImpl and fills in the weak pointer when possible. It also checks to make sure the module is still alive prior to using it which should make our API safer to use.

<rdar://problem/15455145>

llvm-svn: 212853

10 years agoDon't use "lldb." global variables in LLDB commands.
Greg Clayton [Fri, 11 Jul 2014 22:41:30 +0000 (22:41 +0000)]
Don't use "lldb." global variables in LLDB commands.

llvm-svn: 212852

10 years ago[FastISel][X86] Implement the FastLowerIntrinsicCall hook.
Juergen Ributzka [Fri, 11 Jul 2014 22:37:43 +0000 (22:37 +0000)]
[FastISel][X86] Implement the FastLowerIntrinsicCall hook.

Rename X86VisitIntrinsicCall -> FastLowerIntrinsicCall, which effectively
implements the target hook.

llvm-svn: 212851

10 years ago[ASan] Introduce a struct representing the layout of metadata entry in llvm.asan...
Alexey Samsonov [Fri, 11 Jul 2014 22:36:02 +0000 (22:36 +0000)]
[ASan] Introduce a struct representing the layout of metadata entry in llvm.asan.globals.

No functionality change.

llvm-svn: 212850

10 years ago[FastISel] Add target-independent patchpoint intrinsic support. WIP.
Juergen Ributzka [Fri, 11 Jul 2014 22:19:02 +0000 (22:19 +0000)]
[FastISel] Add target-independent patchpoint intrinsic support. WIP.

This implements the target-independent lowering for the patchpoint
intrinsic. Targets have to implement the FastLowerCall
hook to support this intrinsic.

Related to <rdar://problem/17427052>

llvm-svn: 212849

10 years ago[FastISel] Add basic infrastructure to support a target-independent call lowering...
Juergen Ributzka [Fri, 11 Jul 2014 22:01:42 +0000 (22:01 +0000)]
[FastISel] Add basic infrastructure to support a target-independent call lowering hook in FastISel. WIP

The infrastructure mimics the call lowering we have already in place for
SelectionDAG, but with limitations. For example structure return demotion and
non-simple types are not supported (yet).

Currently every backend has its own implementation and duplicated code for call
lowering. There is also no specified interface that could be called from
target-independent code. The target-hook is opt-in and doesn't affect current
implementations.

llvm-svn: 212848

10 years agoWhen we sink an instruction, this can open up opportunity for the operands to be...
Aditya Nandakumar [Fri, 11 Jul 2014 21:49:39 +0000 (21:49 +0000)]
When we sink an instruction, this can open up opportunity for the operands to be sunk - add them to the worklist

llvm-svn: 212847

10 years agoMove the API and implementation of clang::driver::getARMCPUForMArch() to llvm::Triple...
Argyrios Kyrtzidis [Fri, 11 Jul 2014 21:44:54 +0000 (21:44 +0000)]
Move the API and implementation of clang::driver::getARMCPUForMArch() to llvm::Triple::getARMCPUForArch().

Suggested by Eric Christopher.

llvm-svn: 212846

10 years agoConsolidate header inclusion diagnostics
Alp Toker [Fri, 11 Jul 2014 20:53:51 +0000 (20:53 +0000)]
Consolidate header inclusion diagnostics

Make argument orders match, unify diagnostic IDs and reword the message to be a
little less saccharine.

llvm-svn: 212845

10 years ago[FastISel] Make isInTailCallPosition independent of SelectionDAG.
Juergen Ributzka [Fri, 11 Jul 2014 20:50:47 +0000 (20:50 +0000)]
[FastISel] Make isInTailCallPosition independent of SelectionDAG.

Break out the arguemnts required from SelectionDAG, so that this function can
also be used by FastISel.

llvm-svn: 212844

10 years ago[FastISel] Breakout intrinsic lowering into a separate function and add a target...
Juergen Ributzka [Fri, 11 Jul 2014 20:42:12 +0000 (20:42 +0000)]
[FastISel] Breakout intrinsic lowering into a separate function and add a target-hook.

Create a separate helper function for target-independent intrinsic lowering. Also
add an target-hook that allows to directly call into a target-sepcific intrinsic
lowering method. Currently the implementation is opt-in and doesn't affect
existing target implementations.

llvm-svn: 212843

10 years agoAdd the "-s" flag to llvm-nm for Mach-O files that prints symbols only in
Kevin Enderby [Fri, 11 Jul 2014 20:30:00 +0000 (20:30 +0000)]
Add the "-s" flag to llvm-nm for Mach-O files that prints symbols only in
the specified section.  This is same functionality as darwin’s nm(1) "-s" flag.

There is one FIXME in the code and I’m all ears to anyone that can help me
with that.  This option takes exactly two strings and should be allowed
anywhere on the command line.  Such that "llvm-nm -s __TEXT __text foo.o"
would work. But that does not as the CommandLine Library does not have a
way to make this work as far as I can tell.  For now the "-s __TEXT __text"
has to be last on the command line.

llvm-svn: 212842

10 years agoCodeGen: Don't emit a thread-wrapper if we can't touch the backing variable
David Majnemer [Fri, 11 Jul 2014 20:28:10 +0000 (20:28 +0000)]
CodeGen: Don't emit a thread-wrapper if we can't touch the backing variable

OS X TLS has all accesses going through the thread-wrapper function and
gives the backing thread-local variable internal linkage.  This means
that thread-wrappers must have WeakAnyLinkage so that references to the
internal thread-local variables do not get propagated to other code.

It also means that translation units which do not provide a definition
for the thread-local variable cannot attempt to emit a thread-wrapper
because the thread wrapper will attempt to reference the backing
variable.

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

llvm-svn: 212841

10 years agooops. correct the prefix.
Brad Smith [Fri, 11 Jul 2014 20:27:39 +0000 (20:27 +0000)]
oops. correct the prefix.

llvm-svn: 212840

10 years agoMS extension: Make __noop be the integer zero, not void
Reid Kleckner [Fri, 11 Jul 2014 20:22:55 +0000 (20:22 +0000)]
MS extension: Make __noop be the integer zero, not void

We still don't accept '__noop;', and we don't consider __noop to be the
integer literal zero.  More work is needed.

llvm-svn: 212839

10 years agoHandle SPARC float command line parameters for SPARCv9.
Brad Smith [Fri, 11 Jul 2014 20:12:08 +0000 (20:12 +0000)]
Handle SPARC float command line parameters for SPARCv9.

llvm-svn: 212838

10 years agoSimplify the raw_svector_ostream tweak from r212816
Alp Toker [Fri, 11 Jul 2014 18:23:08 +0000 (18:23 +0000)]
Simplify the raw_svector_ostream tweak from r212816

The memcpy() and overlap helps didn't help much with timings, so clean up the change.

The difference at this point is that we now leave growth of the storage buffer
up to SmallVector's implementation:

 -   OS.reserve(OS.capacity() * 2);
 +   OS.reserve(OS.size() + 64);

llvm-svn: 212837

10 years ago[modules] When merging a class template, also merge the definition of its pattern.
Richard Smith [Fri, 11 Jul 2014 18:22:58 +0000 (18:22 +0000)]
[modules] When merging a class template, also merge the definition of its pattern.

llvm-svn: 212836

10 years agoAdd nonnull in CodeGen for __attribute__((nonnull))
Hal Finkel [Fri, 11 Jul 2014 17:35:21 +0000 (17:35 +0000)]
Add nonnull in CodeGen for __attribute__((nonnull))

We now have an LLVM-level nonnull attribute that can be applied to function
parameters, and we emit it for reference types (as of r209723), but did not
emit it when an __attribute__((nonnull)) was provided. Now we will.

llvm-svn: 212835

10 years ago[MC] Constify MCELF::GetVisibility and MCELF::getOther
Ulrich Weigand [Fri, 11 Jul 2014 17:34:44 +0000 (17:34 +0000)]
[MC] Constify MCELF::GetVisibility and MCELF::getOther

These two routines didn't take a "const MCSymbolData &SD"
like the other MCELF::Get routines for some reason ...

llvm-svn: 212834

10 years agoTest for warning being silenced
Sylvestre Ledru [Fri, 11 Jul 2014 17:23:13 +0000 (17:23 +0000)]
Test for warning being silenced

Summary:
Added some tests to see if the new warning would be silenced with a flag.

Patch by Arthur Marble <arthur@info9.net> in the context of Debian Google Summer of code 2014.

Reviewers: sylvestre.ledru

Reviewed By: sylvestre.ledru

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

llvm-svn: 212833

10 years ago[PowerPC] Fix invalid displacement created by LocalStackAlloc
Ulrich Weigand [Fri, 11 Jul 2014 17:19:31 +0000 (17:19 +0000)]
[PowerPC] Fix invalid displacement created by LocalStackAlloc

This commit fixes a bug in PPCRegisterInfo::isFrameOffsetLegal that
could result in the LocalStackAlloc pass creating an MI instruction
out-of-range displacement:
        %vreg17<def> = LD 33184, %vreg31; mem:LD8[%g](align=32)
        %G8RC:%vreg17 G8RC_and_G8RC_NOX0:%vreg31
(In final assembler output the top bits are stripped off, resulting
in a negative offset loading from below the stack pointer.)

Common code expects the isFrameOffsetLegal routine to verify whether
adding a given offset to the offset already present in the instruction
results in a valid displacement.  However, on PowerPC the routine
did not take the already present instruction offset into account.

This commit fixes isFrameOffsetLegal to add the instruction offset,
and updates a local caller (needsFrameBaseReg) to no longer add the
instruction offset itself before calling isFrameOffsetLegal.

Reviewed by Hal Finkel.

llvm-svn: 212832

10 years agoR600/SI: Use i32 vectors for resources and samplers
Marek Olsak [Fri, 11 Jul 2014 17:11:52 +0000 (17:11 +0000)]
R600/SI: Use i32 vectors for resources and samplers

This affects new intrinsics only.

What surprises me is that v32i8 still works.

llvm-svn: 212831

10 years agoR600/SI: add sample and image intrinsics exposing all instruction fields
Marek Olsak [Fri, 11 Jul 2014 17:11:46 +0000 (17:11 +0000)]
R600/SI: add sample and image intrinsics exposing all instruction fields

We need the intrinsics with offsets, so why not just add them all.
The R128 parameter will also be useful for reducing SGPR usage.
GL_ARB_image_load_store also adds some image GLSL modifiers like "coherent",
so Mesa will probably translate those to slc, glc, etc.

When LLVM 3.5 is released, I'll switch Mesa to these new intrinsics.

llvm-svn: 212830

10 years agoR600/SI: fix shadow mapping for 1D and 2D array textures
Marek Olsak [Fri, 11 Jul 2014 17:11:39 +0000 (17:11 +0000)]
R600/SI: fix shadow mapping for 1D and 2D array textures

It was conflicting with def TEX_SHADOW_ARRAY, which also handles them.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 212829

10 years agoAdd a test case for r212596
Timur Iskhodzhanov [Fri, 11 Jul 2014 16:32:53 +0000 (16:32 +0000)]
Add a test case for r212596

llvm-svn: 212828

10 years agoThe returns_nonnull attribute does not require a function prototype because it affect...
Aaron Ballman [Fri, 11 Jul 2014 16:31:29 +0000 (16:31 +0000)]
The returns_nonnull attribute does not require a function prototype because it affects only the return value, not any arguments. In turn, asking for a function or method result type should not require a function prototype either, so getFunctionOrMethodResultType has been relaxed.

llvm-svn: 212827

10 years agoSupport LLVM_LIBDIR_SUFFIX.
Dan Albert [Fri, 11 Jul 2014 15:52:58 +0000 (15:52 +0000)]
Support LLVM_LIBDIR_SUFFIX.

This is useful for distros installing under /usr/lib64.

Patch from İsmail Dönmez.

llvm-svn: 212826

10 years agoModify ObjectFileELF::GetArchitecture() to avoid calling ParseSectionHeaders() when...
Todd Fiala [Fri, 11 Jul 2014 15:43:51 +0000 (15:43 +0000)]
Modify ObjectFileELF::GetArchitecture() to avoid calling ParseSectionHeaders() when we have headers.

Change by Matthew Gardiner.

llvm-svn: 212825

10 years agoAdd support for building and testing the unwinder.
Dan Albert [Fri, 11 Jul 2014 15:36:02 +0000 (15:36 +0000)]
Add support for building and testing the unwinder.

Note: The unwinder currently only works on Darwin and on ARM Linux.
Non-ARM Linux support is not yet implemented, and will fail to build.

llvm-svn: 212824

10 years ago[asan] fix x32 build, patch by H.J. Lu
Kostya Serebryany [Fri, 11 Jul 2014 15:22:45 +0000 (15:22 +0000)]
[asan] fix x32 build, patch by H.J. Lu

llvm-svn: 212823

10 years agoPrevent ObjectFileELF::GetSectionHeaderInfo() from reparsing section headers.
Todd Fiala [Fri, 11 Jul 2014 15:13:33 +0000 (15:13 +0000)]
Prevent ObjectFileELF::GetSectionHeaderInfo() from reparsing section headers.

If we have any section headers in the collection, we already parsed them.
Therefore, don't reparse the section headers when the section_headers collection
is not empty.

See this thread for more details:
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140707/011721.html

Change by Matthew Gardiner

llvm-svn: 212822

10 years agoInstantiate llvm::Registry<clang::PluginASTAction> in FrontendAction.cpp.
NAKAMURA Takumi [Fri, 11 Jul 2014 15:06:24 +0000 (15:06 +0000)]
Instantiate llvm::Registry<clang::PluginASTAction> in FrontendAction.cpp.

  - Plugins don't need to export _ZN4llvm8Registry*.
  - Win32.DLL cannot merge common symbols among DLLs. Static members in llvm::Registry should be instantiated in a parent.

llvm-svn: 212821

10 years agollvm/test/BugPoint/compile-custom.ll: Use explicit %python to invoke a test script...
NAKAMURA Takumi [Fri, 11 Jul 2014 14:44:10 +0000 (14:44 +0000)]
llvm/test/BugPoint/compile-custom.ll: Use explicit %python to invoke a test script, compile-custom.ll.py, for shebang-incapable hosts.

llvm-svn: 212820

10 years agollvm/test/lit.cfg: Let %python available.
NAKAMURA Takumi [Fri, 11 Jul 2014 14:36:39 +0000 (14:36 +0000)]
llvm/test/lit.cfg: Let %python available.

llvm-svn: 212819

10 years ago[CMake] add_llvm_library: Add "RUNTIME DESTINATION bin" to install(). It affects...
NAKAMURA Takumi [Fri, 11 Jul 2014 14:36:28 +0000 (14:36 +0000)]
[CMake] add_llvm_library: Add "RUNTIME DESTINATION bin" to install(). It affects add_library(SHARED) for Win32.DLL.

llvm-svn: 212818

10 years ago[PATCH] [x32] Introduce -mx32 flag enforcing x32 mode for other triplets. By Pavel...
Zinovy Nis [Fri, 11 Jul 2014 14:28:45 +0000 (14:28 +0000)]
[PATCH] [x32] Introduce -mx32 flag enforcing x32 mode for other triplets. By Pavel Chupin (@pavel.v.chupin).

-mx32 flag setup target environment to GNUX32 and can be used for
other 32/64-bit triplets (i386-unknown-linux, x86_64-unknown-linux) to
turn on x32 mode. Compatible with GCC -mx32 flag.

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

llvm-svn: 212817

10 years agoraw_svector_ostream: grow and reserve atomically
Alp Toker [Fri, 11 Jul 2014 14:02:04 +0000 (14:02 +0000)]
raw_svector_ostream: grow and reserve atomically

Including the scratch buffer size in the initial reservation eliminates the
subsequent malloc+move operation and offers a healthier constant growth with
less memory wastage.

When doing this, take care to avoid invalidating the source buffer.

llvm-svn: 212816

10 years ago[ASan/Win] Don't apply dllexport to __asan_init in the DLL thunk
Timur Iskhodzhanov [Fri, 11 Jul 2014 13:46:05 +0000 (13:46 +0000)]
[ASan/Win] Don't apply dllexport to __asan_init in the DLL thunk

This fixes '___asan_init_v4 already defined' errors when linking some of Chromium DLLs.
Looks like one of the DLL is using a .lib produced while linking another DLL and it exploded after r212699.
I'm trying to come up with a small testcase...

llvm-svn: 212815

10 years agoModify the tests to use FileCheck -implicit-check-not option being proposed in D4462
Alexander Kornienko [Fri, 11 Jul 2014 13:44:51 +0000 (13:44 +0000)]
Modify the tests to use FileCheck -implicit-check-not option being proposed in D4462

Reviewers: djasper, sbenza, bkramer

Reviewed By: bkramer

Subscribers: cfe-commits

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

llvm-svn: 212814

10 years ago[Mips] Make rel-dynamic-11.test test case independent from external input files.
Simon Atanasyan [Fri, 11 Jul 2014 13:42:04 +0000 (13:42 +0000)]
[Mips] Make rel-dynamic-11.test test case independent from external input files.

llvm-svn: 212813

10 years agoARM: Allow __fp16 as a function arg or return type for AArch64
Oliver Stannard [Fri, 11 Jul 2014 13:33:46 +0000 (13:33 +0000)]
ARM: Allow __fp16 as a function arg or return type for AArch64

ACLE 2.0 allows __fp16 to be used as a function argument or return
type. This enables this for AArch64.

llvm-svn: 212812

10 years agoFixed the test to work with -implicit-check-not.
Alexander Kornienko [Fri, 11 Jul 2014 12:54:51 +0000 (12:54 +0000)]
Fixed the test to work with -implicit-check-not.

llvm-svn: 212811

10 years agoAdd FileCheck -implicit-check-not option to allow stricter tests without adding too...
Alexander Kornienko [Fri, 11 Jul 2014 12:39:32 +0000 (12:39 +0000)]
Add FileCheck -implicit-check-not option to allow stricter tests without adding too many CHECK-NOTs manually.

Summary:
Add FileCheck -implicit-check-not option which allows specifying a
pattern that should only occur in the input when explicitly matched by a
positive check. This feature allows checking tool diagnostics in a way
clang -verify does it for compiler diagnostics.

The option has been tested on a number of clang-tidy checks, I'll post a link to
the clang-tidy patch to this thread.

Once there's an agreement on the general direction, I can add tests and
documentation.

Reviewers: djasper, bkramer

Reviewed By: bkramer

Subscribers: llvm-commits

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

llvm-svn: 212810

10 years ago[ASan] Print register values in a consistent way
Timur Iskhodzhanov [Fri, 11 Jul 2014 12:14:46 +0000 (12:14 +0000)]
[ASan] Print register values in a consistent way

llvm-svn: 212809

10 years ago[X86] Fix the inversion of low and high bits for the lowering of MUL_LOHI.
Quentin Colombet [Fri, 11 Jul 2014 12:08:23 +0000 (12:08 +0000)]
[X86] Fix the inversion of low and high bits for the lowering of MUL_LOHI.
Also add a few comments.

<rdar://problem/17581756>

llvm-svn: 212808

10 years ago[ASan/Win] Catch NULL derefs and page faults
Timur Iskhodzhanov [Fri, 11 Jul 2014 11:57:41 +0000 (11:57 +0000)]
[ASan/Win] Catch NULL derefs and page faults

Reviewed at http://reviews.llvm.org/D4471

llvm-svn: 212807

10 years agoTiny improvement in a test (missing quote)
Sylvestre Ledru [Fri, 11 Jul 2014 11:53:18 +0000 (11:53 +0000)]
Tiny improvement in a test (missing quote)

llvm-svn: 212806

10 years agoGCC compatibility: Create a Group to ignore unsupported optimization.
Sylvestre Ledru [Fri, 11 Jul 2014 11:43:57 +0000 (11:43 +0000)]
GCC compatibility: Create a Group to ignore unsupported optimization.

Returns a warning when using an unknown optimization flag.
This patch includes -finline-limit as one of those ignored flags.
More options will be moved in this group

Patch by Arthur Marble <arthur@info9.net> in the context of
Debian Google Summer of code 2014.

Reviewers: rnk, Sylvestre
llvm-svn: 212805

10 years ago[OPENMP] Parsing and sema analysis for 'omp task' directive.
Alexey Bataev [Fri, 11 Jul 2014 11:25:16 +0000 (11:25 +0000)]
[OPENMP] Parsing and sema analysis for 'omp task' directive.

llvm-svn: 212804

10 years agoAdded test for commit r212802 that was missing
Marcello Maggioni [Fri, 11 Jul 2014 10:36:00 +0000 (10:36 +0000)]
Added test for commit r212802 that was missing

llvm-svn: 212803

10 years agoFixup PHIs in LowerSwitch when a Leaf node is not emitted.
Marcello Maggioni [Fri, 11 Jul 2014 10:34:36 +0000 (10:34 +0000)]
Fixup PHIs in LowerSwitch when a Leaf node is not emitted.

This commit fixes bug http://llvm.org/bugs/show_bug.cgi?id=20103.

Thanks to Qwertyuiop for the report and the proposed fix.

llvm-svn: 212802

10 years ago[msan] A comment for the chained-origin-depot hash function.
Evgeniy Stepanov [Fri, 11 Jul 2014 09:09:37 +0000 (09:09 +0000)]
[msan] A comment for the chained-origin-depot hash function.

llvm-svn: 212801

10 years agoRemove unnecessary isl annotations
Tobias Grosser [Fri, 11 Jul 2014 09:02:41 +0000 (09:02 +0000)]
Remove unnecessary isl annotations

They where just left over from copy-pasting.

Reported-by: Johannes Doerfert <jdoerfert@codeaurora.org>
llvm-svn: 212800

10 years ago[msan] Use real memset/memcpy/memmove in interceptors.
Evgeniy Stepanov [Fri, 11 Jul 2014 08:57:57 +0000 (08:57 +0000)]
[msan] Use real memset/memcpy/memmove in interceptors.

Our versions are not exactly as fast as libc's, and
MSan uses them heavily (even compared to other sanitizers).

This will break if libc version of mem* are instrumented,
but they never are, and if they are, we should be able
to fix it on libc side.

llvm-svn: 212799

10 years ago[msan] Make one test case less brittle.
Evgeniy Stepanov [Fri, 11 Jul 2014 08:47:51 +0000 (08:47 +0000)]
[msan] Make one test case less brittle.

llvm-svn: 212798

10 years ago[clang-tidy] Add a checker for implicit bool conversion of a bool*.
Benjamin Kramer [Fri, 11 Jul 2014 08:08:47 +0000 (08:08 +0000)]
[clang-tidy] Add a checker for implicit bool conversion of a bool*.

The goal is to find code like the example below, which is likely a typo
where someone meant to write "if (*b)".
bool *b = SomeFunction();
 if (b) {
   // b never dereferenced
 }

This checker naturally has a relatively high false positive rate so it
applies some heuristics to avoid cases where the pointer is checked for
nullptr before being written.

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

llvm-svn: 212797

10 years agoDeadCodeElim: Compute correct liveout for non-affine accesses
Tobias Grosser [Fri, 11 Jul 2014 07:12:10 +0000 (07:12 +0000)]
DeadCodeElim: Compute correct liveout for non-affine accesses

Thanks to Johannes Doerfert for narrowing down the bug.

Reported-by: Chris Jenneisch <chrisj@codeaurora.org>
llvm-svn: 212796

10 years ago[X86] AVX512: Improve readability of isCDisp8
Adam Nemet [Fri, 11 Jul 2014 05:23:25 +0000 (05:23 +0000)]
[X86] AVX512: Improve readability of isCDisp8

No functional change.  As I was trying to understand this function, I found
that variables were reused with confusing names and the broadcast case was a
bit too implicit.  Hopefully, this is an improvement.

llvm-svn: 212795

10 years ago[X86] AVX512: Simplify logic in isCDisp8
Adam Nemet [Fri, 11 Jul 2014 05:23:12 +0000 (05:23 +0000)]
[X86] AVX512: Simplify logic in isCDisp8

It was computing the VL/n case as:
  MemObjSize = VectorByteSize / ElemByteSize / Divider * ElemByteSize

ElemByteSize not only falls out but VectorByteSize/Divider now actually
matches the definition of VL/n.

Also some formatting fixes.

llvm-svn: 212794

10 years agoRevert "Reapply "DebugInfo: Ensure that all debug location scope chains from instruct...
David Blaikie [Fri, 11 Jul 2014 02:42:57 +0000 (02:42 +0000)]
Revert "Reapply "DebugInfo: Ensure that all debug location scope chains from instructions within a function, lead to the function itself.""

This reverts commit r212776.

Nope, still seems to be failing on the sanitizer bots... but hey, not
the msan self-host anymore, it's failing in asan now. I'll start looking
there next.

llvm-svn: 212793

10 years agoEnable the ability to enable debug info generation when evaluating expressions.
Greg Clayton [Fri, 11 Jul 2014 01:03:57 +0000 (01:03 +0000)]
Enable the ability to enable debug info generation when evaluating expressions.

llvm-svn: 212792

10 years agoRemove code that was merged incorrectly.
Greg Clayton [Fri, 11 Jul 2014 00:51:53 +0000 (00:51 +0000)]
Remove code that was merged incorrectly.

llvm-svn: 212791

10 years agoDon't assume StringRef.data() is null-terminated
Ben Langmuir [Fri, 11 Jul 2014 00:43:47 +0000 (00:43 +0000)]
Don't assume StringRef.data() is null-terminated

llvm-svn: 212790

10 years agoTestAfterDivZeroChecker.cpp: Avoid member initializer. It is unsupported in msc17.
NAKAMURA Takumi [Fri, 11 Jul 2014 00:32:35 +0000 (00:32 +0000)]
TestAfterDivZeroChecker.cpp: Avoid member initializer. It is unsupported in msc17.

llvm-svn: 212789

10 years ago[modules] Don't try to merge template specializations by performing name lookup
Richard Smith [Fri, 11 Jul 2014 00:20:06 +0000 (00:20 +0000)]
[modules] Don't try to merge template specializations by performing name lookup
into their container; we won't find them there. These things are already being
merged when they're added to their primary template's folding set, so this
merging is redundant (and causes us to reject-valid because we think we've
found an odr violation).

llvm-svn: 212788

10 years agoclang/test/CodeGenCXX/PR20038.cpp: Appease targeting msvc due to incompatibility...
NAKAMURA Takumi [Fri, 11 Jul 2014 00:18:29 +0000 (00:18 +0000)]
clang/test/CodeGenCXX/PR20038.cpp: Appease targeting msvc due to incompatibility of dw.

llvm-svn: 212787

10 years agoReturn a FixItHint instead of taking a diagnostic builder
Reid Kleckner [Fri, 11 Jul 2014 00:16:51 +0000 (00:16 +0000)]
Return a FixItHint instead of taking a diagnostic builder

Addressing review comments from r212784.

llvm-svn: 212786

10 years agoGet the python scripting interface working on Windows.
Zachary Turner [Thu, 10 Jul 2014 23:47:42 +0000 (23:47 +0000)]
Get the python scripting interface working on Windows.

This patch fixes a number of issues with embedded Python on
Windows.  In particular:

1) The script that builds the python modules was normalizing the
   case of python filenames during copies.  The module name is
   the filename, and is case-sensitive, so this was breaking code.

2) Changes the build to not attempt to link against python27.lib
   (e.g. the release library) when linking against msvcrt debug
   library.  Doing a debug build of LLDB with embedded python
   support now requires you to provide your own self-compiled
   debug version of python.

3) Don't import termios when initializing the interpreter.  This
   is part of a larger effort to remove the dependency on termios
   since it is not available on Windows.  This particular instance
   was unnecessary and unused.

Reviewed by: Todd Fiala

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

llvm-svn: 212785

10 years agoMSVC compat: Allow lookup of friend types in enclosing namespaces
Reid Kleckner [Thu, 10 Jul 2014 23:44:52 +0000 (23:44 +0000)]
MSVC compat: Allow lookup of friend types in enclosing namespaces

The relevant portion of C++ standard says [namespace.memdef]p3:

  If the name in a friend declaration is neither qualified nor a
  template-id and the declaration is a function or an
  elaborated-type-specifier, the lookup to determine whether the entity
  has been previously declared shall not consider any scopes outside the
  innermost enclosing namespace.

MSVC does not implement that rule for types.  If there is a type in an
enclosing namespace, they consider an unqualified tag declaration with
the same name to be a redeclaration of the type from another namespace.

Implementing compatibility is a simple matter of disabling our
implementation of this rule for types, which was added in r177473.

Reviewers: rsmith

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

llvm-svn: 212784

10 years agoCleanup the iOS simulator code.
Greg Clayton [Thu, 10 Jul 2014 23:33:37 +0000 (23:33 +0000)]
Cleanup the iOS simulator code.

Fixes include:
- Don't say that "<arch>-apple-ios" is compatible with "<arch>-apple-macosx"
- Fixed DynamicLoaderMacOSXDYLD so specify an architecture that was converted solely from a cputype and subtype, just specify the file + UUID.
- Fixed PlatformiOSSimulator::GetSupportedArchitectureAtIndex() so it returns the correct archs
- Fixed SymbolFileDWARFDebugMap to load .o files correctly by just specifying the architecture without the vendor and OS now that "<arch>-apple-ios" is not compatible with "<arch>-apple-macosx" so we can load .o files correctly for DWARF with debug map
- Fixed the coded in TargetList::CreateTarget() so it does the right thing with an underspecified triple where just the arch is specified.

llvm-svn: 212783

10 years agoPartially fix PR20058: reduce compile time for loop unrolling with very high count...
Mark Heffernan [Thu, 10 Jul 2014 23:30:06 +0000 (23:30 +0000)]
Partially fix PR20058: reduce compile time for loop unrolling with very high count by reducing calls to SE->forgetLoop

llvm-svn: 212782

10 years agoEnable -gcolumn-info by default.
Diego Novillo [Thu, 10 Jul 2014 23:29:28 +0000 (23:29 +0000)]
Enable -gcolumn-info by default.

This patch flips the default value for -gcolumn-info to be on by
default. I discussed the rationale and provided compile/size data
in:

http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-June/074290.html

This also updates the documentation and some tests that relied on
the lack of column information. Some tests had column information
in the expected output, but it was wrong (the tsan tests). Others
were using the driver to execute.

llvm-svn: 212781

10 years ago[RuntimeDyld] Replace a crufty old ARM RuntimeDyld test with a new one that uses
Lang Hames [Thu, 10 Jul 2014 23:29:11 +0000 (23:29 +0000)]
[RuntimeDyld] Replace a crufty old ARM RuntimeDyld test with a new one that uses
RuntimeDyldChecker.

This allows us to remove one of the six remaining object files in the LLVM
source tree.

llvm-svn: 212780

10 years agoFix expected column numbers in two tests.
Diego Novillo [Thu, 10 Jul 2014 23:29:10 +0000 (23:29 +0000)]
Fix expected column numbers in two tests.

This is a minor fix to two tsan tests that were expecting the wrong
column information. Now that clang emits column information by default
in its debugging output, the tests had started failing.

llvm-svn: 212779

10 years ago[RuntimeDyld] Improve error diagnostic in RuntimeDyldChecker.
Lang Hames [Thu, 10 Jul 2014 23:26:20 +0000 (23:26 +0000)]
[RuntimeDyld] Improve error diagnostic in RuntimeDyldChecker.

The compiler often emits assembler-local labels (beginning with 'L') for use in
relocation expressions, however these aren't included in the object files.
Teach RuntimeDyldChecker to warn the user if they try to use one of these in an
expression, since it will never work.

llvm-svn: 212777

10 years agoReapply "DebugInfo: Ensure that all debug location scope chains from instructions...
David Blaikie [Thu, 10 Jul 2014 22:59:39 +0000 (22:59 +0000)]
Reapply "DebugInfo: Ensure that all debug location scope chains from instructions within a function, lead to the function itself."

Committed in r212205 and reverted in r212226 due to msan self-hosting
failure, I believe I've got that fixed by r212761 to Clang.

Original commit message:

"Originally committed in r211723, reverted in r211724 due to failure
cases found and fixed (ArgumentPromotion: r211872, Inlining: r212065),
committed again in r212085 and reverted again in r212089 after fixing
some other cases, such as debug info subprogram lists not keeping track
of the function they represent (r212128) and then short-circuiting
things like LiveDebugVariables that build LexicalScopes for functions
that might not have full debug info.

And again, I believe the invariant actually holds for some reasonable
amount of code (but I'll keep an eye on the buildbots and see what
happens... ).

Original commit message:

PR20038: DebugInfo: Inlined call sites where the caller has debug info
but the call itself has no debug location.

This situation does bad things when inlined, so I've fixed Clang not to
produce inlinable call sites without locations when the caller has debug
info (in the one case where I could find that this occurred). This
updates the PR20038 test case to be what clang now produces, and readds
the assertion that had to be removed due to this bug.

I've also beefed up the debug info verifier to help diagnose these
issues in the future, and I hope to add checks to the inliner to just
assert-fail if it encounters this situation. If, in the future, we
decide we have to cope with this situation, the right thing to do is
probably to just remove all the DebugLocs from the inlined
instructions."

llvm-svn: 212776

10 years agoThis test case doesn't actually need the inliner to reproduce the input.
David Blaikie [Thu, 10 Jul 2014 22:57:40 +0000 (22:57 +0000)]
This test case doesn't actually need the inliner to reproduce the input.

llvm-svn: 212775

10 years agoAdd AST dumping for VarDecl init kind.
Richard Smith [Thu, 10 Jul 2014 22:54:03 +0000 (22:54 +0000)]
Add AST dumping for VarDecl init kind.

llvm-svn: 212774

10 years agoR600: Implement float to long/ulong
Jan Vesely [Thu, 10 Jul 2014 22:40:21 +0000 (22:40 +0000)]
R600: Implement float to long/ulong

Use alg. from LegalizeDAG.cpp
Move Expand setting to SIISellowering

v2: Extend existing tests instead of creating new ones
v3: use separate LowerFPTOSINT function
v4: use TargetLowering::expandFP_TO_SINT
    add comment about using FP_TO_SINT for uints

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <tom@stellard.net>
llvm-svn: 212773

10 years agoSelectionDAG: Factor FP_TO_SINT lower code out of DAGLegalizer
Jan Vesely [Thu, 10 Jul 2014 22:40:18 +0000 (22:40 +0000)]
SelectionDAG: Factor FP_TO_SINT lower code out of DAGLegalizer

Move the code to a helper function to allow calls from TypeLegalizer.

No functionality change intended

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <tom@stellard.net>
Reviewed-by: Owen Anderson <resistor@mac.com>
llvm-svn: 212772

10 years agoUse the integrated assembler by default on OpenBSD.
Brad Smith [Thu, 10 Jul 2014 22:37:28 +0000 (22:37 +0000)]
Use the integrated assembler by default on OpenBSD.

llvm-svn: 212771