Commit Graph

1951 Commits

Author SHA1 Message Date
Benjamin Kramer a1355d17ca Move yaml::Stream's dtor out of line so it can see Scanner's dtor.
llvm-svn: 154004
2012-04-04 08:53:34 +00:00
Michael J. Spencer afc0d6a36f Sorry about that. MSVC seems to accept just about any random string you give it ;/
llvm-svn: 153979
2012-04-03 23:36:44 +00:00
Michael J. Spencer 22120c47a7 Add YAML parser to Support.
llvm-svn: 153977
2012-04-03 23:09:22 +00:00
Hal Finkel f208af02a4 Add triple support for the IBM BG/P and BG/Q supercomputers.
llvm-svn: 153882
2012-04-02 18:31:33 +00:00
Eric Christopher c13fd6d1e1 Lowercase the tag name to match the rest of dwarf.
llvm-svn: 153691
2012-03-29 21:35:05 +00:00
Anton Korobeynikov 4547077a2b Fix GetMainExecutable on kFreeBSD.
Patch by Sylvestre Ledru!

llvm-svn: 153435
2012-03-26 12:05:51 +00:00
Jean-Daniel Dupas a573b22015 Fix null to integer conversion warnings.
llvm-svn: 153395
2012-03-24 22:17:50 +00:00
Michael J. Spencer 39fb408fd3 [PathV2]: Fix bug in create_directories which caused infinite recursion on
som inputs.

Bug found and fix proposed by Kal Conley!

llvm-svn: 153225
2012-03-21 23:09:14 +00:00
Benjamin Kramer 78b505b065 Move APInt::operator[] inline.
llvm-svn: 152692
2012-03-14 00:38:15 +00:00
Benjamin Kramer 4c6a918cda Move APInt::operator! inline, it's small and fuses well with surrounding code when inlined.
llvm-svn: 152688
2012-03-14 00:01:35 +00:00
Argyrios Kyrtzidis 3dc531ef44 Add a sanity check in MemoryBuffer::getOpenFile() to make sure we don't hang
if the passed in FileSize is inaccurate.

rdar://11034179

llvm-svn: 152662
2012-03-13 20:18:42 +00:00
Benjamin Kramer 3870bc4805 Inline a trivial helper function.
llvm-svn: 152577
2012-03-12 21:18:53 +00:00
Duncan Sands 79d793e768 Don't cast away constant qualifier.
llvm-svn: 152553
2012-03-12 10:51:06 +00:00
Benjamin Kramer 0f90695e31 Replace a hand-coded leading one counting loop with the magic from MathExtras.h.
llvm-svn: 152545
2012-03-11 19:32:35 +00:00
Michael J. Spencer cfa95f66a1 Make StringRef::getAsInteger work with all integer types. Before this change
it would fail with {,u}int64_t on x86-64 Linux.

This also removes code duplication.

llvm-svn: 152517
2012-03-10 23:02:54 +00:00
Anton Korobeynikov f32638d77c Add support for r600 (AMD GPUs HD2XXX - HD6XXX) target triplet.
Patch by Tom Stellard!

llvm-svn: 152400
2012-03-09 10:09:36 +00:00
Benjamin Kramer 3bc40c5fee Silence unused function warning when graphviz is not available.
llvm-svn: 152346
2012-03-08 22:15:23 +00:00
Duncan Sands d8e918be4c Revert commit 152300 (ddunbar) since it still seems to be breaking
buildbots.  Original commit message:

[ADT] Change the trivial FoldingSetNodeID::Add* methods to be inline, reapplied
with a fix for the longstanding over-read of 32-bit pointer values.

llvm-svn: 152304
2012-03-08 09:32:21 +00:00
Daniel Dunbar 544637937a [ADT] Change the trivial FoldingSetNodeID::Add* methods to be inline, reapplied
with a fix for the longstanding over-read of 32-bit pointer values.

llvm-svn: 152300
2012-03-08 07:42:18 +00:00
Daniel Dunbar 5ecfd7fd12 Revert r152288, "[ADT] Change the trivial FoldingSetNodeID::Add* methods to be
inline.", which is breaking the bots in a way I don't understand.

llvm-svn: 152295
2012-03-08 04:17:15 +00:00
Daniel Dunbar faa48ebbba [ADT] Change the trivial FoldingSetNodeID::Add* methods to be inline.
llvm-svn: 152288
2012-03-08 02:52:00 +00:00
Benjamin Kramer 22842f89e4 Copy the right amount of elements.
llvm-svn: 152254
2012-03-07 22:48:42 +00:00
Benjamin Kramer 6e8d4b8eb4 SmallPtrSet: Copy all the elements when swapping, not just numelements.
This fixes a build failure in webkit. Copying all elements shouldn't be
necessary, I'll look out for a better fix soon.

