Commit Graph

213072 Commits

Author SHA1 Message Date
Hafiz Abid Qadeer 3eedf96a5a Fix warnings in LLDBWrapPython.cpp with gcc 4.9.
Summary:
I see a lot of following warnings in LLDBWrapPython.cpp while building with gcc 4.9 on Linux.
"warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual]"

Is it ok to add -Wno-cast-qual for this file in cmake for gcc. This option seems to be already present
for autotool case.

Reviewers: zturner, clayborg

Subscribers: lldb-commits

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

llvm-svn: 250380
2015-10-15 08:27:01 +00:00
Hrvoje Varga 3ef4dd7bc8 [mips][microMIPS] Implement LLE and SCE instructions
Differential Revision: http://reviews.llvm.org/D11630

llvm-svn: 250379
2015-10-15 08:11:50 +00:00
Hal Finkel 736c741752 [ELF2] Set a target-specific VAStart for PPC64
After some additional post-commit (post-revert) discussion and research, this
reverts, in part, r250205, so the ABI-recommended starting address can be used
on PPC64 (as is done by other linkers).

Also, this addresses the FIXME in ELF/Writer.cpp by making VAStart a
target-dependent property.

llvm-svn: 250378
2015-10-15 07:49:07 +00:00
Hrvoje Varga a766eff5a0 [mips][microMIPS] Implement LWLE, LWRE, SWLE and SWRE instructions
Differential Revision: http://reviews.llvm.org/D11631

llvm-svn: 250377
2015-10-15 07:23:06 +00:00
Lang Hames 2ac52760b9 [RuntimeDyld] Drop the '.s' suffix off the COFF test case - the MIPS bot started
failing when the suffix was added.

I assume the lack of a '.s' suffix means that the test case just wasn't running
before, and it has never worked on MIPS. I'll investigate that tomorrow.

llvm-svn: 250376
2015-10-15 07:16:40 +00:00
Eric Christopher 73f00412f7 Update for llvm API change.
llvm-svn: 250375
2015-10-15 07:01:16 +00:00
Eric Christopher bdafb3cd1c Remove DIFile from createSubroutineType.
Patch by Amaury Sechet with a small modification by me.

llvm-svn: 250374
2015-10-15 06:56:10 +00:00
Eric Christopher 28a6db5929 Update clang for DIBuilder::createSubroutineType API change.
Patch by Amaury Sechet!

llvm-svn: 250373
2015-10-15 06:56:08 +00:00
Hal Finkel ae3f05b987 [ELF2/PPC64] Remove now-dead weak/undef check
After r250311, this check is dead. Remove it.

llvm-svn: 250372
2015-10-15 06:44:19 +00:00
Lang Hames 86a4593dd2 [RuntimeDyld] Don't try to get the contents of sections that don't have any
(e.g. bss sections).

MachO and ELF have been silently letting this pass, but COFFObjectFile contains
an assertion to catch this kind of (ab)use of the getSectionContents, and this
was causing the JIT to crash on COFF objects with BSS sections. This patch
should fix that.

llvm-svn: 250371
2015-10-15 06:41:45 +00:00
Akira Hatanaka 8ad7399f8e [MachO] Stop generating *coal* sections.
Recommit r250342: move coal-sections-powerpc.s to subdirectory for powerpc.

Some background on why we don't have to use *coal* sections anymore:
Long ago when C++ was new and "weak" had not been standardized, an attempt was
made in cctools to support C++ inlines that can be coalesced by putting them
into their own section (TEXT/textcoal_nt instead of TEXT/text).

The current macho linker supports the weak-def bit on any symbol to allow it to
be coalesced, but the compiler still puts weak-def functions/data into alternate
section names, which the linker must map back to the base section name.

This patch makes changes that are necessary to prevent the compiler from using
the "coal" sections and have it use the non-coal sections instead when the
target architecture is not powerpc:

TEXT/textcoal_nt instead use TEXT/text
TEXT/const_coal instead use TEXT/const
DATA/datacoal_nt instead use DATA/data

