1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00
Commit Graph

979 Commits

Author SHA1 Message Date
Dan Gohman
ba72f59923 Fix FindExecutable to use sys::Path::GetMainExecutable instead of
just argv[0]. And remove the code for searching the current
working directory and for searching PATH; the point of FindExecutable
is not to find whatever version of the executable can be found by
searching around, but to find an executable that accompanies the
current executable.

Update the tools to use sys::Program::FindProgramByName when they
want PATH searching.

llvm-svn: 78240
2009-08-05 20:21:17 +00:00
Dan Gohman
f146ba8b3d cerr isn't buffered so it doesn't need to be flushed.
llvm-svn: 78135
2009-08-05 00:44:01 +00:00
Daniel Dunbar
2781e4bd89 Remove now unused arguments from TargetRegistry::lookupTarget.
llvm-svn: 77950
2009-08-03 04:20:57 +00:00
Daniel Dunbar
775da1948b Pass target triple string in to TargetMachine constructor.
This is not just a matter of passing in the target triple from the module;
currently backends are making decisions based on the build and host
architecture. The goal is to migrate to making these decisions based off of the
triple (in conjunction with the feature string). Thus most clients pass in the
target triple, or the host triple if that is empty.

This has one important change in the way behavior of the JIT and llc.

For the JIT, it was previously selecting the Target based on the host
(naturally), but it was setting the target machine features based on the triple
from the module. Now it is setting the target machine features based on the
triple of the host.

For LLC, -march was previously only used to select the target, the target
machine features were initialized from the module's triple (which may have been
empty). Now the target triple is taken from the module, or the host's triple is
used if that is empty. Then the triple is adjusted to match -march.

The take away is that -march for llc is now used in conjunction with the host
triple to initialize the subtarget. If users want more deterministic behavior
from llc, they should use -mtriple, or set the triple in the input module.

llvm-svn: 77946
2009-08-03 04:03:51 +00:00
Jakob Stoklund Olesen
e7eb74ef39 Analog Devices Blackfin back-end.
Generate code for the Blackfin family of DSPs from Analog Devices:

  http://www.analog.com/en/embedded-processing-dsp/blackfin/processors/index.html
  
We aim to be compatible with the exsisting GNU toolchain found at:

  http://blackfin.uclinux.org/gf/project/toolchain
  
The back-end is experimental.

llvm-svn: 77897
2009-08-02 17:32:10 +00:00
Benjamin Kramer
c2015778ee Remove duplicated colons and spaces.
llvm-svn: 77892
2009-08-02 12:13:02 +00:00
Daniel Dunbar
0dfedac203 Add missing flush().
llvm-svn: 77859
2009-08-02 04:12:28 +00:00
Ted Kremenek
3b2c07bc88 Update CMake files.
llvm-svn: 77709
2009-07-31 18:50:22 +00:00
Dan Gohman
c4f0d838a9 Remove Annotation.h, which is no longer used in the LLVM tree.
llvm-svn: 77706
2009-07-31 18:36:25 +00:00
Daniel Dunbar
298e11de31 Twine: Directly support int, long, and long long types.
- This should resolve Cygwin gcc ambiguities.

llvm-svn: 77624
2009-07-30 21:15:14 +00:00
Daniel Dunbar
edd0313a36 Twine: Use raw_ostream::write_hex, remove unused itohexstr method.
llvm-svn: 77617
2009-07-30 18:30:19 +00:00
Daniel Dunbar
79e9ed1d26 Add raw_ostream::write_hex
llvm-svn: 77614
2009-07-30 18:21:23 +00:00
Daniel Dunbar
4d8b1776b4 Twine: Provide [u]int{32,64} conversions via implicit constructors instead of
explicitly.

llvm-svn: 77576
2009-07-30 03:47:15 +00:00
Daniel Dunbar
d2bf575100 Perform simplification noticed by Reid.
llvm-svn: 77477
2009-07-29 17:29:36 +00:00
David Greene
04545750d9 Re-apply previous changes and improve column padding performance some more.
llvm-svn: 77461
2009-07-29 16:08:27 +00:00
Daniel Dunbar
d13fcdaae5 Twines: Support numeric conversion directly (uitostr, etc).
- Provides static constructors for doing number to string conversions without
   using temporaries.

 - There are several ways to do this, I think given the Twine constraints this
   is the simplest one.

 - One FIXME for fast number -> hex conversion.

 - Added another comment on one last major bit of perf work Twines need, which
   is to make raw_svector_ostream more efficient.

llvm-svn: 77445
2009-07-29 07:08:44 +00:00
Daniel Dunbar
1589195975 raw_ostream: Follow the 32-bit path when printing "small" decimal numbers.
llvm-svn: 77444
2009-07-29 06:45:14 +00:00
Daniel Dunbar
02fa03ef37 Revert r77397, it causes significant regressions in llc performance.
llvm-svn: 77425
2009-07-29 03:04:22 +00:00
David Greene
6c6f368805 Improve performance of PadToColumn by eliminating flushes.
llvm-svn: 77397
2009-07-28 23:26:34 +00:00
Dan Gohman
40bd748448 Make raw_null_ostream flush its buffer in its destructor, so that
it conforms to the assertion added in r77245. This fixes a failure
in qa_override.c in clang's testsuite.