llvm-svn: 152252
2012-03-07 22:33:21 +00:00
Andrew Trick edbb3b2231 Added -view-background to avoid waiting for each GraphViz invocation.
GV and XDOT paths are untested but should work the same.

llvm-svn: 152179
2012-03-07 00:18:27 +00:00
Benjamin Kramer e1c34e9f43 SmallPtrSet: Provide a more efficient implementation of swap than the default triple-copy std::swap.
This currently assumes that both sets have the same SmallSize to keep the implementation simple,
a limitation that can be lifted if someone cares.

llvm-svn: 152143
2012-03-06 20:40:02 +00:00
Chandler Carruth 71bd7d1e54 Replace the hashing functions on APInt and APFloat with overloads of the
new hash_value infrastructure, and replace their implementations using
hash_combine. This removes a complete copy of Jenkin's lookup3 hash
function (which is both significantly slower and lower quality than the
one implemented in hash_combine) along with a somewhat scary xor-only
hash function.

Now that APInt and APFloat can be passed directly to hash_combine,
simplify the rest of the LLVMContextImpl hashing to use the new
infrastructure.

llvm-svn: 152004
2012-03-04 12:02:57 +00:00
Chandler Carruth ca99ad3f0d Add generic support for hashing StringRef objects using the new hashing library.
llvm-svn: 152003
2012-03-04 10:55:27 +00:00
Chandler Carruth 93cffd2fb5 Switch FoldingSet over to the new hashing infrastructure. We might want
to do more invasive refactoring here to get FoldingSet to use size_t or
even hash_code directly, but for now this is a good first step to remove
Yet Another Hashing Algorithm from LLVM.

llvm-svn: 151859
2012-03-01 23:18:44 +00:00
Benjamin Kramer f7e02a0cab BumpPtrAllocator: Make sure threshold cannot be initialized with a value smaller than the slab size.
This replaces r151834 with a simpler fix.

llvm-svn: 151842
2012-03-01 22:10:16 +00:00
Argyrios Kyrtzidis 16558f4d3b If BumpPtrAllocator is requested to allocate a size that exceeds the slab size,
increase the slab size.

llvm-svn: 151834
2012-03-01 20:36:32 +00:00
Chandler Carruth 34085df4e8 Add the source file with trivial definitions in it that was missing from
r151822, sorry sorry. =[

We need 'git svn nothave' or some such...

llvm-svn: 151824
2012-03-01 18:58:59 +00:00
Chandler Carruth 1d03a3b6b1 Rewrite LLVM's generalized support library for hashing to follow the API
of the proposed standard hashing interfaces (N3333), and to use
a modified and tuned version of the CityHash algorithm.

Some of the highlights of this change:
 -- Significantly higher quality hashing algorithm with very well
    distributed results, and extremely few collisions. Should be close to
    a checksum for up to 64-bit keys. Very little clustering or clumping of
    hash codes, to better distribute load on probed hash tables.
 -- Built-in support for reserved values.
 -- Simplified API that composes cleanly with other C++ idioms and APIs.
 -- Better scaling performance as keys grow. This is the fastest
    algorithm I've found and measured for moderately sized keys (such as
    show up in some of the uniquing and folding use cases)
 -- Support for enabling per-execution seeds to prevent table ordering
    or other artifacts of hashing algorithms to impact the output of
    LLVM. The seeding would make each run different and highlight these
    problems during bootstrap.

This implementation was tested extensively using the SMHasher test
suite, and pased with flying colors, doing better than the original
CityHash algorithm even.

I've included a unittest, although it is somewhat minimal at the moment.
I've also added (or refactored into the proper location) type traits
necessary to implement this, and converted users of GeneralHash over.

My only immediate concerns with this implementation is the performance
of hashing small keys. I've already started working to improve this, and
will continue to do so. Currently, the only algorithms faster produce
lower quality results, but it is likely there is a better compromise
than the current one.

Many thanks to Jeffrey Yasskin who did most of the work on the N3333
paper, pair-programmed some of this code, and reviewed much of it. Many
thanks also go to Geoff Pike Pike and Jyrki Alakuijala, the original
authors of CityHash on which this is heavily based, and Austin Appleby
who created MurmurHash and the SMHasher test suite.