If the target is powerpc, we continue to use the *coal* sections since anyone
targeting powerpc is probably using an old linker that doesn't have support for
the weak-def bits.

Also, have the assembler issue a warning if it encounters a *coal* section in
the assembly file and inform the users to use the non-coal sections instead.

rdar://problem/14265330

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

llvm-svn: 250370
2015-10-15 05:28:38 +00:00
Craig Topper 1ac9bfb844 [X86] Add proper feature names to xsave builtins.
llvm-svn: 250369
2015-10-15 05:23:46 +00:00
Craig Topper da9fe56bf6 [X86] Add command line switches for xsave/xsaveopt/xsavec/xsaves. Macro defines for the same. And add the flags to correct CPU names.
llvm-svn: 250368
2015-10-15 05:23:38 +00:00
Hrvoje Varga 8c9526400e Test commit.
llvm-svn: 250367
2015-10-15 05:20:51 +00:00
Manman Ren f5499fd9d5 Temporarily revert r250345 to sort out bot failure.
With r250345 and r250343, we start to observe the following failure
when bootstrap clang with lto and pgo:
PHI node entries do not match predecessors!
  %.sroa.029.3.i = phi %"class.llvm::SDNode.13298"* [ null, %30953 ], [ null, %31017 ], [ null, %30998 ], [ null, %_ZN4llvm8dyn_castINS_14ConstantSDNodeENS_7SDValueEEENS_10cast_rettyIT_T0_E8ret_typeERS5_.exit.i.1804 ], [ null, %30975 ], [ null, %30991 ], [ null, %_ZNK4llvm3EVT13getScalarTypeEv.exit.i.1812 ], [ %..sroa.029.0.i, %_ZN4llvm11SmallVectorIiLj8EED1Ev.exit.i.1826 ], !dbg !451895
label %30998
label %_ZNK4llvm3EVTeqES0_.exit19.thread.i
LLVM ERROR: Broken function found, compilation aborted!

I will re-commit this if the bot does not recover.

llvm-svn: 250366
2015-10-15 04:58:24 +00:00
Saleem Abdulrasool b5bba5c256 builtins: Expand out floating point exponents for MSVC
MSVC 2013 doesnt support C99 fully, including the hexidecimal floating point
representation.  Use the expanded value to permit building with it.

Patch by Tee Hao Wei!

llvm-svn: 250365
2015-10-15 04:26:19 +00:00
Jason Molenda f415791bda In r240466, when Greg added the jThreadsInfo packet, he accidentally
disabled the use of the jThreadGetExtendedInfo packet which is used
to retrieve additional information about a thread, such as the QoS
setting for that thread on darwin systems.  

Re-enable the use of the jThreadGetExtendedInfo packet, and add 
some quick tests to the TestQueues mac test case which will verify
that we can retrieve the QoS names for these test threads.

<rdar://problem/22925096> 

llvm-svn: 250364
2015-10-15 04:20:42 +00:00
Douglas Katzman 64071ad864 Remove unnecessary braces in single-line 'if'.
llvm-svn: 250363
2015-10-15 04:10:40 +00:00
Craig Topper fd2cc7cd8a Add XSAVE/XSAVEOPT to KNL processor.
llvm-svn: 250362
2015-10-15 03:56:54 +00:00
Eric Fiselier f0d8022ee3 Add links to libc++ code coverage and builders
llvm-svn: 250361
2015-10-15 03:27:02 +00:00
Saleem Abdulrasool 9ca87a63ad builtins: use C implementation on MSVC
The assembly implementations use GNU syntax which MSVC doesn't handle.  Rather
than duplicate the code in a second syntax, use the C implementations.

Patch by Tee Hao Wei!

llvm-svn: 250360
2015-10-15 02:47:19 +00:00
Saleem Abdulrasool 956365ef7f builtins: __builtin_clzll for x86 on MSVC
Add an implementation for __builtin_clzll on MSVC even when _BitScanForward4 is
unavailable.

Patch by Tee Hao Wei!