llvm-svn: 77255
2009-07-27 21:46:02 +00:00
Dan Gohman
982c2fe893 Add an assertion check to raw_ostream's destructor to verify
that the subclass hasn't left any pending data in the buffer.

llvm-svn: 77245
2009-07-27 20:49:44 +00:00
Daniel Dunbar
fe859a94dc Sort list of targets in --version.
llvm-svn: 77127
2009-07-26 05:09:50 +00:00
Daniel Dunbar
1c59fa86e2 Oops, forgot XCore. Sorry XCore!
llvm-svn: 77125
2009-07-26 04:52:45 +00:00
Daniel Dunbar
6b705e3a64 Update for API change.
llvm-svn: 77124
2009-07-26 04:23:03 +00:00
Daniel Dunbar
5a9d56ab90 Update Triple to use StringRef/Twine based APIs.
- This is now shorter, simpler, safer, and more efficient, what a deal.

llvm-svn: 77119
2009-07-26 03:31:47 +00:00
Daniel Dunbar
7917e05213 Remove unused header
llvm-svn: 77115
2009-07-26 02:23:52 +00:00
Daniel Dunbar
49987490c2 Kill Target specific ModuleMatchQuality stuff.
- This was overkill and inconsistently implemented.

llvm-svn: 77114
2009-07-26 02:22:58 +00:00
Daniel Dunbar
62e74f03c7 Add TargetRegistry::lookupTarget.
- This is a simplified mechanism which just looks up a target based on the
   target triple, with a few additional flags.

 - Remove getClosestStaticTargetForModule, the moral equivalent is now:
     lookupTarget(Mod->getTargetTriple, true, false, ...);

 - This no longer does the fuzzy matching with target data (based on endianness
   and pointer width) that getClosestStaticTargetForModule was doing, but this
   was deemed unnecessary.

llvm-svn: 77111
2009-07-26 02:12:58 +00:00
Reid Kleckner
b159a2bad6 Added a test and fixed a bug in BumpPtrAllocator relating to large alignment
values.  Hopefully this fixes PR4622.

llvm-svn: 77088
2009-07-25 21:26:02 +00:00
Daniel Dunbar
d699ffc2ac Simplify JIT target selection.
- Instead of requiring targets to define a JIT quality match function, we just
   have them specify if they support a JIT.

 - Target selection for the JIT just gets the host triple and looks for the best
   target which matches the triple and has a JIT.

llvm-svn: 77060
2009-07-25 10:09:50 +00:00
Daniel Dunbar
076387bcc0 Allow llvm_report_error to accept a Twine.
llvm-svn: 76961
2009-07-24 07:58:10 +00:00
Daniel Dunbar
bc0b1a1506 Update CMake
llvm-svn: 76957
2009-07-24 07:04:49 +00:00
Daniel Dunbar
6f78d7ac27 Add Twine ADT.
- Not currently used.

llvm-svn: 76956
2009-07-24 07:04:27 +00:00
Daniel Dunbar
5895c5adf3 Switch to raw_ostream.
llvm-svn: 76943
2009-07-24 04:01:01 +00:00
David Greene
d40b2dbb34 Write space padding as one string to speed up comment printing.
llvm-svn: 76910
2009-07-23 23:21:10 +00:00
Reid Kleckner
5a7816053e Re-committing changes from r76825 to BumpPtrAllocator with a fix and tests for
an off-by-one error.

llvm-svn: 76891
2009-07-23 18:34:13 +00:00
Daniel Dunbar
b5adc13728 Convert StringMap to using StringRef for its APIs.
- Yay for '-'s and simplifications!

 - I kept StringMap::GetOrCreateValue for compatibility purposes, this can
   eventually go away. Likewise the StringMapEntry Create functions still follow
   the old style.

 - NIFC.

llvm-svn: 76888
2009-07-23 18:17:34 +00:00
Reid Kleckner
6f9bf7f028 Reverting r76825 and r76828, since they caused clang runtime errors and some build failure involving memset.
llvm-svn: 76838
2009-07-23 01:40:54 +00:00
Zhongxing Xu
cd7c9007d1 add header for 'memset'.
llvm-svn: 76837
2009-07-23 01:38:47 +00:00
Reid Kleckner
4c892c05ec Parameterize the BumpPtrAllocator over a slab allocator. It defaults to using
malloc, so there should be no functional changes to other code.

These changes are necessary since I have plans to use this allocator in the JIT
memory manager, and it needs a special allocator.

I also added some tests which helped me pinpoint some bugs.

llvm-svn: 76825
2009-07-23 00:30:41 +00:00
David Greene
5144b046cc Hide the DOUT static variable behind a function interface.
llvm-svn: 76425
2009-07-20 16:16:06 +00:00
Nick Lewycky
3b459607de Fix ConstantRange::unionWith. Also make it work a little hard in some cases to
return the smallest union of two ranges instead of just any range that happens
to contain the union.