Also thanks to Nadav, Tobias, Howard, Jay, Nick, Ahmed, and Duncan for
all of the review comments! If there are further comments or concerns,
please let me know and I'll jump on 'em.

llvm-svn: 151822
2012-03-01 18:55:25 +00:00
Derek Schuff 56b662ce0f Make MemoryObject accessor members const again
llvm-svn: 151687
2012-02-29 01:09:06 +00:00
Daniel Dunbar 39ea458b73 Support/PathV2: Fix namespace qualifier in make_absolute(), for Win32.
llvm-svn: 151685
2012-02-29 00:46:46 +00:00
Daniel Dunbar b23158c3b7 Support/PathV2: Fix make_absolute() to match is_absolute() and not expect to
find root names on Unix.
 - This fixes make_absolute to not basically always call current_path() on
   Unix systems.
 - I think the API probably needs cleanup in this area, but I'll let Michael
   handle that.

llvm-svn: 151681
2012-02-29 00:20:37 +00:00
Michael J. Spencer e646239e5e [PathV2] Fix bug in relative_path.
llvm-svn: 151675
2012-02-29 00:06:24 +00:00
Ahmed Charles 0dca5d8f8c Fix undefined behavior.
llvm-svn: 151385
2012-02-24 19:06:15 +00:00
Duncan Sands 69d7a91334 Workaround a miscompilation by gcc-4.3 that showed up as a failure
of the StringRef.Split2 unittest on 32 bit machines.

llvm-svn: 151358
2012-02-24 09:01:34 +00:00
Jay Foad 585dda99f6 Update for the removal of Hashing.cpp.
llvm-svn: 151249
2012-02-23 09:33:44 +00:00
Jay Foad 5f77851a99 The implementation of GeneralHash::addBits broke C++ aliasing rules; fix
it with memcpy. This also fixes a problem on big-endian hosts, where
addUnaligned would return different results depending on the alignment
of the data.

llvm-svn: 151247
2012-02-23 09:16:04 +00:00
Chad Rosier 5dfe6dab25 Remove extra semi-colons.
llvm-svn: 151169
2012-02-22 17:25:00 +00:00
Chandler Carruth 0c7a7cc711 Support was removed from LLVM's MIPS backend for the PSP variant of that
chip in r139383, and the PSP components of the triple are really
annoying to parse. Let's leave this chapter behind. There is no reason
to expect LLVM to see a PSP-related triple these days, and so no
reasonable motivation to support them.

It might be reasonable to prune a few of the older MIPS triple forms in
general, but as those at least cause no burden on parsing (they aren't
both a chip and an OS!), I'm happy to leave them in for now.

llvm-svn: 151156
2012-02-22 11:32:54 +00:00
Duncan Sands 8570b29dfe Move the implementation of StringRef::split out of StringExtras.cpp
and into StringRef.cpp, which is where the other StringRef stuff is.

llvm-svn: 151054
2012-02-21 12:00:25 +00:00
Chandler Carruth 362087bcba Tiny cosmetic change to use the same style for all of the while loops in
the normalize routine, especially the empty while loops.

llvm-svn: 151050
2012-02-21 09:29:14 +00:00
Chandler Carruth 6ea6de7cad Replace a hand rolled loop with a lovely StringRef helper we have these
days. No functionality changed.

llvm-svn: 151048
2012-02-21 09:12:48 +00:00
Chandler Carruth aec9708988 Pull the parsing helper functions out of the Triple interface entirely.
They're private static methods but we can just make them static
functions in the implementation. It makes the implementations a touch
more wordy, but takes another chunk out of the header file.

Also, take the opportunity to switch the names to the new coding
conventions.

No functionality changed here.

llvm-svn: 151047
2012-02-21 08:53:32 +00:00
Chandler Carruth 1f3325a6d9 Clean up comments that I missed when changing the triple representation.
Somehow, I even missed the ones I wrote just the other day...

Thanks to Matt for the code review.

llvm-svn: 151045
2012-02-21 08:31:18 +00:00
Chandler Carruth 2d27b0f0ed Switch the llvm::Triple class to immediately parse the triple string on
construction. Simplify its interface, implementation, and users
accordingly as there is no longer an 'uninitialized' state to check for.
Also, fixes a bug lurking in the interface as there was one method that
didn't correctly check for initialization.

