platform/upstream/llvm.git
10 years ago[mips] Correct the AFL_FLAGS1_ODDSPREG flag in .MIPS.abiflags when no '.module oddspr...
Daniel Sanders [Mon, 14 Jul 2014 10:26:15 +0000 (10:26 +0000)]
[mips] Correct the AFL_FLAGS1_ODDSPREG flag in .MIPS.abiflags when no '.module oddspreg' is used

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

llvm-svn: 212932

10 years ago[x32] Add __ILP32__ macro for ILP32 platforms
Pavel Chupin [Mon, 14 Jul 2014 09:58:10 +0000 (09:58 +0000)]
[x32] Add __ILP32__ macro for ILP32 platforms

Summary:
Add __ILP32__ and _ILP32 macro for corresponding platforms.
Cover x86_64-*-*-gnux32 with test.

Test Plan: test added

Reviewers: chandlerc, atanasyan

Subscribers: cfe-commits, dschuff, zinovy.nis

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

llvm-svn: 212931

10 years ago[mips] Expand BuildPairF64 to a spill and reload when the O32 FPXX ABI is
Sasa Stankovic [Mon, 14 Jul 2014 09:40:29 +0000 (09:40 +0000)]
[mips] Expand BuildPairF64 to a spill and reload when the O32 FPXX ABI is
enabled and mthc1 and dmtc1 are not available (e.g. on MIPS32r1)

This prevents the upper 32-bits of a double precision value from being moved to
the FPU with mtc1 to an odd-numbered FPU register. This is necessary to ensure
that the code generated executes correctly regardless of the current FPU mode.

MIPS32r2 and above continues to use mtc1/mthc1, while MIPS-IV and above continue
to use dmtc1.

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

llvm-svn: 212930

10 years ago[msan] Stop demangling function name in the stack origin report.
Evgeniy Stepanov [Mon, 14 Jul 2014 09:35:27 +0000 (09:35 +0000)]
[msan] Stop demangling function name in the stack origin report.

This was done by calling __cxa_demangle directly, which is bad
when c++abi library is instrumented. The following line always
contains the demangled name (when running with a symbolizer) anyway.

llvm-svn: 212929

10 years ago[Mips] Delete the empty directory.
Simon Atanasyan [Mon, 14 Jul 2014 09:01:40 +0000 (09:01 +0000)]
[Mips] Delete the empty directory.

llvm-svn: 212928

10 years ago[Mips] Remove unused test input file.
Simon Atanasyan [Mon, 14 Jul 2014 08:54:40 +0000 (08:54 +0000)]
[Mips] Remove unused test input file.

llvm-svn: 212927

10 years ago[asan] Remove XFAIL:android from 2 newly passing tests.
Evgeniy Stepanov [Mon, 14 Jul 2014 08:54:10 +0000 (08:54 +0000)]
[asan] Remove XFAIL:android from 2 newly passing tests.

Fixed in r212872.

llvm-svn: 212926

10 years agoDeadCodeElimination: Fix liveout computation
Tobias Grosser [Mon, 14 Jul 2014 08:32:01 +0000 (08:32 +0000)]
DeadCodeElimination: Fix liveout computation

We move back to a simple approach where the liveout is the last must-write
statement for a data-location plus all may-write statements. The previous
approach did not work out. We would have to consider per-data-access
dependences, instead of per-statement dependences to correct it. As this adds
complexity and it seems we would not gain anything over the simpler approach
that we implement in this commit, I moved us back to the old approach of
computing the liveout, but enhanced it to also add may-write accesses.

We also fix the test case and explain why we can not perform dead code
elimination in this case.

llvm-svn: 212925

10 years agoSuggest automated replacements of C-style casts with C++ casts.
Alexander Kornienko [Mon, 14 Jul 2014 07:37:05 +0000 (07:37 +0000)]
Suggest automated replacements of C-style casts with C++ casts.

Summary:
This patch implements a subset of possible replacements of C-style
casts with const_cast/static_cast/reinterpret_cast. This should cover a large
portion of cases in real code. Handling of a few more cases may be implemented
eventually.

Reviewers: sbenza, djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

llvm-svn: 212924