llvm-svn: 250359
2015-10-15 02:46:37 +00:00
Rui Ueyama 55c3f89edb ELF2: Do not use OutputSection as a member variable name.
We have OutputSection<ELFT> type. GCC 4.9.2 warns on the duplication.

llvm-svn: 250358
2015-10-15 01:58:40 +00:00
David Majnemer 0943419262 s/NumFiles/NumStreams/
llvm-svn: 250357
2015-10-15 01:39:00 +00:00
David Majnemer 6e08126f31 [llvm-pdbdump] Provide a mechanism to dump the raw contents of a PDB
A PDB can be thought of as a very simple file system.  It is
occasionally illuminating to see the contents of the underlying files.

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

llvm-svn: 250356
2015-10-15 01:27:19 +00:00
Richard Smith 93e9bb0864 Fix -Wmismatched-tags error in modules build by removing unused forward declaration.
llvm-svn: 250355
2015-10-15 01:15:26 +00:00
Davide Italiano 0c90106f28 [bugpoint] llvm-gcc doesn't exist anymore ...
... so this comment is stale. Remove it. Range-loopify while here.

llvm-svn: 250354
2015-10-15 01:12:01 +00:00
Greg Clayton 5ea4483a32 Fix the ability to quit and use a custom exception. Also print tree items out so they are more aligned.
llvm-svn: 250353
2015-10-15 00:49:36 +00:00
Quentin Colombet 5084e44d71 [ARM] Make sure we do not dereference the end iterator when accessing debug
information.
Although the problem was always here, it would only be exposed when
shrink-wrapping is enable.

rdar://problem/23110493

llvm-svn: 250352
2015-10-15 00:41:26 +00:00
Akira Hatanaka 276332b47f Revert r250349.
Test case coal-sections-powerpc.s is still failing on some buildbots.

llvm-svn: 250351
2015-10-15 00:11:03 +00:00
Davide Italiano 89151a08fc [JIT] TrivialMemoryManager: Fail if we can't allocate memory.
TrivialMemoryManager currently doesn't check the return type of AllocateRWX --
and returns a 'null' MemoryBlock to its caller. As pointed out by Lang,
this exposes some serious issues with the MemoryManager interface. There's,
in fact, no way to report back an error to clients rather than aborting in
case memory can't be allocated. Eventually the interface will grow to support
this, but for now, fail sooner rather than later.

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

llvm-svn: 250350
2015-10-15 00:05:32 +00:00
Akira Hatanaka 1cea644114 [MachO] Stop generating *coal* sections.
Recommit r250342: add -arch=ppc32 to the RUN lines of powerpc tests.

Some background on why we don't have to use *coal* sections anymore:
Long ago when C++ was new and "weak" had not been standardized, an attempt was
made in cctools to support C++ inlines that can be coalesced by putting them
into their own section (TEXT/textcoal_nt instead of TEXT/text).

The current macho linker supports the weak-def bit on any symbol to allow it to
be coalesced, but the compiler still puts weak-def functions/data into alternate
section names, which the linker must map back to the base section name.

This patch makes changes that are necessary to prevent the compiler from using
the "coal" sections and have it use the non-coal sections instead when the
target architecture is not powerpc:

TEXT/textcoal_nt instead use TEXT/text
TEXT/const_coal instead use TEXT/const
DATA/datacoal_nt instead use DATA/data

If the target is powerpc, we continue to use the *coal* sections since anyone
targeting powerpc is probably using an old linker that doesn't have support for
the weak-def bits.

Also, have the assembler issue a warning if it encounters a *coal* section in
the assembly file and inform the users to use the non-coal sections instead.

rdar://problem/14265330

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

llvm-svn: 250349
2015-10-14 23:48:10 +00:00
Craig Topper 543f3bdf39 [X86] Use C+11 non-static data member initialization to initialize all the X86 feature controls. NFC
This simplifies the constructor initialization list and makes it less likely a feature flag will be forgotten there.