llvm-svn: 76360
2009-07-19 03:44:35 +00:00
Nick Lewycky
ec10fcbd04 Replace intersectWith with maximalIntersectWith. The latter guarantees that
all values belonging to the intersection will belong to the resulting range.
The former was inconsistent about that point (either way is fine, just pick
one.) This is part of PR4545.

llvm-svn: 76289
2009-07-18 06:34:42 +00:00
Daniel Dunbar
dc9438e8d9 Provide slightly more refined error message when trying to lookup a target, and
none are registered.

llvm-svn: 76181
2009-07-17 15:50:49 +00:00
Daniel Dunbar
276e4a7a7d Add raw_null_ostream and llvm::nulls(), a raw_ostream that discards output.
- No functionality change.

llvm-svn: 76103
2009-07-16 21:17:53 +00:00
Dan Gohman
0bcfcaa96c Use size_t.
llvm-svn: 76069
2009-07-16 15:24:40 +00:00
Chris Lattner
a9fcfe3d18 add a knob to turn off PrettyStackTrace globally. Patch by Zoltan
Varga!

llvm-svn: 75897
2009-07-16 06:17:45 +00:00
Daniel Dunbar
ffc135d4d5 Add registered target list to --version output.
llvm-svn: 75889
2009-07-16 02:06:09 +00:00
Dan Gohman
f01e53a482 Change raw_ostream so that it doesn't call llvm_report_error
immediately on every output error. Instead, add a flag to
raw_ostream, and set the flag whenever an error is detected.

The flag can be queried and cleared from the public API. This
gives applications more flexibility to handling errors in
application-specific ways.

If the flag is not cleared when the raw_ostream is destructed,
llvm_report_error is called from the destructor. This ensures
that errors are not implicitly silenced, and provides
convenient default behavior for tools like llc and opt.
Clients wishing to avoid llvm_report_error calls from
raw_ostream should check for errors and clear the error flag.

llvm-svn: 75857
2009-07-15 23:25:33 +00:00
Daniel Dunbar
5707dd7f73 Reapply TargetRegistry refactoring commits.
--- Reverse-merging r75799 into '.':
 U   test/Analysis/PointerTracking
U    include/llvm/Target/TargetMachineRegistry.h
U    include/llvm/Target/TargetMachine.h
U    include/llvm/Target/TargetRegistry.h
U    include/llvm/Target/TargetSelect.h
U    tools/lto/LTOCodeGenerator.cpp
U    tools/lto/LTOModule.cpp
U    tools/llc/llc.cpp
U    lib/Target/PowerPC/PPCTargetMachine.h
U    lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
U    lib/Target/PowerPC/PPCTargetMachine.cpp
U    lib/Target/PowerPC/PPC.h
U    lib/Target/ARM/ARMTargetMachine.cpp
U    lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
U    lib/Target/ARM/ARMTargetMachine.h
U    lib/Target/ARM/ARM.h
U    lib/Target/XCore/XCoreTargetMachine.cpp
U    lib/Target/XCore/XCoreTargetMachine.h
U    lib/Target/PIC16/PIC16TargetMachine.cpp
U    lib/Target/PIC16/PIC16TargetMachine.h
U    lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
U    lib/Target/Alpha/AlphaTargetMachine.cpp
U    lib/Target/Alpha/AlphaTargetMachine.h
U    lib/Target/X86/X86TargetMachine.h
U    lib/Target/X86/X86.h
U    lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
U    lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
U    lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h
U    lib/Target/X86/X86TargetMachine.cpp
U    lib/Target/MSP430/MSP430TargetMachine.cpp
U    lib/Target/MSP430/MSP430TargetMachine.h
U    lib/Target/CppBackend/CPPTargetMachine.h
U    lib/Target/CppBackend/CPPBackend.cpp
U    lib/Target/CBackend/CTargetMachine.h
U    lib/Target/CBackend/CBackend.cpp
U    lib/Target/TargetMachine.cpp
U    lib/Target/IA64/IA64TargetMachine.cpp
U    lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp
U    lib/Target/IA64/IA64TargetMachine.h
U    lib/Target/IA64/IA64.h
U    lib/Target/MSIL/MSILWriter.cpp
U    lib/Target/CellSPU/SPUTargetMachine.h
U    lib/Target/CellSPU/SPU.h
U    lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
U    lib/Target/CellSPU/SPUTargetMachine.cpp
U    lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
U    lib/Target/Mips/MipsTargetMachine.cpp
U    lib/Target/Mips/MipsTargetMachine.h
U    lib/Target/Mips/Mips.h
U    lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
U    lib/Target/Sparc/SparcTargetMachine.cpp
U    lib/Target/Sparc/SparcTargetMachine.h
U    lib/ExecutionEngine/JIT/TargetSelect.cpp
U    lib/Support/TargetRegistry.cpp

llvm-svn: 75820
2009-07-15 20:24:03 +00:00