10 years agoModified gdb-remote tests to run with automatically-chosen ports.
Todd Fiala [Mon, 14 Jul 2014 06:24:44 +0000 (06:24 +0000)]
Modified gdb-remote tests to run with automatically-chosen ports.

Now that llgs supports communicating the 0-port choose-a-port
mechanism and can communicate that back to a caller via the
--named-pipe option (at parity with debugserver), we use this
mechanism to always start llgs and debugserver gdb-remote
protocol tests without needing to use some port arbitration
mechanism.  This eliminates some potential intermittent failures vs. the
previous random port and collision-avoidance strategy used.

llvm-svn: 212923

10 years agoSupport lowering of empty aggregates.
Bill Wendling [Mon, 14 Jul 2014 06:22:36 +0000 (06:22 +0000)]
Support lowering of empty aggregates.

This crash was pretty common while compiling Rust for iOS (armv7). Reason -
SjLj preparation step was lowering aggregate arguments as ExtractValue +
InsertValue. ExtractValue has assertion which checks that there is some data in
value, which is not true in case of empty (no fields) structures. Rust uses
them quite extensively so this patch uses a 'select true, %val, undef'
instruction to lower the argument.

Patch by Valerii Hiora.

llvm-svn: 212922

10 years ago[CMake] LINK_COMPONENTS: Add also corresponding MCTargetDesc and TargetInfo as well...
NAKAMURA Takumi [Mon, 14 Jul 2014 05:07:07 +0000 (05:07 +0000)]
[CMake] LINK_COMPONENTS: Add also corresponding MCTargetDesc and TargetInfo as well, when target names or "nativecodegen" are specified.

llvm-svn: 212921

10 years ago[CMake] Update libdeps.
NAKAMURA Takumi [Mon, 14 Jul 2014 05:01:53 +0000 (05:01 +0000)]
[CMake] Update libdeps.

llvm-svn: 212920

10 years ago[CMake] Reorder libdeps by alphabetical order.
NAKAMURA Takumi [Mon, 14 Jul 2014 04:59:27 +0000 (04:59 +0000)]
[CMake] Reorder libdeps by alphabetical order.

llvm-svn: 212919

10 years agoNVPTX/LLVMBuild.txt: Add "Scalar" to required_libraries. It is really referenced.
NAKAMURA Takumi [Mon, 14 Jul 2014 02:52:19 +0000 (02:52 +0000)]
NVPTX/LLVMBuild.txt: Add "Scalar" to required_libraries. It is really referenced.

llvm-svn: 212918

10 years agoObject/LLVMBuild.txt: Sort required_libraries by alphabetical order.
NAKAMURA Takumi [Mon, 14 Jul 2014 02:52:08 +0000 (02:52 +0000)]
Object/LLVMBuild.txt: Sort required_libraries by alphabetical order.

llvm-svn: 212917

10 years agoSuperficial fix for PR20218: binding a function lvalue to a const reference to
Richard Smith [Mon, 14 Jul 2014 02:28:44 +0000 (02:28 +0000)]
Superficial fix for PR20218: binding a function lvalue to a const reference to
a function pointer is neither better nor worse than binding a function lvalue
to a function rvalue reference. Don't get confused and think that both bindings
are binding to a function lvalue (which would make the lvalue form win); the
const reference is binding to an rvalue.

The "real" bug in PR20218 is still present: we're getting the wrong answer from
template argument deduction, and that's what leads us to this weird overload
set.

llvm-svn: 212916

10 years ago[DAGCombiner] Fix a crash caused by a missing check for legal type when trying to...
Andrea Di Biagio [Sun, 13 Jul 2014 21:02:14 +0000 (21:02 +0000)]
[DAGCombiner] Fix a crash caused by a missing check for legal type when trying to fold shuffles.

Verify that DAGCombiner does not crash when trying to fold a pair of shuffles
according to rule (added at r212539):
  (shuffle (shuffle A, Undef, M0), Undef, M1) -> (shuffle A, Undef, M2)

The DAGCombiner avoids folding shuffles if the resulting shuffle dag node
is not legal for the target. That means, the resulting shuffle must have
legal type and legal mask.

Before, the DAGCombiner only called method
'TargetLowering::isShuffleMaskLegal' to check if it was "safe" to fold according
to the above-mentioned rule. However, this caused a crash in the x86 backend
since method 'isShuffleMaskLegal' always expects to be called on a
legal vector type.

