Commit Graph

92765 Commits

Author SHA1 Message Date
Rafael Espindola 04fa5c17d8 Covert remaining graph viewers from sys::Path to std::string.
llvm-svn: 183921
2013-06-13 17:32:16 +00:00
Rafael Espindola 48944e7a9a Update code for other graph viewing programs too.
llvm-svn: 183920
2013-06-13 17:27:45 +00:00
Rafael Espindola ce61b1e5b1 Reduce usage of sys::Path in the graph writer.
Now PathV1.h is not needed in GraphWriter.h.

llvm-svn: 183919
2013-06-13 17:20:48 +00:00
Rafael Espindola 013b42cb1d Add a version of DisplayGraph that takes a StringRef.
llvm-svn: 183915
2013-06-13 16:56:13 +00:00
Amaury de la Vieuville bd2b610eba ARM: fix B decoding
llvm-svn: 183914
2013-06-13 16:41:55 +00:00
Amaury de la Vieuville 231ca2bdc3 ARM: fix t2am_imm8_offset operand printing for imm=#-0
llvm-svn: 183913
2013-06-13 16:40:51 +00:00
Rafael Espindola e7a629fb33 Further reduce usage of sys::Path in bugpoint.
llvm-svn: 183912
2013-06-13 16:22:26 +00:00
Rafael Espindola c0bbe36245 Try to fix the build with libstdc++ 4.4.
llvm-svn: 183909
2013-06-13 15:52:54 +00:00
Rafael Espindola b851d42f47 Reduce sys::Path usage in bugpoint.
llvm-svn: 183908
2013-06-13 15:47:11 +00:00
Benjamin Kramer af6c3b7002 X86: Make the cmov aliases work with intel syntax too.
llvm-svn: 183907
2013-06-13 15:45:24 +00:00
Reid Kleckner 6e6a0f50b3 [Support] Fix handle and memory leak for processes that are not waited for
Execute's Data parameter is now optional, so we won't allocate memory
for it on Windows and we'll close the process handle.

The Unix code should probably do something similar to avoid accumulation
of zombie children that haven't been waited on.

Tested on Linux and Windows.

llvm-svn: 183906
2013-06-13 15:27:17 +00:00
Aaron Ballman 54e9bd2239 Zero-initializing variables; fixes a build breakage introduced in r183864.
llvm-svn: 183904
2013-06-13 14:39:07 +00:00
Dan Gohman 6a0c9ae4f9 Print ConstantPool entries initialized to Values with WriteAsOperand instead of
operator<< so that functions are printed as just their name instead of as their
entire definition, which is excessively verbose in this context.

llvm-svn: 183871
2013-06-12 22:19:19 +00:00
Rafael Espindola 0c24b20d33 [Win] Put ChangeStdinToBinary ChangeStdoutToBinary ChangeStderrToBinary in sys.
llvm-svn: 183868
2013-06-12 21:25:04 +00:00
Rafael Espindola 2bb2aa27bf s/Void/void.
llvm-svn: 183866
2013-06-12 21:16:07 +00:00
Rafael Espindola 404ae77e38 Attempt at fixing the windows build.
llvm-svn: 183865
2013-06-12 21:11:50 +00:00
Rafael Espindola cb2eca0f91 Remove the program class.
It was only used to implement ExecuteAndWait and ExecuteNoWait. Expose just
those two functions and make Execute and Wait implementations details.

llvm-svn: 183864
2013-06-12 20:58:35 +00:00
David Blaikie c2467c4e9b Revert r183854 (PPC: Fix switch warnings from r183841)
Now that the PRED_BAD has been removed, this is failing the Clang
-Werror build due to -Wcovered-switch-default.

llvm-svn: 183863
2013-06-12 20:57:32 +00:00
Rafael Espindola 35ac91c932 Add global versions of some Program static methods.
This is a temporary stepping stone for moving them out of Program.

