Commit Graph

1886 Commits

Author SHA1 Message Date
Benjamin Kramer
8c74f7f299 Add the DataExtractor utility class.
It is an endian-aware helper that can read data from a StringRef. It will
come in handy for DWARF parsing. This class is inspired by LLDB's
DataExtractor, but is stripped down to the bare minimum needed for DWARF.

Comes with unit tests!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139626 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13 19:42:16 +00:00
Devang Patel
5443140021 Add DW_ATE_UTF, which clang started using in my previous commit!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139503 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-12 17:18:20 +00:00
Tobias Grosser
05d7138018 Add AMDIL as valid target triple to LLVM.
Submitted by: Villmow, Micah <Micah.Villmow@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138734 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-29 15:44:55 +00:00
Nick Lewycky
b1b051ec97 Fix integer overflow bug in raw_ostream::write. This showed up as a
non-deterministic crash in the test suite. Fixes PR10055!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138717 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-28 03:30:02 +00:00
Benjamin Kramer
f66f76c1a3 Report failure if there are less bytes than requested in a MemoryObject.
Before we just left the remaining bytes uninitialized. This is another step in making llvm valgrind-clean again.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138705 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-27 07:45:46 +00:00
Benjamin Kramer
cf847bfa6f Intel family 6 model 44 is Gulftown/Westmere-EP and doesn't have AVX.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138573 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-25 18:05:56 +00:00
Evan Cheng
3e74d6fdd2 Move TargetRegistry and TargetSelect from Target to Support where they belong.
These are strictly utilities for registering targets and components.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138450 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24 18:08:43 +00:00
Ivan Krasin
38fb2db6c9 This patch adds support of le32 pseudo-cpu that stands for generic
32-bit little-endian CPU. Used by PNaCl and Emscripten.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138335 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23 16:59:00 +00:00
NAKAMURA Takumi
07097ddbc0 lib/Support/Windows/Windows.h: Update required IE ver. 0x0600 should be enough for Windows XP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138319 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23 03:49:11 +00:00
Ivan Krasin
d883453213 Add NativeClient support to Triple::ParseOS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138291 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-22 23:08:53 +00:00
Jordy Rose
eeb37f1a56 Make DynamicLibrary thread-safe w/r/t call to dlerror() after dlopen(). PR10718
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138260 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-22 19:01:52 +00:00
Benjamin Kramer
2e608c6b61 PathV2: Handle more reserved filenames on windows.
Patch by Aaron Ballman!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138213 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-20 21:36:38 +00:00
NAKAMURA Takumi
77c108241a lib/Support/CrashRecoveryContext.cpp: Add Win32 support to CrashRecoveryContext. Thanks to Aaron Ballman!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138199 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-20 06:35:36 +00:00
NAKAMURA Takumi
aa629668db lib/Support/Windows/Windows.h: Require at least Windows XP(5.1) API. We will not support Windows 2000 any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138198 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-20 06:35:31 +00:00
Ivan Krasin
fb23462889 Add NativeClient operating system support.
This patch adds support of NativeClient (*-*-nacl) OS support to LLVM.
It's already supported in autoconf/config.sub.