llvm-svn: 212915

10 years agoMC: make MCWin64EHInstruction a POD-like struct
Saleem Abdulrasool [Sun, 13 Jul 2014 19:03:45 +0000 (19:03 +0000)]
MC: make MCWin64EHInstruction a POD-like struct

This is the first of a number of changes designed to generalise
MCWin64EHInstruction to support different target architectures.  An ordered set
(vector) of these instructions is saved per frame to permit the emission of
information for Windows NT style unwinding.  The only bit of information which
is actually target specific here is the Opcode for the unwinding bytecode.  The
remainder of the information is simply generic information that is relevant to
the Windows NT unwinding model.

Remove the accessors for the fields, making them const and public instead.  Sink
the knowledge of the alias'ed name into the single source and sink a single-use
check method into the use.

llvm-svn: 212914

10 years agoMC: make helper function be more const-correct
Saleem Abdulrasool [Sun, 13 Jul 2014 19:03:40 +0000 (19:03 +0000)]
MC: make helper function be more const-correct

Introduce const-ness on parameters, they are used as read-only and should not be
modified.  NFC.

llvm-svn: 212913

10 years agoMC: make DWARF and Windows unwinding handling more similar
Saleem Abdulrasool [Sun, 13 Jul 2014 19:03:36 +0000 (19:03 +0000)]
MC: make DWARF and Windows unwinding handling more similar

Rename member variables and functions for the MCStreamer for DWARF-like
unwinding management.  Rename the Windows ones as well and make the naming and
handling similar across the two.  No functional change intended.

llvm-svn: 212912

10 years agoRemove trailing spaces
Pavel Chupin [Sun, 13 Jul 2014 17:11:45 +0000 (17:11 +0000)]
Remove trailing spaces

llvm-svn: 212911

10 years agoAdd forgotten `break` statement.
Simon Atanasyan [Sun, 13 Jul 2014 16:18:56 +0000 (16:18 +0000)]
Add forgotten `break` statement.

llvm-svn: 212910

10 years agoAdd test cases for AArch64 hints codegen
Yi Kong [Sun, 13 Jul 2014 16:17:30 +0000 (16:17 +0000)]
Add test cases for AArch64 hints codegen

llvm-svn: 212909

10 years ago[Mips] Support SHT_MIPS_ABIFLAGS section type flag in the llvm-readobj,
Simon Atanasyan [Sun, 13 Jul 2014 15:28:54 +0000 (15:28 +0000)]
[Mips] Support SHT_MIPS_ABIFLAGS section type flag in the llvm-readobj,
obj2yaml and yaml2obj tools.

llvm-svn: 212908

10 years ago[CMake] Enable loadable modules, aka plugins, with BUILD_SHARED_LIBS on cygming.
NAKAMURA Takumi [Sun, 13 Jul 2014 13:47:37 +0000 (13:47 +0000)]
[CMake] Enable loadable modules, aka plugins, with BUILD_SHARED_LIBS on cygming.

Loadable modules could be enabled without BUILD_SHARED_LIBS with tweaks in future.

llvm-svn: 212907

10 years ago[CMake] Give explicit dependencies to a couple of modules, PrintFunctionNames and...
NAKAMURA Takumi [Sun, 13 Jul 2014 13:40:23 +0000 (13:40 +0000)]
[CMake] Give explicit dependencies to a couple of modules, PrintFunctionNames and SampleAnalyzerPlugin, for Win32.DLL.

llvm-svn: 212906

10 years agoPrintFunctionNames/CMakeLists.txt: Fix a comment.
NAKAMURA Takumi [Sun, 13 Jul 2014 13:38:55 +0000 (13:38 +0000)]
PrintFunctionNames/CMakeLists.txt: Fix a comment.

llvm-svn: 212905

10 years ago[CMake] Add LLVM_LINK_COMPONENTS to loadable modules, LLVMHello and BugpointPasses...
NAKAMURA Takumi [Sun, 13 Jul 2014 13:36:48 +0000 (13:36 +0000)]
[CMake] Add LLVM_LINK_COMPONENTS to loadable modules, LLVMHello and BugpointPasses, on Win32.