llvm-svn: 183860
2013-06-12 20:42:59 +00:00
Bill Schmidt 4fcb8c260e [PowerPC] Remove PRED_BAD from PPC::Predicate enumeration.
I'm taking David Blaikie's suggestion to use an
Optional<PPC::Predicate> return value instead.  That's the right
solution for this problem.  Thanks for pointing out that possibility!

llvm-svn: 183858
2013-06-12 20:22:24 +00:00
Bill Schmidt 31c60f740e [PowerPC] Fix switch warnings from r183841.
Introducing PRED_BAD caused some unexpected warnings that are now
suppressed.

llvm-svn: 183854
2013-06-12 19:20:32 +00:00
Rui Ueyama 82ebd8e36d readobj: Dump PE/COFF optional records.
These records are mandatory for executables and are used by the loader.

Reviewers: rafael

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D939

llvm-svn: 183852
2013-06-12 19:10:33 +00:00
Rafael Espindola 8d30480344 Always remove an alias when we rename the target.
Should fix the dragonegg build bots.

llvm-svn: 183845
2013-06-12 16:45:47 +00:00
Bill Schmidt 230b451389 [PowerPC] Expose some calling convention functions in PPCISelLowering.h.
This is a preparatory patch for fast-isel support.  The instruction
selector will need to access some functions in PPCGenCallingConv.inc,
which in turn requires several helper functions to be defined.  These
are currently defined near the only use of PCCGenCallingConv.inc,
inside PPCISelLowering.cpp.  This patch moves the declaration of the
functions into the associated header file to provide the needed
visibility.

No functional change intended.

llvm-svn: 183844
2013-06-12 16:39:22 +00:00
Rafael Espindola fb3fc0bf34 Convert test to FileCheck.
llvm-svn: 183843
2013-06-12 16:35:53 +00:00
Rafael Espindola 385c06ffc9 Don't use PathV1 in CommandLine.cpp.
No functionality change.

llvm-svn: 183842
2013-06-12 15:37:27 +00:00
Bill Schmidt 6207a4b7dd Add artificial PRED_BAD to PPC::Predicate enumeration.
Allows returning a PPC::Predicate from a function with a no-predicate
value possible.  Preparatory patch for fast-isel on PPC64 ELF.  No
behavioral change intended.

llvm-svn: 183841
2013-06-12 15:14:42 +00:00
Rafael Espindola 71affba988 Inline Path::isBitcodeFile into only use and remove it.
llvm-svn: 183840
2013-06-12 15:13:57 +00:00
Rafael Espindola b703be2544 Remove Path::getMagicNumber.
llvm-svn: 183839
2013-06-12 15:07:11 +00:00
Rafael Espindola e3e790a46e Remove Path::hasMagicNumber.
llvm-svn: 183838
2013-06-12 15:04:59 +00:00
Rafael Espindola af93517dde Remove Path::isAbsolute.
llvm-svn: 183836
2013-06-12 15:02:39 +00:00
Rafael Espindola 87b03450ee Remove Path::isAbsolute().
llvm-svn: 183835
2013-06-12 14:47:33 +00:00
Ulrich Weigand 32d725b80a [MC/DWARF] Support .debug_frame / .debug_line code alignment factors
I've been comparing the object file output of LLVM's integrated
assembler against the external assembler on PowerPC, and one
area where differences still remain are in DWARF sections.

In particular, the GNU assembler generates .debug_frame and
.debug_line sections using a code alignment factor of 4, since
all PowerPC instructions have size 4 and must be aligned to a
multiple of 4.  However, current MC code hard-codes a code
alignment factor of 1.

This patch changes this by adding a "minimum instruction alignment"
data element to MCAsmInfo and using this as code alignment factor.

This requires passing a MCContext into MCDwarfLineAddr::Encode
and MCDwarfLineAddr::EncodeAdvanceLoc.  Note that one caller,
MCDwarfLineAddr::Write, didn't actually have that information
available.  However, it turns out that this routine is in fact
never used in the whole code base, so the patch simply removes
it.  If it turns out to be needed again at a later time, it
could be re-added with an updated interface.

