Commit Graph

1026 Commits

Author SHA1 Message Date
Chris Lattner
8f4b1ec02b the MinPad argument to PadToColumn only really makes sense to be 1,
just remove the argument and replace it with 1.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79246 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-17 15:48:08 +00:00
Erick Tryzelaar
a15d890c34 Modify APFloat to take a StringRef instead of a c string.
This also adds unit tests to APFloat that mainly tests the
string handling of APFloat, but not much else of it's api.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79210 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-16 23:36:19 +00:00
Dan Gohman
b4741a7225 Mingw also doesn't have st_blksize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79142 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 21:41:03 +00:00
Dan Gohman
d7be663d4f Always check to see if raw_fd_ostream's file descriptor is attached to
a terminal, not just when it's STDOUT_FILENO.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79066 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 02:05:19 +00:00
Dan Gohman
fbcb5b678f Add support for column computation on unbuffered streams.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79065 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 02:02:59 +00:00
Dan Gohman
a4a68c1b43 Move FormattedStream's write_impl out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79064 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 02:01:04 +00:00
Dan Gohman
1486ef96ed Remove an unnecessary #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79063 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15 01:56:38 +00:00
Chris Lattner
56ce0f415c fix "pc" to be lower case in a target triple, patch by Yonggang Luo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79016 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-14 18:48:13 +00:00
Dan Gohman
ec9b26100e When standard output is a terminal, set outs() to be unbuffered, to
mimic the behavior of stdtout, which is line-buffered when the output
is a terminal. This fixes some issues with bugpoint output appearing
being printed out of order.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78953 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 23:18:56 +00:00
Dan Gohman
c6126e8f7e Fix a compiler warning about comparing signed with unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78933 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 20:32:03 +00:00
Dan Gohman
4e8e642eaa Add an assert to check copy_to_buffer's precondition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78926 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 18:38:15 +00:00
Dan Gohman
0ba50bb056 Set raw_os_ostream, raw_string_ostream, and raw_svector_ostream to be
unbuffered. std::ostream does its own buffering, and std::string and
SmallVector both have allocation strategies intended to handle frequent
appending.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78924 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 17:41:40 +00:00
Dan Gohman
208ec0f32e Add support to raw_ostream for sizing the buffer according to the
needs of the underlying output mechanism. raw_fd_ostream now uses
st_blksize from fstat to determine a buffer size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78923 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 17:27:29 +00:00
Dan Gohman
524dea4d4c Move SetBufferSize and SetUnbuffered out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78909 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 15:58:55 +00:00
Dan Gohman
33e49ef5e5 Fix the buffer handling logic so that write_impl is always called with
a full buffer, rather than often being called with a
slightly-less-than-full buffer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78907 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 15:44:52 +00:00
Daniel Dunbar
689ad6ef3f Convert APint::{fromString,APInt,getBitsNeeded} to use StringRef.
- Patch by Erick Tryzelaar, with some edits (and a bug fix) from me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 02:33:34 +00:00
Dan Gohman
a9ad04191c This void is implicit in C++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78848 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 22:10:57 +00:00
Dale Johannesen
4e97a0f0cb Add attempted idiotproofing comment per review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78825 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 18:04:11 +00:00
Dale Johannesen
39c177d8b7 Fix a nondeterministic bug in APInt::roundToDouble;
when !isSingleWord() but getActiveBits() is small,
we were using the pointer value instead of the low
word of the integer value.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78821 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 17:42:34 +00:00
Chris Lattner
b796c4fde4 the x86 version of the name is x86-64, not x86_64. Handle this properly
in getArchTypeForLLVMName.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78799 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 06:45:02 +00:00
Chris Lattner
8e6208304b add support for mingw64 target triples.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78797 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 06:32:10 +00:00
Chris Lattner
dfc17f75e8 add a couple of helpers to the Triple class for decoding
the darwin version string.  This should help consolidate
the variety of weird functions we have scattered around the
codebase that do stuff like this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78792 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 06:19:40 +00:00
Chris Lattner
1d96ccc69a add a trivial line # cache to SourceMgr to make repeated queries to
FindLineNumber much faster when in sequence.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78693 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-11 17:49:14 +00:00
Daniel Dunbar
ca15f3d6d6 Add support for a user supplied pointer argument to llvm_install_error_handler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78553 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-10 03:36:26 +00:00
Dan Gohman
197f728d49 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78240 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 20:21:17 +00:00
Dan Gohman
c2a9eeb273 cerr isn't buffered so it doesn't need to be flushed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78135 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 00:44:01 +00:00
Daniel Dunbar
4bd03abe59 Remove now unused arguments from TargetRegistry::lookupTarget.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77950 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 04:20:57 +00:00
Daniel Dunbar
3c2d4bf97f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77946 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 04:03:51 +00:00
Jakob Stoklund Olesen
d950941e13 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77897 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 17:32:10 +00:00
Benjamin Kramer
e6864c1d35 Remove duplicated colons and spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77892 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 12:13:02 +00:00
Daniel Dunbar
2b800dfa6b Add missing flush().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77859 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-02 04:12:28 +00:00
Ted Kremenek
f83146fd11 Update CMake files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77709 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:50:22 +00:00
Dan Gohman
5e5337a833 Remove Annotation.h, which is no longer used in the LLVM tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77706 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 18:36:25 +00:00
Daniel Dunbar
2d8bc0fe70 Twine: Directly support int, long, and long long types.
- This should resolve Cygwin gcc ambiguities.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77624 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 21:15:14 +00:00
Daniel Dunbar
0fffbafa96 Twine: Use raw_ostream::write_hex, remove unused itohexstr method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77617 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 18:30:19 +00:00
Daniel Dunbar
48018e08f0 Add raw_ostream::write_hex
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77614 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 18:21:23 +00:00
Daniel Dunbar
0165a2ca89 Twine: Provide [u]int{32,64} conversions via implicit constructors instead of
explicitly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77576 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30 03:47:15 +00:00
Daniel Dunbar
89ae98cb76 Perform simplification noticed by Reid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77477 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 17:29:36 +00:00
David Greene
eb85728970 Re-apply previous changes and improve column padding performance some more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77461 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 16:08:27 +00:00
Daniel Dunbar
763457e70b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77445 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 07:08:44 +00:00
Daniel Dunbar
78a3dd8fe1 raw_ostream: Follow the 32-bit path when printing "small" decimal numbers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77444 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 06:45:14 +00:00
Daniel Dunbar
95db93caa1 Revert r77397, it causes significant regressions in llc performance.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77425 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 03:04:22 +00:00
David Greene
7aaad71722 Improve performance of PadToColumn by eliminating flushes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77397 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 23:26:34 +00:00
Dan Gohman
f78c835faa 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77255 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 21:46:02 +00:00
Dan Gohman
9a31254d0e Add an assertion check to raw_ostream's destructor to verify
that the subclass hasn't left any pending data in the buffer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77245 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 20:49:44 +00:00
Daniel Dunbar
77454a2105 Sort list of targets in --version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77127 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 05:09:50 +00:00
Daniel Dunbar
8c2f1d7e44 Oops, forgot XCore. Sorry XCore!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77125 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 04:52:45 +00:00
Daniel Dunbar
6337f15b5a Update for API change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77124 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 04:23:03 +00:00
Daniel Dunbar
a14d225ef4 Update Triple to use StringRef/Twine based APIs.
- This is now shorter, simpler, safer, and more efficient, what a deal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77119 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 03:31:47 +00:00
Daniel Dunbar
ad6c1539cd Remove unused header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77115 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 02:23:52 +00:00