llvm-svn: 212904

10 years ago[CMake] Introduce moddir for MODULE -- corresponding to LIBRARY_OUTPUT_DIRECTORY.
NAKAMURA Takumi [Sun, 13 Jul 2014 13:33:26 +0000 (13:33 +0000)]
[CMake] Introduce moddir for MODULE -- corresponding to LIBRARY_OUTPUT_DIRECTORY.

On Win32.DLL, it points not lib but bin.

LIBRARY_OUTPUT_DIRECTORY affects add_library(MODULE), especially Win32.DLL.

llvm-svn: 212903

10 years agobugpoint/ToolRunner.cpp: ProcessFailure(): Close ErrorFD immediately, or it couldn...
NAKAMURA Takumi [Sun, 13 Jul 2014 13:28:18 +0000 (13:28 +0000)]
bugpoint/ToolRunner.cpp: ProcessFailure(): Close ErrorFD immediately, or it couldn't be reopened on Win32.

FIXME: We may have an option in openFileForWrite(), not to use ResultFD but to close it.
llvm-svn: 212902

10 years agoMS ABI: Stick internal vftables in a comdat if they have RTTI data
David Majnemer [Sun, 13 Jul 2014 05:19:56 +0000 (05:19 +0000)]
MS ABI: Stick internal vftables in a comdat if they have RTTI data

Previously, we would have a private backing variable and an internal
alias pointing at it.

However, -fdata-sections only fires if a global variable has non-private
linkage.  This means that an unreferenced vftable wouldn't get
discarded, bloating the object file.

Instead, stick the backing variable in a comdat even if the alias has
internal linkage.  This will allow the linker to drop the vftable if it
is unused.

llvm-svn: 212901

10 years agoIR: Allow comdats to be applied to globals with internal linkage
David Majnemer [Sun, 13 Jul 2014 04:56:11 +0000 (04:56 +0000)]
IR: Allow comdats to be applied to globals with internal linkage

Our verifier check for checking if a global has local linkage was too
strict.  Forbid private linkage but permit local linkage.

Object file formats permit this and forbidding it prevents elimination
of unused, internal, vftables under the MSVC ABI.

llvm-svn: 212900

10 years agoMC: Let non-temporary COFF aliases be in symtab
David Majnemer [Sun, 13 Jul 2014 04:31:19 +0000 (04:31 +0000)]
MC: Let non-temporary COFF aliases be in symtab

MC was aping a binutils bug where aliases would default their linkage to
private instead of internal.

I've sent a patch to the binutils maintainers and they've recently
applied it to the GNU assembler sources.

This fixes PR20152.

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

llvm-svn: 212899

10 years agoRemove unused include
Matt Arsenault [Sun, 13 Jul 2014 03:08:59 +0000 (03:08 +0000)]
Remove unused include

llvm-svn: 212898

10 years agoR600: Use range for and fix missing consts.
Matt Arsenault [Sun, 13 Jul 2014 03:06:43 +0000 (03:06 +0000)]
R600: Use range for and fix missing consts.

llvm-svn: 212897

10 years agoR600: Make ShaderType private
Matt Arsenault [Sun, 13 Jul 2014 03:06:39 +0000 (03:06 +0000)]
R600: Make ShaderType private

llvm-svn: 212896

10 years agoR600: Run more tests with promote alloca disabled.
Matt Arsenault [Sun, 13 Jul 2014 02:46:17 +0000 (02:46 +0000)]
R600: Run more tests with promote alloca disabled.

Re-run tests changed in r211110 to test both paths.
Also fix broken check line.

llvm-svn: 212895

10 years agoR600: Run private-memory test with and without alloca promote
Matt Arsenault [Sun, 13 Jul 2014 02:18:06 +0000 (02:18 +0000)]
R600: Run private-memory test with and without alloca promote

The unpromoted path still needs to be tested since we can't
always promote to using LDS.

llvm-svn: 212894

10 years agoR600: Add option to disable promote alloca
Matt Arsenault [Sun, 13 Jul 2014 02:08:26 +0000 (02:08 +0000)]
R600: Add option to disable promote alloca

This can make writing some tests harder, so add a flag
to disable it.

llvm-svn: 212893