The motivation for this change is to start upstreaming PNaCl work. The
whole set of patches include llvm backends (i686, x86_64, ARM),
llvm-gcc (probably, would not be upstreamed because it's deprecated)
and clang (the work has been just started, the amount of changes is
going to be low and the most of the work is expected to be done close
to the mainline).




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138005 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-18 22:54:21 +00:00
Jordy Rose
008a5f515a Static fields require an out-of-line definition. Fix DynamicLibrary for real.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137844 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 18:38:42 +00:00
Jordy Rose
f0813ceeaf Unbork Windows build. Thanks, Francois.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137798 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 00:59:50 +00:00
Jordy Rose
0bce85fbfa Use DynamicLibrary instances as a way to get symbols from a specific library. Preparation for upcoming (preliminary) support for plugins for the static analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137791 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 00:29:32 +00:00
Duncan Sands
1f6a329f79 Silence a bunch (but not all) "variable written but not read" warnings
when building with assertions disabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137460 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 14:54:45 +00:00
Bob Wilson
21ab6c066d Clarify a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137204 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-10 05:02:22 +00:00
Bob Wilson
0dc8b42987 Put Darwin-specific code inside an __APPLE__ ifdef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137137 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-09 19:54:32 +00:00
Bob Wilson
f5b757642d Recognize the UNAME_RELEASE environment variable to match Darwin's uname.
When this variable is set, "uname -r" will return its value instead of the
real OS version.  Make this affect LLVM's triple for consistency.
<rdar://problem/9919167>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137111 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-09 05:13:36 +00:00
Sean Callanan
efd7919618 Added several architecture names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136552 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-30 01:29:54 +00:00
Nick Lewycky
2b9c50776a Don't look at $PWD in GetCurrentDirectory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136477 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-29 18:26:59 +00:00
Nick Lewycky
3c036e520e Teach Path::GetCurrentDirectory to use $PWD, to support users who like to do
screwy things by setting PWD != getcwd(). For example, some developers I know
will use this to control the value in gcc's DW_AT_comp_dir value in debug
output. With this patch, that trick will now work on clang too.

The only other effect of this change is that the static analysis will now
respect $PWD when reporting the directory of the files in its HTML output. I
think that's fine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136459 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-29 04:42:39 +00:00
Argyrios Kyrtzidis
814450a429 Add an optional 'bool makeAbsolute' in llvm::sys::fs::unique_file function.
If true and 'model' parameter is not an absolute path, a temp directory will be prepended.
Make it true by default to match current behaviour.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136310 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-28 00:29:20 +00:00
Jakub Staszak
ffcc2a542c Optimize 96-bit division a little bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136222 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-27 16:00:40 +00:00
Jakub Staszak
636a02b57c Move static methods to the anonymous namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136221 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-27 15:51:51 +00:00
Frits van Bommel
a09d514b29 Trim includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136218 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-27 15:20:06 +00:00
Duncan Sands
652b48bf23 Teach the Triple class about kfreebsd (FreeBSD kernel with
a GNU userspace).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136085 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-26 15:30:04 +00:00
Jakub Staszak
15b35677d0 BranchProbability::print returns void now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135994 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-25 22:27:42 +00:00
Jakub Staszak
a26ec886a3 Add BlockFrequency class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135992 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-25 22:24:51 +00:00
Chris Lattner
b7fbcc9696 switch Triple to take twines instead of stringrefs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135889 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-24 20:45:08 +00:00
Chris Lattner
3f25ee080c Add Twine support for characters, and switch twine to use a union internally
to eliminate some casting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135888 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-24 20:44:30 +00:00
Chandler Carruth
48ac8e9be7 Move TargetRegistry.cpp from lib/Support to lib/Target where it belongs.
The header file was already properly located. The previous need for it
in Support had to do with the version string printing which was fixed in
r135757.

Also update build dependencies where libraries that needed the
functionality of the Target library (in the form of the TargetRegistry)
were picking it up via Support. This is pretty pervasive, essentially
every TargetInfo library (ARMInfo, etc) uses TargetRegistry, making it
depend on Target. All of these were previously just sneaking by.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135760 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-22 08:16:53 +00:00
Chandler Carruth
4039313b4c Move the registered target printing in version strings completely out of
the Support library. Now its part of the TargetRegistry, and the three
commands that care about this explicitly register this extra bit of
version information.

The set of commands which care was computed by intersecting those which
use the Support library's version string printing and those that
initialize all the registered targets in a way that produces
a meaningful list. The only odd ball out is that 'clang -cc1as -version'
no longer prints the registered targets. I don't think anyone is really
interested in that (especially as the fact that llvm-mc does so is under
a FIXME), but if someone really does want this back I'll happily apply
the same patch there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135757 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-22 07:50:48 +00:00
Chandler Carruth
077c408717 Move the logic for printing the registered targets into a static
function on the TargetRegistry. Also clean it up and use the modern LLVM
utility libraries available instead of rolling a few things manually.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135756 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-22 07:50:44 +00:00
Chandler Carruth
6d51d26a24 Add an extension point to the CommandLine library where clients can
register extra version information to be printed. This is designed to
allow those tools which link in various targets to also print those
registered targets under --version.

Currently this printing logic is embedded into the Support library
directly; a huge layering violation. This is the first step to hoisting
it out into the tools without adding lots of duplicated code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135755 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-22 07:50:40 +00:00
NAKAMURA Takumi
12b2772578 lib/Support/Triple.cpp: Recognize "-march=ppc32" to llc properly, as quick hack.
FIXME: There is an inconsistency. llvm::Triple does not understand "ppc32" and PowerPC/TargetInfo holds "ppc32".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135745 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-22 04:02:22 +00:00
Chris Lattner
c30a38f34b move tier out of an anonymous namespace, it doesn't make sense
to for it to be an an anon namespace and be in a header.

Eliminate some extraenous uses of tie.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135669 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-21 06:21:31 +00:00
Jeffrey Yasskin
3ba292dbc2 Add APInt(numBits, ArrayRef<uint64_t> bigVal) constructor to prevent future ambiguity
errors like the one corrected by r135261.  Migrate all LLVM callers of the old
constructor to the new one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135431 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 21:45:40 +00:00
Benjamin Kramer
8d4dd79526 Simplify & microoptimize code. No intended functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135364 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-18 00:00:20 +00:00
Frits van Bommel
331dbca73d In Twine::str(), if the Twine stores only a std::string, just return a direct copy of that instead of first copying to a SmallString and converting that to a std::string. Also fix some indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135267 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-15 11:05:37 +00:00
Chandler Carruth
e083805724 Explicitly cast the second argument to unsigned in order to select the
desired overload.

This is a bit of a hackish workaround to fix the compile after r135259.
Let me know if there is a better approach.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135261 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-15 07:31:10 +00:00
Jeffrey Yasskin
3d42bfbbdd Add an APFloat::convertToInt(APSInt) function that automatically manages the
memory for the result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135259 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-15 07:04:56 +00:00
NAKAMURA Takumi
71c10666cc Windows/DynamicLibrary.inc: Fix trivial warnings. Thanks to John Myers!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134812 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 08:41:20 +00:00
Bob Wilson
7c3a5cac02 Update comments for SandyBridge CPU identifiers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134759 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 22:33:59 +00:00
Bob Wilson
26fc025e62 Recognize Intel CPUs with Family=6 and Model=44.
According to Intel Application Note 485, this value is used for
"Intel Core i7 and Intel Xeon processor".  Just include it with the other
"corei7-avx" entries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134750 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-08 22:09:35 +00:00
Joerg Sonnenberger
f86b76ead7 Recognize mipseb as alias for mips for symmetry with mipsel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134617 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 16:53:52 +00:00
Eli Friedman
b0e77a228f Fix missing triple support for RTEMS target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134532 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 20:56:26 +00:00
Chad Rosier
338398a288 By default mkstemp() creates a temporary file with mode 0600, but the mode
used for open is 0666.  Therefore, add the necessary permission bits for
consistency.
rdar://8621462

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134430 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-05 18:55:31 +00:00
Duncan Sands
ba519f8fc9 Revert previous commit. It seems that whether casting to void
is valid or not depends on which system you build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134321 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 13:14:22 +00:00
Duncan Sands
d01cb35804 Supress gcc-4.5 warning about the result not being used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134319 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 13:06:23 +00:00
Douglas Gregor
6ced1d12dd Add initial *-*-rtems* target, from Joel Sherrill
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134282 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-01 22:41:06 +00:00
Nick Lewycky
e6240e8b83 Fix the implementation of ConstantRange::sub(ConstantRange). Patch by Xi Wang!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133648 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 21:13:46 +00:00
Ted Kremenek
cf886188fb add option for literal formatting to APInt::toString()
toString() now takes an optional bool argument that,
depending on the radix, adds the appropriate prefix
to the integer's string representation that makes it into a
meaningful C literal, e.g.:

hexademical: '-f' becomes '-0xf'
octal: '77' becomes '077'
binary: '110' becomes '0b110'

Patch by nobled@dreamwidth.org!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133032 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-15 00:51:55 +00:00
Evan Cheng
ff276b40f0 Aliased flag options should be directed to stdout, not stderr to be consistent. Patch by Julien Lerouge.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132931 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-13 20:45:54 +00:00
Andrew Trick
f289df2d95 Branch profiling: floating-point avoidance.
Patch by: Jakub Staszak!

Introduces BranchProbability. Changes unsigned to uint32_t all over and
uint64_t only when overflow is expected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132867 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-11 01:05:22 +00:00
Chris Lattner
78a113cbff add another sandybridge alias.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132772 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-09 06:38:17 +00:00
Zhongxing Xu
422b62b407 singed int causes signed extension, which contradicts the intention to pick up
integers with high 32 bits being zero.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132538 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-03 08:29:51 +00:00
Joerg Sonnenberger
dd137903e4 Add new -d option to tblgen. It writes a make(1)-style dependency file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132395 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-01 13:10:15 +00:00
John McCall
fe754ab90a ...this is not a good commit day for me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132294 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-29 19:44:55 +00:00
John McCall
832a9d1a76 On Darwin ARM, set the UNWIND_RESUME libcall to _Unwind_SjLj_Resume.
This is important for the correct lowering of unwind instructions
(which doesn't matter at all) and llvm.eh.resume calls (which does).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132291 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-29 19:39:04 +00:00
Chris Lattner
c4cb237ca6 fix a bug for hosts without round, PR8893.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131842 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-22 06:03:53 +00:00
Chris Lattner
9bb4a2ae8a random comment cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131829 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-22 00:50:53 +00:00
Andrew Trick
dc5948d472 Have Program::Wait return -2 for crashed and timeouts instead of embedding
info in the error message. Per Dan's request.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131780 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-21 00:56:46 +00:00
Benjamin Kramer
eb274e6bdd Rename the "sandybridge" subtarget to "corei7-avx", for GCC compatibility.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131730 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-20 15:11:26 +00:00
Rafael Espindola
7205d431f1 Revert my previous patch. The cmake build had already been fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131606 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 00:02:45 +00:00
Rafael Espindola
e37234739e Fix the cmake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131602 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 23:56:40 +00:00
Eli Friedman
49fcf571da Shuffle StandardPasses.cpp into VMCore; add it to CMake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131600 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 23:51:11 +00:00
Eli Friedman
10a818809d Third pass at allowing plugins to modify default passes. This time with a tweak so that we don't depend on an uninitialized argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131581 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 21:40:04 +00:00
Eli Friedman
f9a74cf069 Revert r131556; it's breaking buildbots/clang tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131567 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 20:39:27 +00:00
David Chisnall
b2a00dca1b Second pass at allowing plugins to modify default passes. This time without bonus inter-library dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131556 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 19:00:41 +00:00
Rafael Espindola
ab078f0232 Don't include information about the build into the information returned by
getHostTriple. This fixes a 32 bit clang running on a 64 bit ubuntu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131463 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 15:26:34 +00:00
Devang Patel
201e6cdc39 Doug convinced me that DW_AT_APPLE_objc_complete_type is more appropriate name.
s/DW_AT_APPLE_objc_class_extension/DW_AT_APPLE_objc_complete_type/g


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131244 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-12 21:29:42 +00:00
Devang Patel
b11f80e94b Let Objective-C front-end identify class extension, in dwarf output, using an attribute DW_AT_APPLE_objc_class_extension.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131238 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-12 19:06:16 +00:00
Andrew Trick
1680832a9b Typo and missing checkin from r131186.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131187 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-11 16:44:08 +00:00
Andrew Trick
7c863eb8cc Bugpoint support for miscompilations that result in a crash.
This change allows bugpoint to pinpoint the "opt" pass and bitcode
segment responsible for a crash caused by miscompilation. At least it
works well for me now, without having to create any custom execution
wrappers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131186 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-11 16:31:24 +00:00
Nick Lewycky
95d206a9c7 In option typo correction, consider -foo=VALUE flags as two distinct parts. The
comments claimed it did this, but the LHS value was actually an unused variable.

The new system considers only the '-foo' part when comparing it for typos
against flags that have values, but still look at the whole string for flags
that don't. That way, we'll still correct '-inst=combine' to '-instcombine'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130685 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 05:24:47 +00:00
NAKAMURA Takumi
6073a05240 Windows/DynamicLibrary.inc: Clean up ELM_Callback. We may check the decl instead of the versions of individual libraries.
autoconf: Add checking ELM_Callback decl for mingw32 and mingw-w64.
cmake/config-ix.cmake: Add checking ELM_Callback decl for win32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130657 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-01 13:29:49 +00:00
Douglas Gregor
72d30f6950 Include <pthread.h> before we use pthread_self/pthread_kill
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130510 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 16:12:17 +00:00
Ted Kremenek
5d86759e0f Add MemoryBuffer::getBufferKind() to report whether a memory buffer uses malloc'ed or mmap'ed memory. This is for performance analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130432 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 20:34:18 +00:00
Lenny Maiorani
6cf081cbe5 Remove bounded StringRef::compare() since nothing but Clang SA was using it and it is just as easy to use StringRef::substr() preceding StringRef::compare() to achieve the same thing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130430 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 20:20:12 +00:00
Chris Lattner
e27c3ea2bc allow adding a FoldingSetNodeID to a FastFoldingSetNode, resolving PR9499,
patch by Johannes Schaub!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130151 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 20:58:50 +00:00
Jay Foad
a0f5092703 Like the coding standards say, do not use "using namespace std".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130054 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-23 09:06:00 +00:00
Eric Christopher
f0c3af637a Add support for 64-bit object files to Path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129975 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 03:50:19 +00:00
Devang Patel
06161fcdd6 Add DW_OP_bit_piece.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129945 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 22:26:13 +00:00
Daniel Dunbar
88c924c67e sys/Host: Change getHostTriple() to return the full Darwin version on OS X.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129852 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 15:44:33 +00:00
Justin Holewinski
e1fee48cd0 PTX: Add intrinsics to list of built-in intrinsics, which allows them to be
used by Clang.  To help Clang integration, the PTX target has been split
     into two targets: ptx32 and ptx64, depending on the desired pointer size.

- Add GCCBuiltin class to all intrinsics
- Split PTX target into ptx32 and ptx64

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129851 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 15:37:17 +00:00
Daniel Dunbar
398a5ca9cd ADT/Triple: Drop support for -osx style triples, we are going with -macosx
instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129836 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 23:55:20 +00:00
Daniel Dunbar
1af394766f ADT/Triple: Add support for Triple::MacOSX per feedback from Chris, will remove
Triple::OSX once Clang has moved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129833 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 23:34:12 +00:00
Daniel Dunbar
e1fe09f682 ADT/Triple: Add isOSDarwin() and isOSWindows() helper functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129815 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 21:12:05 +00:00
Daniel Dunbar
e8ba52d639 ADT/Triple: Fix Triple::getArchNameForAssembler to support OSX and iOS
enumeration values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129814 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 21:07:03 +00:00
Daniel Dunbar
087d6a59ad ADT/Triple: Generalize and simplify getDarwinNumber to just be getOSVersion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129799 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 20:24:34 +00:00
Daniel Dunbar
0dde4c00ee ADT/Triple: Add support for more explicit "osx" and "ios" OS names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129798 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 20:19:27 +00:00
Ted Kremenek
1da29dd3f8 Add BumpPtrAllocator::getTotalMemory() to allow clients to query how much memory a BumpPtrAllocator allocated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129727 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-18 22:44:46 +00:00
Devang Patel
e9db5e29e3 Introduce support to encode Objective-C property information in debugging information generated for an interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129624 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-16 00:11:51 +00:00
Lenny Maiorani
437ef0cfb7 Implements StringRef::compare with bounds. It is behaves similarly to strncmp(). Unit tests also included.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129582 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-15 17:56:50 +00:00
Chris Lattner
7a2bdde0a0 Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-15 05:18:47 +00:00
Chris Lattner
6ff80b2281 regexes are allowed to match empty things, e.g. {{.*}} in filecheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129193 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 06:29:24 +00:00
Frits van Bommel
090771fa26 Fix a few instances of "warning: extra ';' outside of a function [-pedantic]".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129002 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-06 12:29:56 +00:00
Roman Divacky
2a121b92bb Add support for detection of Intel SandyBridge.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128920 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-05 20:25:36 +00:00
Andrew Trick
ce96902d88 Added *hidden* flags -print-options and -print-all-options so
developers can see if their driver changed any cl::Option's. The
current implementation isn't perfect but handles most kinds of
options. This is nice to have when decomposing the stages of
compilation and moving between different drivers. It's also a good
sanity check when comparing results produced by different command line
invocations that are expected to produce the comparable results.

Note: This is not an attempt to prolong the life of cl::Option. On the
contrary, it's a placeholder for a feature that must exist when
cl::Option is replaced by a more appropriate framework. A new
framework needs: a central option registry, dynamic name lookup,
non-global containers of option values (e.g. per-module,
per-function), *and* the ability to print options values and their defaults at
any point during compilation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128910 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-05 18:54:36 +00:00
Eric Christopher
539d8d8a72 Assorted bugfixes in object file handling:
- Adds support for sniffing PE/COFF files on win32 (.exe and .dll)
   which are COFF files that have an MS-DOS compatibility stub on
   the front of them.

 - Fixes a bug in the COFFObjectFile's support for the Microsoft COFF
   extension for long symbol names, wherein it was attempting to parse
   the leading '/' in an extended symbol name reference as part of the
   integer offset.

 - Fixes bugs in COFFObjectFile and ELFObjectFile wherein section
   and symbol iterators were being returned with uninitialized bytes;
   the type DataRefImpl is a union between 2 32-bit words (d.a and d.b)
   and a single intptr_t word (p). Only p was being initialized, so in
   32-bit builds the result would be iterators with random upper 32-bit
   words in their DataRefImpls. This caused random failures when
   seeking around in object files.

Patch by Graydon Hoare!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128799 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-03 22:53:19 +00:00
Jakob Stoklund Olesen
03ef449917 Reset StringMap's NumTombstones on clears and rehashes.
StringMap was not properly updating NumTombstones after a clear or rehash.

This was not fatal until now because the table was growing faster than
NumTombstones could, but with the previous change of preventing infinite
growth of the table the invariant (NumItems + NumTombstones <= NumBuckets)
stopped being observed, causing infinite loops in certain situations.

Patch by José Fonseca!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128567 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 18:32:51 +00:00
Jakob Stoklund Olesen
e10fff6f88 Prevent infinite growth of SmallPtrSet instances.
Rehash but don't grow when full of tombstones.

Patch by José Fonseca!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128566 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 18:32:48 +00:00
Jakob Stoklund Olesen
aea4fe2862 Prevent infinite growth of SmallMap instances.
Rehash but don't grow when full of tombstones.

Patch by José Fonseca!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128565 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 18:32:44 +00:00
Benjamin Kramer
8398512f89 Avoid turning a floating point division with a constant power of two into a denormal multiplication.
Some platforms may treat denormals as zero, on other platforms multiplication
with a subnormal is slower than dividing by a normal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128555 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 17:02:54 +00:00
Benjamin Kramer
2746000f4f Add APFloat::getExactInverse.
The idea is, that if an ieee 754 float is divided by a power of two, we can
turn the division into a cheaper multiplication. This function sees if we can
get an exact multiplicative inverse for a divisor and returns it if possible.

This is the hard part of PR9587.

I tested many inputs against llvm-gcc's frotend implementation of this
optimization and didn't find any difference. However, floating point is the
land of weird edge cases, so any review would be appreciated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128545 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 15:42:27 +00:00
Frits van Bommel
6208610fd6 Constant folding support for calls to umul.with.overflow(), basically identical to the smul.with.overflow() code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128379 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-27 14:26:13 +00:00
Andrew Trick
0a828fd7ef revert r128199 until it can be made to work with Frontend/dependency-gen.c.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128218 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-24 16:43:37 +00:00
Michael J. Spencer
e1db1b8d4e Remove all uses of PATH_MAX and MAXPATHLEN from PathV2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128199 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-24 05:23:40 +00:00
Rafael Espindola
11d1803770 We don't need a null terminator for the output file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128098 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 19:20:47 +00:00
Ted Kremenek
3311d951e2 Properly initialize all fields in CrashReporterCleanupContext. This caused the buildbot failure earlier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128071 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 04:33:13 +00:00
Ted Kremenek
07235a1705 Temporarily stop recovering resources in CrashRecoveryContext while I investigate further why this works on my machine and not on others.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128065 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 02:06:32 +00:00
Ted Kremenek
b52fde4185 Provide a means for CrashRecovery clients to determine if code is currently running while crash recovery cleanups are being processed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128008 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 18:38:03 +00:00
Benjamin Kramer
ed8f9589a8 Avoid initializing posix_spawn_file_actions_t if not used.
- glibc falls back to fork+exec if a file actions object is present.
- On BSDs this saves a malloc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127969 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-20 15:52:24 +00:00
Ted Kremenek
1a06d5721a Tweak CrashRecoveryContextCleanup to provide an easy method for clients to select between 'delete' and 'destructor' cleanups, and allow the destructor of CrashRecoveryContextCleanupRegister to be pseudo re-entrant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127929 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-19 00:59:37 +00:00
Ted Kremenek
fb200e30a4 Tweak CrashRecoveryContext::GetCurrent() to return quickly if 'gCrsahRecoveryEnabled' is false. This avoids us needing to go to thread local storage for
the performance sensitive case where we are compiling code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127928 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-19 00:59:33 +00:00
Jim Grosbach
05f98a39e5 setExecutable() should default to success if there's nothing custom for it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127891 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-18 18:51:03 +00:00
NAKAMURA Takumi
d4f4e6ee2c raw_ostream: [PR6745] Tweak formatting (double)%e for Windows hosts.
On MSVCRT and compatible, output of %e is incompatible to Posix by default. Number of exponent digits should be at least 2. "%+03d"

FIXME: Implement our formatter in future!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127872 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-18 09:30:10 +00:00
Bill Wendling
f09a8b533d Initialize the only-used-with-PPC-double-double parts of the APFloat class. This
makes valgrind stop complaining about uninitialized variables being read when it
accesses a bitfield (category) that shares its bits with these variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127871 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-18 09:09:44 +00:00
Rafael Espindola
49ab1207df Check RequiresNullTerminator first, or we might read from an invalid address.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127853 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-18 02:55:51 +00:00
Ted Kremenek
a4f9839701 Augment CrashRecoveryContext to have registered "cleanup" objects that can be used to release resources during a crash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127849 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-18 02:05:11 +00:00
Rafael Espindola
9916d2ac39 Use RequiresNullTerminator to create buffers without a null terminator
instead of copying.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127835 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-17 22:18:42 +00:00
Benjamin Kramer
d9103df51b Add an argument to APInt's magic udiv calculation to specify the number of bits that are known zero in the divided number.
This will come in handy soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127828 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-17 20:39:06 +00:00
NAKAMURA Takumi
7a7215b563 lib/Support/raw_ostream.cpp: On mingw, report_fatal_error() should not be called at dtor context.
report_fatal_error() invokes exit(). We know report_fatal_error() might not write messages to stderr when any errors were detected on FD == 2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127726 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-16 02:53:39 +00:00
NAKAMURA Takumi
bab2d49d4a Windows/PathV2.inc: [PR8520] Recognize "NUL" as special (character) file.
FIXME: It is a temporal hack. We should detect as many "special file name" as possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127724 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-16 02:53:32 +00:00
NAKAMURA Takumi
bfb25cd97c Windows/Path.inc: [PR6270] PathV1::makeUnique(): Give arbitrary initial seed for workaround.
FIXME: We should use sys::fs::unique_file() in future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127723 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-16 02:53:24 +00:00
John Thompson
6046cffbaf Add scei vendor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127705 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-15 21:51:56 +00:00
Rafael Espindola
9d2234d6a0 Don't compute the file size if we don't need to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127426 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-10 20:54:07 +00:00
Rafael Espindola
f7fdad15d9 Add r127409 back now that the windows file was updated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127417 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-10 18:33:29 +00:00
Rafael Espindola
b78e2ae4ca Try to fix the windows build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127416 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-10 18:30:48 +00:00
Jakob Stoklund Olesen
4b0e1f1278 Revert r127409 which broke all the Windows bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127413 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-10 18:01:43 +00:00
Rafael Espindola
7deb187736 Add support for MemoryBuffers that are not null terminated and add
support for creating buffers that cover only a part of a file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127409 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-10 16:10:30 +00:00
NAKAMURA Takumi
c61ac5120d lib/Support/regcomp.c: Fix cygwin warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127241 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-08 12:25:29 +00:00
NAKAMURA Takumi
19b6c73878 Windows/PathV2.inc: Eliminate redundant condition. DWORD is unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127140 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-07 00:12:53 +00:00
Benjamin Kramer
ca9714470e raw_ostream: while it is generally desirable to do larger writes, it can lead to
inefficient file system buffering if the writes are not a multiple of the desired
buffer size. Avoid this by limiting the large write to a multiple of the buffer
size and copying the remainder into the buffer.

Thanks to Dan for pointing this out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127026 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-04 19:49:30 +00:00
Benjamin Kramer
e90756d8a0 raw_ostream: If writing a string that is larger than the buffer, write it directly instead of doing many buffer-sized writes.
This caps the number of write(2) calls per string to a maximum of 2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127010 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-04 18:18:16 +00:00
Daniel Dunbar
0aa00f9110 Support: Add llvm::AreStatisticsEnabled().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126558 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-26 23:17:12 +00:00
Cameron Zwarich
8d7285d0e5 The signed version of our "magic number" computation for the integer approximation
of a constant had a minor typo introduced when copying it from the book, which
caused it to favor negative approximations over positive approximations in many
cases. Positive approximations require fewer operations beyond the multiplication.

In the case of division by 3, we still generate code that is a single instruction
larger than GCC's code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126097 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 00:22:02 +00:00
Devang Patel
98d9f5d90d Provide tag strings for llvm specific tags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125986 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 23:06:29 +00:00
Chris Lattner
6309b3e9be improve support for OpenBSD, patch by Amit Kulkarni!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125943 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 17:04:56 +00:00
Argyrios Kyrtzidis
c788f44642 Check the errorcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125804 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 00:47:07 +00:00
Nadav Rotem
093399cbf3 Enhance constant folding of bitcast operations on vectors of floats.
Add getAllOnesValue of FP numbers to Constants and APFloat.
Add more tests.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125776 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 21:22:27 +00:00
NAKAMURA Takumi
6904f05e60 Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 generally.
No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32. In llvm side, i686 and x64 can be treated as similar way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125747 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 12:24:17 +00:00
Argyrios Kyrtzidis
6e31b9b8c3 Implement a function from PathV2 whose definition is missing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125574 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-15 17:51:19 +00:00
Zhanyong Wan
63cc3a85cc Adds llvm::sys::path::is_separator() to test whether a char is a path separator
on the host OS.  Reviewed by dgregor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125406 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11 21:24:40 +00:00
Douglas Gregor
f3e3f21db1 Rip out realpath() support. It's expensive, and often a bad idea, and
I have another way to achieve the same goal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125239 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 23:33:15 +00:00
Cameron Zwarich
0bef1f3d1b Attempt to fix the build after r125228.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125236 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 23:02:14 +00:00
Douglas Gregor
025feadb97 Add llvm::sys::path::canonical(), which provides the canonicalized
name of a path, after resolving symbolic links and eliminating excess
path elements such as "foo/../" and "./".

This routine still needs a Windows implementation, but I don't have a
Windows machine available. Help? Please?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125228 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 22:11:23 +00:00
NAKAMURA Takumi
e29b0aca51 lib/Support/Errno.cpp: Check strerror_s() with HAVE_DECL_STRERROR_S in config.h.*.
AC_CHECK_FUNCS seeks a symbol only in libs. We should check the declaration in string.h.

FIXME: I have never seen mingw(s) have strerror_s() (not _strerror_s()).
FIXME: Autoconf/CMake may seek strerror_s() with the definition MINGW_HAS_SECURE_API in future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125172 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 04:18:48 +00:00
NAKAMURA Takumi
fd289497a5 Windows/Windows.h: Redefine _WIN32_WINNT here. mingw-w64 tends to define it as 0x0502 in its headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125171 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 04:18:30 +00:00
NAKAMURA Takumi
2d52a612d9 Windows/Program.inc: Eliminate the declaration of SetInformationJobObject(). It should be provided with _WIN32_WINNT>=0x0500.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125170 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 04:18:21 +00:00
NAKAMURA Takumi
ad1b453b24 Windows/DynamicLibrary.inc: ELM_Callback fix for mingw-w64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125169 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 04:18:12 +00:00
Rafael Espindola
b4cc031a3e Don't open the file again in the gold plugin. To be able to do this, update
MemoryBuffer::getOpenFile to not close the file descriptor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125128 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-08 22:40:47 +00:00
Anders Carlsson
15ec695e8a Fix a clang warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124960 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05 18:19:35 +00:00
NAKAMURA Takumi
1f6832a858 Windows/DynamicLibrary.inc: Split explicit symbols into explicit_symbols.inc.
config.h.* have conditions whether each symbol is defined or not.
Autoconf and CMake may check symbols in libgcc.a for JIT on Mingw.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124950 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05 15:11:53 +00:00
NAKAMURA Takumi
0f0889e24b Windows/Program.inc: Quote arguments when dubious characters (used by cmd.exe or MSYS shell) are included to invoke CreateProcess(). Thanks to Danil Malyshev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124945 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05 08:53:12 +00:00
NAKAMURA Takumi
6d600da734 Make Win32's header file name lower for cross build on case-sensitive filesystem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124864 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-04 12:53:04 +00:00
Daniel Dunbar
b0cfa6cab8 raw_fd_ostream: Add a SetUseAtomicWrites() method (uses writev).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124771 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03 03:32:32 +00:00
Duncan Sands
ae200c60c3 Remove NoVendor and NoOS, added in commit 123990, from Triple. While it
may be useful to understand "none", this is not the place for it.  Tweak
the fix to Normalize while there: the fix added in 123990 works correctly,
but I like this way better.  Finally, now that Triple understands some
non-trivial environment values, teach the unittests about them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124720 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-02 10:08:38 +00:00
Evan Cheng
2bffee2ee7 Patches to build EFI with Clang/LLVM. By Carl Norum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124639 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-01 01:14:13 +00:00
Daniel Dunbar
c98d82a7f0 Support/CommandLine: Fix LookupNearestOption to also search extra option names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124124 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-24 17:27:17 +00:00
Ted Kremenek
584520e8e2 Null initialize a few variables flagged by
clang's -Wuninitialized-experimental warning.
While these don't look like real bugs, clang's
-Wuninitialized-experimental analysis is stricter
than GCC's, and these fixes have the benefit
of being general nice cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124073 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-23 17:05:06 +00:00
Renato Golin
859f818363 Clang was not parsing target triples involving EABI and was generating wrong IR (wrong PCS) and passing the wrong information down llc via the target-triple printed in IR. I've fixed this by adding the parsing of EABI into LLVM's Triple class and using it to choose the correct PCS in Clang's Tools. A Clang patch is on its way to use this infrastructure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123990 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-21 18:25:47 +00:00
Daniel Dunbar
f4fb66acae Support/CommandLine: Add "Did you mean" print for mismatched operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123717 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-18 01:59:24 +00:00
NAKAMURA Takumi
edd0924d84 Windows/PathV2.inc: For CryptAcquireContext(), CRYPT_VERIFYCONTEXT may be specified for easy use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123687 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-17 22:41:34 +00:00
NAKAMURA Takumi
8ee48c584d Windows/PathV2.inc: MoveFileEx() can behave like Posix's mv(1) to specify MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123686 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-17 22:41:25 +00:00
NAKAMURA Takumi
ac25e44d89 lib/Support/Windows/Signals.inc: "Showstopper" dialogs may be suppressed with SetErrorMode() on Windows 7.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123685 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-17 22:41:15 +00:00
Michael J. Spencer
2634a5425c Support/raw_ostream: Fix uninitalized variable in raw_fd_ostream constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123643 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-17 15:53:12 +00:00
Michael J. Spencer
283d49c766 Fix rename.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123604 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-16 22:18:41 +00:00
Michael J. Spencer
28f0ed5c9d Support/PathV2: Add identify_magic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123548 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-15 20:39:36 +00:00
Michael J. Spencer
b33594be3d Support/PathV2: Implement has_magic in terms of get_magic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123545 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-15 18:52:41 +00:00
Michael J. Spencer
d6cdf1d3cb Support/PathV2: Implement get_magic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123544 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-15 18:52:33 +00:00
Michael J. Spencer
9df536ca78 Support/Path: Deprecate PathV1::IsSymlink and replace all uses with PathV2::is_symlink.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123345 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-12 23:55:06 +00:00
Michael J. Spencer
218dc3e2fe Support/Path: Deprecate PathV1::isDirectory and replace all uses with PathV2::is_directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123209 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 01:21:55 +00:00
Michael J. Spencer
54453f2978 Support/Path: Deprecate PathV1::exists and replace all uses with PathV2::fs::exists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123151 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 02:34:23 +00:00
Abramo Bagnara
4bb46f43eb Fixed parsing of hex floats.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122963 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 16:55:14 +00:00
Michael J. Spencer
7fd682aaf2 Support/PathV2: Implement remove_all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122884 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-05 16:39:38 +00:00
Michael J. Spencer
277fa1047b Support/Windows/PathV2: Make directory iteration ignore . and ..
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122883 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-05 16:39:30 +00:00
Michael J. Spencer
abce07328c Support/Windows/PathV2: Fix remove to handle both files and directories.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122882 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-05 16:39:22 +00:00
Michael J. Spencer
5bcdc7f7c4 Support/PathV2: Implement directory_entry::status.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122881 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-05 16:39:13 +00:00
Michael J. Spencer
da7c1cab8c Support/PathV2: Implement directory iteration on POSIX.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122879 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-05 16:38:57 +00:00
Benjamin Kramer
3fee954b3e Fix a signed/unsigned comparison warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122597 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-28 13:05:13 +00:00
Michael J. Spencer
4213618088 Support/Path: Deprecate Path::hasMagicNumber and replace all uses with fs::has_magic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122589 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-28 01:49:21 +00:00
Michael J. Spencer
628467ef1f Support/PathV2: Implement has_magic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122587 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-28 01:49:01 +00:00
Michael J. Spencer
9170a0f02d Support/PathV1: Deprecate GetRootDirectory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122580 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-27 03:21:41 +00:00
Michael J. Spencer
43ee29d418 Support/PathV1: Deprecate makeAbsolute and remove Unix impl because it annoys people.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122553 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-25 20:10:11 +00:00
Jeffrey Yasskin
8e68c38735 Change all self assignments X=X to (void)X, so that we can turn on a
new gcc warning that complains on self-assignments and
self-initializations.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122458 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 00:58:24 +00:00
Jakob Stoklund Olesen
b907e8a2d4 Use IntEqClasses to compute connected components of live intervals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122296 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 00:48:17 +00:00
Jakob Stoklund Olesen
2a6899c539 Add ADT/IntEqClasses.h as a light-weight implementation of EquivalenceClasses.h.
This implementation already exists as ConnectedVNInfoEqClasses in
LiveInterval.cpp, and it seems to be generally useful to have a light-weight way
of forming equivalence classes of small integers.

IntEqClasses doesn't allow enumeration of the elements in a class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122293 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 00:04:46 +00:00
Michael J. Spencer
2d484eb88d Support/PathV2: Add missing has_relative_path impl.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122243 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 13:30:28 +00:00
Nick Lewycky
476b242fe7 Add missing standard headers. Patch by Joerg Sonnenberger!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122193 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 20:43:38 +00:00
Michael J. Spencer
b3127bb06a Support/PathV1: Deprecate getLast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122116 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18 00:19:10 +00:00
Benjamin Kramer
3ce88c9290 PathV2: Use StringRef::substr to simplify substring creation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122085 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 20:27:37 +00:00
Benjamin Kramer
7fb866643e Missed some StringRefRefs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122077 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 18:59:09 +00:00
Benjamin Kramer
d53f3c864b Pass StringRefs by value, for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122074 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 18:19:06 +00:00
Jim Grosbach
e509aa961c Trailing whitespace and 80 column fixups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122026 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 02:10:59 +00:00
Michael J. Spencer
3ff9563c3e MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121958 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-16 03:29:14 +00:00
NAKAMURA Takumi
ad3ea3d85f lib/Support/regexec.c: Let Regex LLP64-aware.
On LLP64 Win64, 'states1' (for small version) was expanded to 'char *' for large version. Thus small version would be mischosen when nstates > 32 regardless of sizeof(long) on Win64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121942 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-16 01:48:15 +00:00
Michael J. Spencer
924aa23b74 Support/Windows/PathV2: Fix header comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121383 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 17:37:42 +00:00
Michael J. Spencer
333ad3f2bf Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121382 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 17:37:32 +00:00
Michael J. Spencer
58fe86dc0e Support: Move c_str from SmallVector back to SmallString and add a free standing
templated c_str in Windows.h to replace it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121381 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 17:37:18 +00:00
Michael J. Spencer
61187dd0ad Support/FileSystem: Change file_status predicate functions that cannot fail to
return their result instead of an error_code. Also add some missing predicate
functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121380 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 17:37:02 +00:00
Michael J. Spencer
333fb04506 Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with error_code &ec. And fix clients.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121379 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 17:36:48 +00:00
Michael J. Spencer
c20beb9cc5 Support: Remove Alarm. It is unused (via local grep and google code search).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121160 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 18:41:59 +00:00
Michael J. Spencer
12ccf67457 Support/PathV2: Remove const from bool return types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121157 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 18:12:07 +00:00
Michael J. Spencer
5029159fbe Support/PathV2: Change most functions in the path namespace to return their work
via their return value instead of an out parameter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121149 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 17:04:04 +00:00
Daniel Dunbar
dc3b906173 build: Go back to dropping __eprintf reference when building with Clang, see
comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121146 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 16:29:44 +00:00
Jay Foad
40f8f6264d PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121120 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 08:25:19 +00:00
Owen Anderson
0ea112f104 Don't leak the mutex when loading dynamic libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 07:56:20 +00:00
Michael J. Spencer
ca3a339d76 Support/PathV2: Cleanup separator handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121110 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 03:57:48 +00:00
Michael J. Spencer
936671b2ea Support/PathV2: Remove the error_code return type from all functions in the path
namespace. None of them return anything except for success anyway. These will be
converted to returning their result soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 03:57:37 +00:00
Michael J. Spencer
ee271d8758 Support/PathV2: Move make_absolute from path to fs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121108 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 03:57:17 +00:00
Michael J. Spencer
69cbbbf005 Support/Unix/PathV2: Return the real error from realpath instead of any error
that close or unlink set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121094 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:23:39 +00:00
Michael J. Spencer
79c3c3a1de Support/Unix/PathV2: Use 0770 instead of 0700 when creating a directory. Also use
the standard macros instead of octal notation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:23:29 +00:00
Michael J. Spencer
fbd1bbd7fa Support/PathV2: Use SmallVector::clear instead of set_size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121092 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:23:19 +00:00
Michael J. Spencer
ad8a14f24e Support/PathV2: Clarify and correct documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121091 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:23:08 +00:00
Michael J. Spencer
1522fce477 Support/PathV2: Move current_path from path to fs and fix the Unix implementation.
Unix bug spotted by Dan Gohman.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121090 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:22:31 +00:00
Michael J. Spencer
476d2f769e Support/Windows: Make MinGW happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120991 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 06:02:07 +00:00
Michael J. Spencer
753cbbbd3c Support/FileSystem: Add directory_iterator implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120989 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 04:28:42 +00:00
Michael J. Spencer
f150e7695e Support/PathV2: Fix append to not add a slash to empty or root paths.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120988 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 04:28:23 +00:00
Michael J. Spencer
7eec50bf4f Support/Windows: Add ScopedHandle and move some clients over to it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120987 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 04:28:13 +00:00
Bill Wendling
a6091be84c Silence 'may be used uninitialized in this function' warnings. Static analysis
may determine that they cannot be used uninitialized. But that might be a bit
too much for the compiler to determine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120916 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 20:20:34 +00:00
Michael J. Spencer
9d425e7687 Support/PathV2: Remove redundant calls to make_error_code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120913 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 18:45:32 +00:00
Benjamin Kramer
fd6d53fbad APInt: microoptimize a few methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120912 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 18:05:36 +00:00
Michael J. Spencer
470ae13be8 Support/FileSystem: Add status implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120870 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 00:32:40 +00:00
Michael J. Spencer
4958466f9f Support/Windows/FileSystem: Fix MinGW warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120868 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 00:32:14 +00:00
Michael J. Spencer
01a87c413d Support/FileSystem: Add file_size implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120867 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 00:31:48 +00:00
Jakob Stoklund Olesen
7a26aca73f Add IntervalMap::iterator::set{Start,Stop,Value} methods that allow limited
editing of the current interval.

These methods may cause coalescing, there are corresponding set*Unchecked
methods for editing without coalescing. The non-coalescing methods are useful
for applying monotonic transforms to all keys or values in a map without
accidentally coalescing transformed and untransformed intervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120829 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 19:02:00 +00:00
Michael J. Spencer
b531f45a9d Support/FileSystem: Add equivalent implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120827 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 18:49:13 +00:00
Michael J. Spencer
db04b39dad Support/FileSystem: Fix MinGW build. It doesn't have _chsize_s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120826 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 18:48:56 +00:00
Michael J. Spencer
b39e33f39b And I really hate line endings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120821 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 18:04:11 +00:00
Michael J. Spencer
af45fc005b Support/Windows/FileSystem: Fix MinGW build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120820 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 18:03:28 +00:00
Michael J. Spencer
3920d3b4f4 Support/FileSystem: Add resize_file implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120819 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 17:54:07 +00:00
Michael J. Spencer
a50b98c517 Support/FileSystem: Add rename implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120818 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 17:53:55 +00:00
Michael J. Spencer
106aa731bf Support/FileSystem: Add remove implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120817 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 17:53:43 +00:00
Michael J. Spencer
998b4709cb Fix line endings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120816 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 17:53:23 +00:00
Eric Christopher
481d402ab0 Apparently OS X 10.4 doesn't have __crashreporter_info__.
Try to fix building on the wayback machine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120801 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 07:45:22 +00:00
Michael J. Spencer
9b391c513e Support/FileSystem: Add create_symlink implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120800 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 07:41:25 +00:00
Michael J. Spencer
d7b305f13e Support/FileSystem: Add create_hard_link implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120792 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 05:58:41 +00:00
Michael J. Spencer
0dda5437f8 Support/ADT/Twine: Make toNullTerminatedStringRef not rely on UB :(.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 05:42:25 +00:00
Michael J. Spencer
b83769f36a Support/FileSystem: Add create_director{y,ies} implementations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120790 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 05:42:11 +00:00
Michael J. Spencer
2dbdeee87a Support/Windows/FileSystem: Remove unneeded toNullTerminatedStringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120777 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 01:21:38 +00:00
Michael J. Spencer
3cb84ef65d Support/FileSystem: Add unique_file and exists implementations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120776 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 01:21:28 +00:00
Michael J. Spencer
871498e2ce Support/FileSystem: Fix copy_file implementation to use toNullTerminatedStringRef
instead of toStringRef. The file system APIs need c strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120601 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 20:37:42 +00:00
Michael J. Spencer
7dc7ac3cb2 Support/ADT/Twine: Add toNullTerminatedStringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120600 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 20:37:30 +00:00
Michael J. Spencer
bee0c38f59 Support/FileSystem: Add copy_file implementation. Not tests yet because the
file creation APIs aren't implemented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120593 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 19:32:01 +00:00
Jay Foad
7a874ddda0 PR5207: Rename overloaded APInt methods set(), clear(), flip() to
setAllBits(), setBit(unsigned), etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120564 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 08:53:58 +00:00