llvm-svn: 183834
2013-06-12 14:46:54 +00:00
Rafael Espindola 46e2ea64cc Remove Path::getSuffix.
llvm-svn: 183833
2013-06-12 14:32:51 +00:00
Rafael Espindola ec4f0fc7c1 Remove sys::CopyFile.
llvm-svn: 183831
2013-06-12 14:16:52 +00:00
Patrik Hagglund 7e79636e19 Fix 'gcc -flto' builds for unittest binaries (undefined reference to
`typeinfo for llvm:🆑:GenericOptionValue').

Remove an "anchor" method for an abstract class. (This does not
increase the number of vtables.)

llvm-svn: 183830
2013-06-12 14:15:21 +00:00
Ulrich Weigand d45c68cb9c [PowerPC] Use assembler source in MC tests
A couple of old test cases in test/MC/PowerPC were still using
LLVM IR.  Now that we have a working assembler, we can move
them to assembler tests instead:
  ppc64-initial-cfa.ll
  ppc64-relocs-01.ll
  ppc64-tls-relocs-01.ll

llvm-svn: 183829
2013-06-12 14:14:18 +00:00
Rafael Espindola d88308767b Remove the old file memory mapping functions.
llvm-svn: 183828
2013-06-12 14:11:15 +00:00
Rafael Espindola 1d08f5ae7c Remove Path::createFileOnDisk.
llvm-svn: 183827
2013-06-12 13:59:17 +00:00
Rafael Espindola d5fd942ec3 Remove Path::makeExecutableOnDisk.
llvm-svn: 183826
2013-06-12 13:55:07 +00:00
Renato Golin 11cb23a6f7 Update Release Process doc
llvm-svn: 183825
2013-06-12 11:35:33 +00:00
Patrik Hagglund 0cc888b786 Fix gcc -flto build, by adding LLVM_ATTRIBUTE_USED to
LLVMX86CompilationCallback2, called from inline asm.

llvm-svn: 183824
2013-06-12 08:45:39 +00:00
Sean Silva 81db71ff07 [yaml2obj] Remove fragile test case.
This test case was a "sanity check"/"breathing" test case at first, but
is really fragile, which impairs changes to yaml2obj.

`test/Object/yaml2obj-elf-bits-endian.test` is much more robust and
serves as an adequate sanity check.

llvm-svn: 183811
2013-06-12 00:01:26 +00:00
Sean Silva 31836f3bd7 80-cols
This slipped in during a hasty renaming.

llvm-svn: 183810
2013-06-12 00:01:22 +00:00
Eric Christopher 5331f0eeb8 Correct the def registers for the 8bit x86 divide instructions to
match the comments and what the instruction actually does. Noticed
on inspection.

llvm-svn: 183809
2013-06-11 23:41:44 +00:00
Eric Christopher 8f6a083be7 Use the Copy we defined above here.
llvm-svn: 183808
2013-06-11 23:41:41 +00:00
Eric Christopher 773c155c15 Formatting.
llvm-svn: 183807
2013-06-11 23:41:38 +00:00
Akira Hatanaka f5288c26de Fix CMakeLists.
llvm-svn: 183804
2013-06-11 22:36:30 +00:00
Akira Hatanaka 5c50a16ee0 [mips] Add an IR transformation pass that optimizes calls to sqrt.
The pass emits a call to sqrt that has attribute "read-none". This call will be
converted to an ISD::FSQRT node during DAG construction, which will turn into
a mips native sqrt instruction.
 

llvm-svn: 183802
2013-06-11 22:21:44 +00:00
Rafael Espindola 3bc8e71909 Move PathV2.h to Path.h
Most clients have already been moved from Path V1 to V2. The ones using V1
now include PathV1.h explicitly.

llvm-svn: 183801
2013-06-11 22:21:28 +00:00
JF Bastien 3c6bb8e19f ARM FastISel fix sext/zext fold
Sign- and zero-extension folding was slightly incorrect because it wasn't checking that the shift on extensions was zero. Further, I recently added AND rd, rn, #255 as a form of 8-bit zero extension, and failed to add the folding code for it.

This patch fixes both issues.

This patch fixes both, and the test should remain the same:
  test/CodeGen/ARM/fast-isel-fold.ll

llvm-svn: 183794
2013-06-11 22:13:46 +00:00
Tobias Grosser bd9e549e21 Make host ARM CPU feature detection independent of the vendor
For ARM on linux we use /proc/cpuinfo to detect the host CPU's features.
Linux derives these values without ever looking at the vendor of the
specific CPU implementation. Hence, it adds little value, if we parse
the output of /proc/cpuinfo only for certain vendors.

This patch enables us to derive the correct feature flags e.g. for Qualcomm
CPUs.

llvm-svn: 183790
2013-06-11 21:45:01 +00:00
Rui Ueyama 51cd4e98ff [PECOFF] Remove COFF header from PE header for simplicity.
COFF header is always present both in executable and in object file. PE header
is present only in executable. So the natural way to handle PE/COFF file is
treating COFF is mandatory header and PE is optional. Current data structre
does not allow it, because PE header includes COFF header. Removing COFF
header will simplify the code to handle PE/COFF files.

Reviewers: Bigcheese

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D952

llvm-svn: 183788
2013-06-11 21:39:48 +00:00
Rafael Espindola d1fcac9126 Include PathV1.h in files that use it.
This is preparation for replacing Path.h with PathV2.h.

llvm-svn: 183782
2013-06-11 20:00:56 +00:00
Rafael Espindola c656225b9d Remove Path::getDirname.
llvm-svn: 183780
2013-06-11 19:32:57 +00:00
Rafael Espindola 4d725f66bd Remove Path::getBasename.
llvm-svn: 183779
2013-06-11 19:29:48 +00:00
Rafael Espindola 7fc279aecb Remove Path::getLast.
llvm-svn: 183778
2013-06-11 19:25:17 +00:00
Rafael Espindola 0126549185 Remove GetDLLSuffix.
llvm-svn: 183777
2013-06-11 19:18:05 +00:00
Rafael Espindola 75f89f5225 Remove GetRootDirectory.
llvm-svn: 183775
2013-06-11 19:13:52 +00:00
Rafael Espindola 8b86c6c509 Remove GetUserHomeDirectory.
llvm-svn: 183773
2013-06-11 19:08:15 +00:00
Rafael Espindola d45b9f15f9 Don't define LTDL_SHLIBPATH_VAR.
llvm-svn: 183771
2013-06-11 19:04:13 +00:00
Rafael Espindola 8cc6dc26bb Remove GetSystemLibraryPaths.
llvm-svn: 183770
2013-06-11 18:58:47 +00:00
Rafael Espindola b58973f918 Don't define LLVM_LIBDIR, it is not used anymore.
llvm-svn: 183769
2013-06-11 18:52:11 +00:00
Akira Hatanaka 4be04b139b [mips] Use function TargetInstrInfo::getRegClass.
No functionality changes.

llvm-svn: 183767
2013-06-11 18:48:16 +00:00
Rafael Espindola b5f4a1b0ba Remove Path::GetBitcodeLibraryPaths.
llvm-svn: 183765
2013-06-11 18:45:35 +00:00
Rafael Espindola 0487a3210f Remove unused FindLibrary function.
llvm-svn: 183764
2013-06-11 18:41:07 +00:00
Rafael Espindola 3add14d77e Remove sys::identifyFileType.
llvm-svn: 183763
2013-06-11 18:18:02 +00:00
Michael Liao e7fdb1386a Fix documentation on the path to Bitcode reader/writer
llvm-svn: 183761
2013-06-11 18:09:21 +00:00
Rafael Espindola 46ed353313 Convert another use of sys::identifyFileType.
No functionality change.

llvm-svn: 183759
2013-06-11 18:05:26 +00:00
Rafael Espindola 8de8607c7d Convert another use of sys::identifyFileType.
No functionality change.

llvm-svn: 183758
2013-06-11 18:01:14 +00:00
Rafael Espindola a82555c0f8 Change how globalopt handles aliases in llvm.used.
Instead of a custom implementation of replaceAllUsesWith, we just call
replaceAllUsesWith and recreate llvm.used and llvm.compiler-used.

This change is particularity interesting because it makes llvm see
through what clang is doing with static used functions in extern "C"
contexts. With this change, running clang -O2 in

extern "C" {
  __attribute__((used)) static void foo() {}
}

produces

@llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @foo to
i8*)], section "llvm.metadata"
define internal void @foo() #0 {
entry:
  ret void
}

llvm-svn: 183756
2013-06-11 17:48:06 +00:00
Rafael Espindola 660a5a14f6 Convert another use of sys::identifyFileType.
No functionality change.

llvm-svn: 183754
2013-06-11 17:28:56 +00:00
Rafael Espindola 823de7cd4c Port r183666 to identify_magic.
It will be tested in the next commit which moves another user to identify_magic.

Original message:

Fix an out of bounds array access.

We were looking at Magic[5] without checking Length. Since this path would not
return unless Length >= 18 anyway, just move the >= 18 check up.

llvm-svn: 183753
2013-06-11 17:25:45 +00:00
Rafael Espindola 9b404295a9 Fix variable name.
llvm-svn: 183752
2013-06-11 17:22:12 +00:00
Rafael Espindola 447d2d12f0 Fix variable name style. Don't cast to and from int.
This enables the compiler to see the enum and produce warnings about a switch
not being fully covered. Fix one of these warnings.

llvm-svn: 183749
2013-06-11 15:29:10 +00:00
Rafael Espindola cd81b90913 Convert another use of sys::identifyFileType.
No functionality change.

llvm-svn: 183747
2013-06-11 15:19:04 +00:00
Rafael Espindola d2d22eef6e Convert another use of sys::identifyFileType.
No functionality change.

llvm-svn: 183746
2013-06-11 15:09:43 +00:00
Rafael Espindola 110801addc Convert a use of sys::identifyFileType to sys::fs::identify_magic.
No functionality change.

llvm-svn: 183745
2013-06-11 14:39:59 +00:00
Benjamin Kramer 193960c822 R600: Make helper functions static.
llvm-svn: 183744
2013-06-11 13:32:25 +00:00
Rafael Espindola 70a729dfd5 Require members of llvm.used to be named.
The effect of llvm.used is to introduce an invisible reference, so this seems
a reasonable restriction. It will be used to provide an easy ordering of
the entries in llvm.used.

llvm-svn: 183743
2013-06-11 13:18:13 +00:00
NAKAMURA Takumi 4d5ee8046f Rework r183728, suppress assert(0) for now. Its behavior depends on assertions on win32 hosts.
FIXME: Introduce yet another checker but assert(0).
llvm-svn: 183736
2013-06-11 10:01:42 +00:00
Mihai Popa c1d119ed6e It adds support for negative zero offsets for loads and stores.
Negative zero is returned by the primary expression parser as INT32_MIN, so all that the method needs to do is to accept this value.
Behavior already present for Thumb2.

llvm-svn: 183734
2013-06-11 09:48:35 +00:00
Mihai Popa 1c7be576c5 This patch adds support for FPINST/FPINST2 as operands to vmsr/vmrs. These are optional registers that may be supported some ARM implementations to aid with resolution of floating point exceptions. The manual pages for vmsr and vmrs do not detail their use. Encodings and other information can be found in ARM Architecture Reference Manual section F, chapter 6, paragraph 3.
llvm-svn: 183733
2013-06-11 09:39:51 +00:00
Amaury de la Vieuville 064546cbfe ARM: Enforce decoding rules for VLDn instructions
llvm-svn: 183731
2013-06-11 08:14:14 +00:00
Amaury de la Vieuville 53ff029d62 ARM: Fix STREX/LDREX reecoding
The decoded MCInst wasn't reencoded as the same instruction

llvm-svn: 183729
2013-06-11 08:03:20 +00:00
NAKAMURA Takumi 1ab3650ec0 Tweak a couple of tests on win32 hosts with +Asserts.
- Don't use assert(0), or tests may pass or fail according to assertions.
  - For now, The tests are marked as XFAIL for win32 hosts.

FIXME: Could we avoid XFAIL to specify triple in the RUN lines?
llvm-svn: 183728
2013-06-11 06:52:58 +00:00
NAKAMURA Takumi 76380ab4c0 ARMAsmBackend.cpp: Use Triple::isOSBinFormatCOFF() instead of isOSWindows().
FYI, isOSBinFormatCOFF() is as same as isOSWindows(), on trunk.

llvm-svn: 183727
2013-06-11 06:52:43 +00:00
NAKAMURA Takumi 8018a29d06 Whitespace.
llvm-svn: 183726
2013-06-11 06:52:36 +00:00
Sean Silva 864dd75093 Fix dubious type name similar to member name.
Should bring bots back to life.

llvm-svn: 183715
2013-06-11 00:13:52 +00:00
Sean Silva 536a10cc2d Fix spurious semicolons.
Apparently these macros have semicolons inside of them already.

llvm-svn: 183712
2013-06-10 23:48:38 +00:00
Sean Silva f99309cb08 [yaml2obj] Initial ELF support.
Currently, only emitting the ELF header is supported (no sections or
segments).

The ELFYAML code organization is broadly similar to the COFFYAML code.

llvm-svn: 183711
2013-06-10 23:44:15 +00:00
Tim Northover a2292d0b8f ARM: diagnose ARM/Thumb assembly switches on CPUs only supporting one.
Some ARM CPUs only support ARM mode (ancient v4 ones, for example) and some
only support Thumb mode (M-class ones currently). This makes sure such CPUs
default to the correct mode and makes the AsmParser diagnose an attempt to
switch modes incorrectly.

rdar://14024354

llvm-svn: 183710
2013-06-10 23:20:58 +00:00
Nick Lewycky 7ed1dbfff4 Fix xemacs mode line, don't put them in .cpp files (just header files). No
functionality change.

llvm-svn: 183709
2013-06-10 23:10:59 +00:00
Eric Christopher a2f806fd20 Remove a few fixmes, the only work we're doing is getting the string
to return and this is done all over.

llvm-svn: 183704
2013-06-10 22:24:10 +00:00
Eric Christopher 2280c5baa6 Fix up comment.
llvm-svn: 183703
2013-06-10 22:24:07 +00:00
Eric Christopher 8c47bb1a02 Remove unused function.
llvm-svn: 183698
2013-06-10 21:59:28 +00:00
Eric Christopher b7e3b42c01 IndentCount is only used within NDEBUG code.
llvm-svn: 183695
2013-06-10 20:58:53 +00:00
Tim Northover 6833e3fd75 X86: Stop LEA64_32r doing unspeakable things to its arguments.
Previously LEA64_32r went through virtually the entire backend thinking it was
using 32-bit registers until its blissful illusions were cruelly snatched away
by MCInstLower and 64-bit equivalents were substituted at the last minute.

This patch makes it behave normally, and take 64-bit registers as sources all
the way through. Previous uses (for 32-bit arithmetic) are accommodated via
SUBREG_TO_REG instructions which make the types and classes agree properly.

llvm-svn: 183693
2013-06-10 20:43:49 +00:00
Rafael Espindola 134cc996ae Add a missing 'e'.
llvm-svn: 183692
2013-06-10 20:32:27 +00:00
Benjamin Kramer b22643a47d tblgen: Assert that InstRWs doesn't grows when we don't expect it.
llvm-svn: 183690
2013-06-10 20:19:35 +00:00