10 years agotests: use a more precise target for tests
Saleem Abdulrasool [Sat, 12 Jul 2014 23:40:53 +0000 (23:40 +0000)]
tests: use a more precise target for tests

llvm-svn: 212892

10 years agoHeaders: add hint intrinsics to arm_acle.h
Saleem Abdulrasool [Sat, 12 Jul 2014 23:27:26 +0000 (23:27 +0000)]
Headers: add hint intrinsics to arm_acle.h

This adds the ARM ACLE hint intrinsic wrappers to arm_acle.h.  These need to be
protected with a !defined(_MSC_VER) since MSVC (and thus clang in compatibility
mode) provide these wrappers as proper builtin intrinsics.

llvm-svn: 212891

10 years agoCodeGen: support hint intrinsics from ACLE on AArch64
Saleem Abdulrasool [Sat, 12 Jul 2014 23:27:22 +0000 (23:27 +0000)]
CodeGen: support hint intrinsics from ACLE on AArch64

This adds support for the ACLE hint intrinsics on AArch64 similar to ARM.  This
is required to properly support ACLE on AArch64.

llvm-svn: 212890

10 years agoTry to fix MSVC warning.
Matt Arsenault [Sat, 12 Jul 2014 23:16:26 +0000 (23:16 +0000)]
Try to fix MSVC warning.

llvm-svn: 212889

10 years agoTry to fix MSVC build
Matt Arsenault [Sat, 12 Jul 2014 23:09:02 +0000 (23:09 +0000)]
Try to fix MSVC build

llvm-svn: 212888

10 years agoImprove comments of ARM ACLE header file and tests
Yi Kong [Sat, 12 Jul 2014 22:48:13 +0000 (22:48 +0000)]
Improve comments of ARM ACLE header file and tests

Include section number in ARM ACLE specification for easier navigation.

llvm-svn: 212887

10 years agoTry to fix MSVC build
Matt Arsenault [Sat, 12 Jul 2014 22:19:49 +0000 (22:19 +0000)]
Try to fix MSVC build

llvm-svn: 212886

10 years agoTemplatify DominanceFrontier.
Matt Arsenault [Sat, 12 Jul 2014 21:59:52 +0000 (21:59 +0000)]
Templatify DominanceFrontier.

Theoretically this should now work for MachineBasicBlocks.

llvm-svn: 212885

10 years agoFix lldb-gdbserver build
Ed Maste [Sat, 12 Jul 2014 21:46:39 +0000 (21:46 +0000)]
Fix lldb-gdbserver build

s_listen_thread had the wrong type.

llvm-svn: 212884

10 years agoAArch64: add support for llvm.aarch64.hint intrinsic
Saleem Abdulrasool [Sat, 12 Jul 2014 21:20:49 +0000 (21:20 +0000)]
AArch64: add support for llvm.aarch64.hint intrinsic

This adds a llvm.aarch64.hint intrinsic to mirror the llvm.arm.hint in order to
support the various hint intrinsic functions in the ACLE.

Add an optional pattern field that permits the subclass to specify the pattern
that matches the selection.  The intrinsic pattern is set as mayLoad, mayStore,
so overload the value for the definition of the hint instruction.

llvm-svn: 212883

10 years agoMC: remove use of unnecessary variable
Saleem Abdulrasool [Sat, 12 Jul 2014 20:49:13 +0000 (20:49 +0000)]
MC: remove use of unnecessary variable

Due to the fact that the windows unwinding has the concept of chained frames, we
maintain a current frame info pointer that is adjusted on any push and pop of a
unwinding context.  This just removes an unnecessary variable that was used to
mirror the DWARF unwinding code.

llvm-svn: 212882

10 years agoMC: rename MCW64UnwindInfo to MCWinFrameInfo
Saleem Abdulrasool [Sat, 12 Jul 2014 20:49:09 +0000 (20:49 +0000)]
MC: rename MCW64UnwindInfo to MCWinFrameInfo

This structure contains information related to the call frame used to generate
unwinding information.  Rename this to reflect the future use to represent the
shared state between various architectures for WinCFI information.

llvm-svn: 212881