llvm-svn: 250348
2015-10-14 23:47:57 +00:00
Rafael Espindola 39428e9358 Remove silly getter use.
It was creating a local var with the same name as the member var.

llvm-svn: 250347
2015-10-14 23:30:28 +00:00
Akira Hatanaka d58d347e42 Revert r250342.
Investigate why coal-sections-powerpc.s is failing on some buildbots.

llvm-svn: 250346
2015-10-14 23:29:10 +00:00
Cong Hou b74d3b3b86 Update the branch weight metadata in JumpThreading pass.
Currently in JumpThreading pass, the branch weight metadata is not updated after CFG modification. Consider the jump threading on PredBB, BB, and SuccBB. After jump threading, the weight on BB->SuccBB should be adjusted as some of it is contributed by the edge PredBB->BB, which doesn't exist anymore. This patch tries to update the edge weight in metadata on BB->SuccBB by scaling it by 1 - Freq(PredBB->BB) / Freq(BB->SuccBB).

This is the third attempt to submit this patch, while the first two led to failures in some FDO tests. After investigation, it is the edge weight normalization that caused those failures. In this patch the edge weight normalization is fixed so that there is no zero weight in the output and the sum of all weights can fit in 32-bit integer. Several unit tests are added.

Differential revision: http://reviews.llvm.org/D10979

llvm-svn: 250345
2015-10-14 23:14:17 +00:00
Philip Reames aae328d6eb Test case which should have been part of 250343
llvm-svn: 250344
2015-10-14 22:47:06 +00:00
Philip Reames b42db21de8 [SimplifyCFG] Speculatively flatten CFG based on profiling metadata
If we have a series of branches which are all unlikely to fail, we can possibly combine them into a single check on the fastpath combined with a bit of dispatch logic on the slowpath. We don't want to do this unconditionally since it requires speculating instructions past a branch, but if the profiling metadata on the branch indicates profitability, this can reduce the number of checks needed along the fast path.

The canonical example this is trying to handle is removing the second bounds check implied by the Java code: a[i] + a[i+1]. Note that it can currently only do so for really simple conditions and the values of a[i] can't be used anywhere except in the addition. (i.e. the load has to have been sunk already and not prevent speculation.) I plan on extending this transform over the next few days to handle alternate sequences.

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

llvm-svn: 250343
2015-10-14 22:46:19 +00:00
Akira Hatanaka c078ae3e4f [MachO] Stop generating *coal* sections.
Some background on why we don't have to use *coal* sections anymore:
Long ago when C++ was new and "weak" had not been standardized, an attempt was
made in cctools to support C++ inlines that can be coalesced by putting them
into their own section (TEXT/textcoal_nt instead of TEXT/text).

The current macho linker supports the weak-def bit on any symbol to allow it to
be coalesced, but the compiler still puts weak-def functions/data into alternate
section names, which the linker must map back to the base section name.

This patch makes changes that are necessary to prevent the compiler from using
the "coal" sections and have it use the non-coal sections instead when the
target architecture is not powerpc:

TEXT/textcoal_nt instead use TEXT/text
TEXT/const_coal instead use TEXT/const
DATA/datacoal_nt instead use DATA/data

If the target is powerpc, we continue to use the *coal* sections since anyone
targeting powerpc is probably using an old linker that doesn't have support for
the weak-def bits.

Also, have the assembler issue a warning if it encounters a *coal* section in
the assembly file and inform the users to use the non-coal sections instead.

rdar://problem/14265330

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

llvm-svn: 250342
2015-10-14 22:45:36 +00:00
Enrico Granata bbf1da3c9a Add a data formatter for __NSArray0, the type of empty arrays
llvm-svn: 250341
2015-10-14 22:45:04 +00:00
Enrico Granata c3ef0ed5bf Fix a couple issues where trying to print a type would cause LLDB to crash
llvm-svn: 250340
2015-10-14 22:44:50 +00:00
Enrico Granata 9543803801 Fix a problem where LLDB could sometimes try to get the size of an Objective-C type without passing an appropriate ExecutionContext
llvm-svn: 250339
2015-10-14 22:44:30 +00:00
Philip Reames ddcf6b35a2 Tighten known bits for ctpop based on zero input bits
This is a cleaned up patch from the one written by John Regehr based on the findings of the Souper superoptimizer.