llvm-svn: 151024
2012-02-21 03:39:36 +00:00
Chandler Carruth 0d887dd0b9 Move constructors out-of-line and flesh out their documentation. No
functionality changed. This is in preparation for some refactoring of
how this class behaves.

llvm-svn: 150941
2012-02-20 00:02:47 +00:00
Ahmed Charles 636a3d618c Remove dead code. Improve llvm_unreachable text. Simplify some control flow.
llvm-svn: 150918
2012-02-19 11:37:01 +00:00
NAKAMURA Takumi 5adeb93d8a APFloat::toString(): Fix overrun at scanning.
FYI, clang/test/SemaTemplate/template-id-printing.cpp had been failing due to it on cygwin-clang.

llvm-svn: 150911
2012-02-19 03:18:29 +00:00
Ahmed Charles 4f9484722c Fix issue with bitwise and precedence.
llvm-svn: 150897
2012-02-18 22:56:41 +00:00
Talin f2291c908b Hashing.h - utilities for hashing various data types.
llvm-svn: 150890
2012-02-18 21:00:49 +00:00
Chandler Carruth b54950bef4 Trivial cleanup to group the generic 'armvN' cases with the 'arm' case,
etc. No functionality changed.

llvm-svn: 150867
2012-02-18 04:34:17 +00:00
Kaelyn Uhrain 7a9ccf4c09 Add function for computing the edit distance of two arrays.
Accomplished by moving the body of StringRef::edit_distance into
a separate function that accepts two ArrayRefs, and making
StringRef::edit_distance a wrapper around the new function.

llvm-svn: 150621
2012-02-15 22:13:07 +00:00
Benjamin Kramer 22a0fdf24b StringSwitchify the rest of Triple.cpp.
llvm-svn: 150332
2012-02-12 10:56:52 +00:00
Chandler Carruth ff6f356b95 Switch a bunch of manual if-chains to use StringSwitch. Clean them up in
the process. Some of these are still a bit gross.

Still, this cuts 80 some lines out of this ridiculous file. ;]

llvm-svn: 150331
2012-02-12 09:27:38 +00:00
David Blaikie 18544b9614 Change default error_code ctor to a 'named ctor' so it's more self-documenting.
Unify default construction of error_code uses on this idiom so that users don't
feel compelled to make static globals for naming convenience. (unfortunately I
couldn't make the original ctor private as some APIs don't return their result,
instead using an out parameter (that makes sense to default construct) - which
is a bit of a pity. I did, however, find/fix some cases of unnecessary default
construction of error_code before I hit the unfixable cases)

llvm-svn: 150197
2012-02-09 19:24:12 +00:00
David Blaikie e7d7a5dfaa Remove static initializer from DataStream.cpp
If someone would prefer a clear name for the 'success' error_value we could
come up with one - potentially just a 'named constructor' style
'error_value::success()' to make this expression more self-documenting. If
I see this come up in other cases I'll certainly consider it.

One step along the way to resolving PR11944.

llvm-svn: 150120
2012-02-09 00:29:19 +00:00
Benjamin Kramer 5e4f0a4a31 PathV2: Remove static StringRef ctors.
llvm-svn: 150071
2012-02-08 13:13:47 +00:00
David Blaikie 0210e97680 Correct use of const in ParseCommandLineOptions
llvm-svn: 149999
2012-02-07 19:36:01 +00:00
Craig Topper a2886c21d9 Convert assert(0) to llvm_unreachable
llvm-svn: 149967
2012-02-07 05:05:23 +00:00
Derek Schuff 76b292f5ba Fix win32 build breakage from bitcode streaming patch
llvm-svn: 149941
2012-02-07 00:28:46 +00:00
Nick Lewycky 998bce0366 Fix comment-rulers.
llvm-svn: 149922
2012-02-06 22:41:47 +00:00
Derek Schuff 8b2dcad4b5 Enable streaming of bitcode
This CL delays reading of function bodies from initial parse until
materialization, allowing overlap of compilation with bitcode download.

llvm-svn: 149918
2012-02-06 22:30:29 +00:00
Chandler Carruth 07cfb4b696 Introduce helpers to compute the 32-bit varaints and 64-bit variants of
some architectures. These are useful for interacting with multiarch or
bi-arch GCC (or GCC-based) toolchains.