10 years ago[ELFYAML] Group ELF section type flags to target specific blocks.
Simon Atanasyan [Sat, 12 Jul 2014 18:25:08 +0000 (18:25 +0000)]
[ELFYAML] Group ELF section type flags to target specific blocks.
Recognize only flags which correspond to the current target.

llvm-svn: 212880

10 years agollgs: modify to accept --native-regs flag.
Todd Fiala [Sat, 12 Jul 2014 17:34:24 +0000 (17:34 +0000)]
llgs: modify to accept --native-regs flag.

This is the last flag sent by lldb-platform that was not accepted
by llgs and is accepted by debugserver.

Conditionalized out a bit more code in prep for Windows
support one day based on _WIN32 define.

Updated the lldb-gdbserver usage string to represent
recent updates to command line arguments (and some older
ones like --attach pid).

Implements https://github.com/tfiala/lldb/issues/37

llvm-svn: 212879

10 years agoAdd FreeBSD failure decorator for TestCallStopAndContinue
Ed Maste [Sat, 12 Jul 2014 15:41:03 +0000 (15:41 +0000)]
Add FreeBSD failure decorator for TestCallStopAndContinue

The testrun now completes successfully on my FreeBSD 11.0-CURRENT
laptop.  There are some intermittent failures on the FreeBSD buildbot
still, which should be addressed in later commits.

llvm.org/pr20274

llvm-svn: 212878

10 years agoAdd FreeBSD decorator for TestMultipleDebuggers
Ed Maste [Sat, 12 Jul 2014 15:21:55 +0000 (15:21 +0000)]
Add FreeBSD decorator for TestMultipleDebuggers

llvm.org/pr20282

llvm-svn: 212877

10 years agoFixed compilation errors in tests, enforce checking for errors in check_clang_tidy_fi...
Alexander Kornienko [Sat, 12 Jul 2014 13:16:58 +0000 (13:16 +0000)]
Fixed compilation errors in tests, enforce checking for errors in check_clang_tidy_fix.sh.

Reviewers: sbenza, djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

llvm-svn: 212876

10 years agoFix an issue with the MergeBasicBlockIntoOnlyPred() helper function where it did
Owen Anderson [Sat, 12 Jul 2014 07:12:47 +0000 (07:12 +0000)]
Fix an issue with the MergeBasicBlockIntoOnlyPred() helper function where it did
not properly handle the case where the predecessor block was the entry block to
the function.  The only in-tree client of this is JumpThreading, which worked
around the issue in its own code.  This patch moves the solution into the helper
so that JumpThreading (and other clients) do not have to replicate the same fix
everywhere.

llvm-svn: 212875

10 years agoAdd nonnull in CodeGen for __attribute__((returns_nonnull))
Hal Finkel [Sat, 12 Jul 2014 04:51:04 +0000 (04:51 +0000)]
Add nonnull in CodeGen for __attribute__((returns_nonnull))

As a follow-up to r212835, also add the LLVM nonnull function attribute when
__attribute__((returns_nonnull)) is provided.

llvm-svn: 212874

10 years agollgs: implement --setsid.
Todd Fiala [Sat, 12 Jul 2014 01:12:44 +0000 (01:12 +0000)]
llgs: implement --setsid.

The --setsid (-S) option changes the session id for the lldb-gdbserver process.
This is used by tools such as lldb-platform and allows the user to prevent
llgs from being in the same session as a calling terminal session.
This will prevents terminal group control signals from affecting
lldb-gdbserver.

See also:
https://github.com/tfiala/lldb/issues/38

llvm-svn: 212873

10 years ago[ASan] Collect unmangled names of global variables in Clang to print them in error...
Alexey Samsonov [Sat, 12 Jul 2014 00:42:52 +0000 (00:42 +0000)]
[ASan] Collect unmangled names of global variables in Clang to print them in error reports.

Currently ASan instrumentation pass creates a string with global name
for each instrumented global (to include global names in the error report). Global
name is already mangled at this point, and we may not be able to demangle it
at runtime (e.g. there is no __cxa_demangle on Android).

Instead, create a string with fully qualified global name in Clang, and pass it
to ASan instrumentation pass in llvm.asan.globals metadata. If there is no metadata
for some global, ASan will use the original algorithm.

This fixes https://code.google.com/p/address-sanitizer/issues/detail?id=264.

llvm-svn: 212872

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