The basic idea here is that input bits that are known zero reduce the maximum count that the intrinsic could return. We know that the number of bits required to represent a particular count is at most log2(N)+1.

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

llvm-svn: 250338
2015-10-14 22:42:12 +00:00
Rui Ueyama 690db6786e Simplify.
llvm-svn: 250337
2015-10-14 22:32:10 +00:00
Eric Fiselier dfdf929ac9 Update issues status
llvm-svn: 250336
2015-10-14 22:26:40 +00:00
Stephane Sezer 86388ae768 Fix codesign command with cmake.
Summary:
Looks like having a space in the Xcode path triggers this bug. We need
to use cmake -E env FOO=bar [COMMAND] to set the environment instead.

I am using cmake 3.3.1 and ninja 1.6.0 and I get this:

    [2681/2756] Linking CXX executable bin/debugserver
    FAILED: : && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++   -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -std=c++11 -fcolor-diagnostics -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-deprecated-register -Wno-vla-extension  -fno-exceptions -fno-rtti -Wno-gnu-zero-variadic-macro-arguments -Wno-zero-length-array -Wno-extended-offsetof -g -Wl,-search_paths_first -Wl,-headerpad_max_install_names -stdlib=libc++ -Wl,-sectcreate,__TEXT,__info_plist,/Users/sas/Source/llvm/tools/lldb/tools/debugserver/source/../resources/lldb-debugserver-Info.plist tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/HasAVX.s.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/CFBundle.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/CFData.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/CFString.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/Genealogy.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachException.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachProcess.mm.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachTask.mm.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachThread.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachThreadList.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachVMMemory.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachVMRegion.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/mach_excServer.c.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/mach_excUser.c.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/debugserver_vers.c.o  -o bin/debugserver  lib/liblldbDebugserverCommon.a lib/liblldbUtility.a lib/liblldbDebugserverMacOSX_I386.a lib/liblldbDebugserverMacOSX_X86_64.a -framework Cocoa -Wl,-rpath,@executable_path/../lib && cd /Users/sas/Source/llvm/build/bin && "CODESIGN_ALLOCATE=/Applications/Xcode 6.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate" codesign --force --sign lldb_codesign debugserver
    /bin/sh: CODESIGN_ALLOCATE=/Applications/Xcode 6.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate: No such file or directory
    [2681/2756] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Target.cpp.o
    ninja: build stopped: subcommand failed.

Reviewers: clayborg, dawn, brucem, tfiala

Subscribers: lldb-commits

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

llvm-svn: 250335
2015-10-14 22:25:43 +00:00
Rui Ueyama 2b675074fe ELF2: Support --entry=<addr>.
If an argument for --entry is a number, that's not a symbol name but
an absolute address. If that's the case, the address is directly set
to ELF header's e_entry.

llvm-svn: 250334
2015-10-14 22:20:57 +00:00
Chris Bieneman f9e0b253ad [CMake] Make LLVM_VERSION_* variables user definable
CMake's set command overwrites existing values. Package maintainers may want or need to set the version variables manually, so we need to only set them if they are not already defined. Note I use the "if(NOT DEFINED ...)" syntax deliberately in the last case because empty string is a valid value for the suffx, but not the other variables.

llvm-svn: 250333
2015-10-14 21:50:09 +00:00
Sanjay Patel e2b528074d add x86 codegen tests for 'add nsw' followed by 'sext'
llvm-svn: 250332
2015-10-14 21:47:03 +00:00
Zachary Turner 4eff2d3177 Make uses of /dev/null portable across OSes.
Most platforms have "/dev/null".  Windows has "nul".  Instead of
hardcoding the string /dev/null at various places, make a constant
that contains the correct value depending on the platform, and use
that everywhere instead.

llvm-svn: 250331
2015-10-14 21:37:36 +00:00