llvm-svn: 149895
2012-02-06 20:46:33 +00:00
Sebastian Pop bbb8eb58f9 fix typo
llvm-svn: 149856
2012-02-06 05:29:29 +00:00
Duncan Sands ae22c60f90 Persuade GCC that there is nothing worth warning about here (there isn't).
llvm-svn: 149834
2012-02-05 14:20:11 +00:00
Devang Patel 839515b64d Add new tag and an attribute to support debug info for objective-c property.
llvm-svn: 149724
2012-02-03 23:57:08 +00:00
Bob Wilson aa30aff4f7 Add Triple::getMacOSXVersion to replace crufty code in the clang driver.
This new function provides a way to get the Mac OS X version number from
either generic "darwin" triples of macosx triples.

llvm-svn: 149438
2012-01-31 22:32:29 +00:00
Chandler Carruth b90c102a52 Add various coarse bit-width architecture predicates to llvm::Triple.
These are very useful for frontends and other utilities reasoning about
or selecting between triples.

llvm-svn: 149353
2012-01-31 04:52:32 +00:00
Douglas Gregor 7039e358fc Move Clang's file-level locking facility over to LLVM's support
library, since it doesn't really have anything to do with Clang.

llvm-svn: 149203
2012-01-29 20:15:10 +00:00
Rafael Espindola bb893fea6b Add r149110 back with a fix for when the vector and the int have the same
width.

llvm-svn: 149151
2012-01-27 23:33:07 +00:00
Jim Grosbach 65e2465550 Tidy up. s/Low Level Virtual Machine/LLVM/.
LLVM isn't an acronym anymore.

llvm-svn: 148985
2012-01-25 22:00:23 +00:00
David Blaikie d3303ded75 Remove dead default.
llvm-svn: 148738
2012-01-23 22:37:11 +00:00
David Blaikie 46a9f016c5 More dead code removal (using -Wunreachable-code)
llvm-svn: 148578
2012-01-20 21:51:11 +00:00
Rafael Espindola f5e78fa8d1 Add support for the gnueabihf environment. Patch by Sylvestre Ledru.
llvm-svn: 148434
2012-01-18 23:35:29 +00:00
Manuel Klimek 85d26f9807 Removes template magic to build up containers.
Instead, we now put the attributes of the container into members.

llvm-svn: 148302
2012-01-17 09:34:07 +00:00
David Blaikie b48ed1a4cb Remove unreachable code. (replace with llvm_unreachable to help GCC where necessary)
llvm-svn: 148284
2012-01-17 04:43:56 +00:00
David Blaikie 486df738c3 Removing unused default switch cases in switches over enums that already account for all enumeration values explicitly.
(This time I believe I've checked all the -Wreturn-type warnings from GCC & added the couple of llvm_unreachables necessary to silence them. If I've missed any, I'll happily fix them as soon as I know about them)

llvm-svn: 148262
2012-01-16 23:24:27 +00:00
Chandler Carruth da22f30e72 Remove SetWorkingDirectory from the Process interface. Nothing in LLVM
or Clang is using this, and it would be hard to use it correctly given
the thread hostility of the function. Also, it never checked the return
which is rather dangerous with chdir. If someone was in fact using this,
please let me know, as well as what the usecase actually is so that
I can add it back and make it more correct and secure to use. (That
said, it's never going to be "safe" per-se, but we could at least
document the risks...)

llvm-svn: 148211
2012-01-15 08:41:35 +00:00
David Blaikie fdcd669bc6 Remove dead code.
llvm-svn: 148206
2012-01-15 01:09:13 +00:00
Argyrios Kyrtzidis cd8fe08e4d Disable the crash reporter when running lit tests.
llvm-svn: 147965
2012-01-11 20:53:25 +00:00
Chandler Carruth 9a7510af46 Teach the triple library about the androideabi environment.
Patch by Evgeniy Stepanov.

llvm-svn: 147871
2012-01-10 19:46:00 +00:00
Chandler Carruth f3e8502cc1 Add 'llvm_unreachable' to passify GCC's understanding of the constraints
of several newly un-defaulted switches. This also helps optimizers
(including LLVM's) recognize that every case is covered, and we should
assume as much.

llvm-svn: 147861
2012-01-10 18:08:01 +00:00
David Blaikie edbb58c577 Remove unnecessary default cases in switches that cover all enum values.
llvm-svn: 147855
2012-01-10 16:47:17 +00:00
Benjamin Kramer 077ae1d760 Add definitions for AMD's bobcat (aka btver1)
llvm-svn: 147846
2012-01-10 11:50:02 +00:00
Sebastian Pop 99ab273a77 revert r147542 after comments from Joerg Sonnenberger
llvm-svn: 147608
2012-01-05 18:28:46 +00:00
Sebastian Pop 0f357d6c22 use getHostTriple instead of getDefaultTargetTriple in getClosestTargetForJIT
Get back getHostTriple.

For JIT compilation, use the host triple instead of the default
target: this fixes some JIT testcases that used to fail when the
compiler has been configured as a cross compiler.

llvm-svn: 147542
2012-01-04 19:47:22 +00:00
Nick Lewycky 228f5b4ba3 Conform to the style guide; remove 'else' after 'return'. Also remove an extra
if-statement by turning it into an assert. No functionality change.

llvm-svn: 147474
2012-01-03 20:33:00 +00:00
Benjamin Kramer 46236ee5cf Switch StringMap from an array of structures to a structure of arrays.
- -25% memory usage of the main table on x86_64 (was wasted in struct padding).
- no significant performance change.

llvm-svn: 147294
2011-12-27 20:35:07 +00:00
Dylan Noblesmith 9e5b178ecc drop unneeded config.h includes
llvm-svn: 147197
2011-12-22 23:04:07 +00:00
Eli Friedman 2aae94fa70 Fix APInt::rotl and APInt::rotr so that they work correctly. Found while writing some code that tried to use them.
llvm-svn: 147134
2011-12-22 03:15:35 +00:00
Manuel Klimek 25eb0ac418 Changes the JSON parser to use the SourceMgr.
Diagnostics are now emitted via the SourceMgr and we use MemoryBuffer
for buffer management. Switched the code to make use of the trailing
'0' that MemoryBuffer guarantees where it makes sense.

llvm-svn: 147063
2011-12-21 18:16:39 +00:00
Manuel Klimek fe198ced31 Fixes a potential compilation error.
Pulling the template implementation into the header to guarantee
that it's visible to all possible instantiations.

llvm-svn: 146973
2011-12-20 11:04:23 +00:00
Manuel Klimek 47151c37b6 Pulls the implementation of skip() into JSONParser.
This is the first step towards migrating more of the parser
implementation into the parser class.

llvm-svn: 146971
2011-12-20 10:42:52 +00:00
Manuel Klimek f8d73192cc Addressing style issues in JSON parser.
llvm-svn: 146968
2011-12-20 09:26:26 +00:00
Chandler Carruth e805b16e3d Fix up the CMake build for the new files added in r146960, they're
likely to stay either way that discussion ends up resolving itself.

llvm-svn: 146966
2011-12-20 08:42:11 +00:00
David Blaikie a379b18173 Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch
llvm-svn: 146960
2011-12-20 02:50:00 +00:00
Dylan Noblesmith 1c419ff50d APInt: update asserts for base-36
Hexatridecimal was added in r139695.

And fix the unittest that now triggers the assert.

llvm-svn: 146754
2011-12-16 20:36:31 +00:00
Manuel Klimek 2c899a181c Adds a JSON parser and a benchmark (json-bench) to catch performance regressions.
llvm-svn: 146735
2011-12-16 13:09:10 +00:00
Michael J. Spencer 4f8a832c19 Support/FileSystem: Add file_magic and move a vew clients over to it.
llvm-svn: 146523
2011-12-13 23:17:12 +00:00
Michael J. Spencer a2755f8efa Support/Program: Make Change<stream>ToBinary return error_code.
llvm-svn: 146522
2011-12-13 23:16:49 +00:00
Michael J. Spencer 7dfbeda68e Cleanup whitespace.
llvm-svn: 146521
2011-12-13 23:16:15 +00:00
Tony Linthicum 1213a7a57f Hexagon backend support
llvm-svn: 146412
2011-12-12 21:14:40 +00:00
Daniel Dunbar 27a7489a03 LLVMBuild: Remove trailing newline, which irked me.
llvm-svn: 146409
2011-12-12 19:48:00 +00:00
Chad Rosier 531042840d Revert r146363 to allow buildbots to make forward progress.
Original commit message:
Support/FileSystem: Implement canonicalize.

llvm-svn: 146378
2011-12-12 17:58:31 +00:00
Michael J. Spencer 203d7807a8 Support/FileSystem: Implement bool equivalent(file_status A, file_status B);
llvm-svn: 146364
2011-12-12 06:04:28 +00:00
Michael J. Spencer 32ef4d2e1b Support/FileSystem: Implement canonicalize.
llvm-svn: 146363
2011-12-12 06:04:01 +00:00
Michael J. Spencer 513f1b666f Support/Windows: Cleanup scoped handles.
llvm-svn: 146362
2011-12-12 06:03:33 +00:00
Michael J. Spencer 0a7625d661 Support/FileSystem: Implement recursive_directory_iterator and make
directory_iterator preserve InputIterator semantics on copy.

llvm-svn: 146200
2011-12-08 22:50:09 +00:00
David Blaikie 421caa4278 Adding missing anchor to DATDeltaAlgorithm.
llvm-svn: 146025
2011-12-07 06:44:23 +00:00
Nick Lewycky 897a57ecda Silence tsan false-positives (tsan can't track things which are only safe due to
memory fences) in statistics registration, which works the same way that
ManagedStatic registration does.

llvm-svn: 145869
2011-12-05 23:07:05 +00:00
David Blaikie 54c9462c77 Fix unreachable return & simplify some branches.
llvm-svn: 145627
2011-12-01 20:58:30 +00:00
Benjamin Kramer 3ced545ccf Autodetect bulldozers.
llvm-svn: 145607
2011-12-01 18:24:17 +00:00
David Blaikie 3a15e14520 Add some missing anchors.
llvm-svn: 145578
2011-12-01 08:00:17 +00:00
NAKAMURA Takumi 64404a3b2c [Win32] Catch exceptions (eg. segfault) on waiting for invoked clang from the driver.
clang/lib/Driver/Driver.cpp: Don't pass through negative exit status, or parent would be confused.

llvm::sys::Program::Wait(): Suppose 0x8000XXXX and 0xC000XXXX as abnormal exit code and pass it as negative value.

Win32 Exception Handler: Exit with ExceptionCode on an unhandle exception.

llvm-svn: 145389
2011-11-29 07:47:04 +00:00
Nick Lewycky 76c6299f88 Don't define these unless we plan to use them.
llvm-svn: 145289
2011-11-28 22:14:02 +00:00
Eli Friedman 31f0116173 Add back a line I deleted by accident in r145141. Fixes uninitialized variable warnings and runtime failures.
llvm-svn: 145256
2011-11-28 18:50:37 +00:00
Dylan Noblesmith efddf20126 rename ENABLE_THREADS to LLVM_ENABLE_THREADS
Now that it needs to be exported in a public header (Valgrind.h)
it should be prefixed to avoid collision with other projects.
Add it to llvm-config.h as well.

This'll require regenerating the configure script after this
commit, but I don't have the required autoconf version.

llvm-svn: 145214
2011-11-28 00:48:58 +00:00
Eli Friedman a84ad7d0d0 Fix APFloat::convert so that it handles narrowing conversions correctly; it
was returning incorrect values in rare cases, and incorrectly marking
exact conversions as inexact in some more common cases. Fixes PR11406, and a
missed optimization in test/CodeGen/X86/fp-stack-O0.ll.

llvm-svn: 145141
2011-11-26 03:38:02 +00:00
Benjamin Kramer 6709e05012 Make ConstantRange::truncate a bit more efficient.
llvm-svn: 145122
2011-11-24 17:24:33 +00:00
Richard Smith 4f9a8081c3 Correctly byte-swap APInts with bit-widths greater than 64.
llvm-svn: 145111
2011-11-23 21:33:37 +00:00
Benjamin Kramer e1effb0da2 Add configure checking for pread(2) and use it to save a syscall when reading files.
llvm-svn: 145061
2011-11-22 12:31:53 +00:00
Benjamin Kramer f22623b78b Turn error recovery into an assert.
This was put in because in a certain version of DragonFlyBSD stat(2) lied about the
size of some files. This was fixed a long time ago so we can remove the workaround.

llvm-svn: 145059
2011-11-22 11:37:11 +00:00
Nick Lewycky 6804d27048 Move WEAK marking to the declaration.
llvm-svn: 144603
2011-11-15 01:23:22 +00:00
Nick Lewycky b2489b7484 Fix linking for some users who already have tsan enabled code and are trying to
link it against llvm code, by making our definitions weak. "Some users."

llvm-svn: 144596
2011-11-15 00:14:04 +00:00
Nick Lewycky fe856110aa Add support for tsan annotations (thread sanitizer, a valgrind-based tool).
These annotations are disabled entirely when either ENABLE_THREADS is off, or
building a release build. When enabled, they add calls to functions with no
statements to ManagedStatic's getters.

Use these annotations to inform tsan that the race used inside ManagedStatic
initialization is actually benign. Thanks to Kostya Serebryany for helping
write this patch!

llvm-svn: 144567
2011-11-14 20:50:16 +00:00
Benjamin Kramer e3b94d1b55 Fix a typo.
llvm-svn: 143890
2011-11-06 20:36:50 +00:00
Daniel Dunbar 3fa528d67c ADT/StringRef: Add ::lower() and ::upper() methods.
llvm-svn: 143880
2011-11-06 18:04:43 +00:00
Peter Collingbourne bf025fdb54 Return only the least significant 8 bits of the exit status from
Process::Wait on Windows (mimicing POSIX behaviour).

llvm-svn: 143876
2011-11-06 16:45:46 +00:00
Benjamin Kramer f3da529028 Add more PRI.64 macros for MSVC and use them throughout the codebase.
llvm-svn: 143799
2011-11-05 08:57:40 +00:00
Daniel Dunbar bf9bba47a1 build: Add initial cut at LLVMBuild.txt files.
llvm-svn: 143634
2011-11-03 18:53:17 +00:00
Sebastian Pop 94441fbad7 rename getHostTriple into getDefaultTargetTriple
llvm-svn: 143502
2011-11-01 21:32:20 +00:00
Sebastian Pop ec2fb226d8 rename LLVM_HOSTTRIPLE into LLVM_DEFAULT_TARGET_TRIPLE
llvm-svn: 143501
2011-11-01 21:31:44 +00:00
Eli Friedman 39df70c33a Remove a couple unused methods. PR11201.
llvm-svn: 143452
2011-11-01 05:11:01 +00:00
Dan Gohman 4c9fca99c9 Remove the Alpha backend.
llvm-svn: 143164
2011-10-27 22:56:32 +00:00
Benjamin Kramer 2aed4393b8 BlockFrequency: Use a smarter overflow check.
This trades one 64 bit div for one 64 bit mul and some arithmetic.

llvm-svn: 143106
2011-10-27 16:38:50 +00:00
Dan Gohman b43c36f391 Remove the Blackfin backend.
llvm-svn: 142880
2011-10-25 00:05:42 +00:00
Dan Gohman dfc96aea90 Remove the SystemZ backend.
llvm-svn: 142878
2011-10-24 23:48:32 +00:00
NAKAMURA Takumi 66c9e4ffd5 Windows/Path.inc: [PR8460] Get rid of ScopedNullTerminator. Thanks to Zvi Rackover!
llvm-svn: 142785
2011-10-24 03:27:19 +00:00
Benjamin Kramer cc0ed6ba04 Print branch probabilities as percentages.
50% is much more readable than 5.000000e-01.

llvm-svn: 142752
2011-10-23 11:32:54 +00:00
Benjamin Kramer 929f53f65c Add compare operators to BranchProbability and use it to determine if an edge is hot.
llvm-svn: 142751
2011-10-23 11:19:14 +00:00
Anton Korobeynikov b27f11e01d Fix build on mingw-w64.
Patch by Ruben Van Boxem!

llvm-svn: 142646
2011-10-21 09:38:50 +00:00
David Meyer a93b4bc98c Remove unused include of sys/uio.h in MemoryBuffer.cpp. It was not correctly protected by ifdef either.
llvm-svn: 142623
2011-10-20 21:57:46 +00:00
Benjamin Kramer e664de33b1 Fix handling of the From parameter in StringRef::find.
Enable bounds checking to catch this kind of bug earlier.

llvm-svn: 142247
2011-10-17 20:49:40 +00:00
Benjamin Kramer cc863b2bb6 Let printf do the formatting instead aligning strings ourselves.
While at it, merge some format strings.

llvm-svn: 142140
2011-10-16 16:30:34 +00:00
Chris Lattner 7284526aff remove the dead 'ShowLine' argument from SMDiagnostic.
llvm-svn: 142108
2011-10-16 05:47:55 +00:00
Chris Lattner 03b80a4027 Make SMDiagnostic a little more sane. Instead of passing around note/warning/error as a
string, pass it around as an enum.

llvm-svn: 142107
2011-10-16 05:43:57 +00:00
Chris Lattner a3a0681083 Enhance llvm::SourceMgr to support diagnostic ranges, the same way clang does. Enhance
the X86 asmparser to produce ranges in the one case that was annoying me, for example:

test.s:10:15: error: invalid operand for instruction
movl 0(%rax), 0(%edx)
              ^~~~~~~

It should be straight-forward to enhance filecheck, tblgen, and/or the .ll parser to use 
ranges where appropriate if someone is interested.

llvm-svn: 142106
2011-10-16 04:47:35 +00:00