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

1292 Commits

Author SHA1 Message Date
Eric Christopher
b70795bbfd Fix copy and pasto with CMake files for unittest.
llvm-svn: 189863
2013-09-03 22:08:28 +00:00
Eric Christopher
9bd85fb4ef Add a hashing routine that handles hashing types. Add a test for
hashing the contents of DW_FORM_data1 on top of a type with attributes.

llvm-svn: 189862
2013-09-03 21:57:57 +00:00
Eric Christopher
8d0a520dc2 Alphabetize.
llvm-svn: 189848
2013-09-03 20:51:14 +00:00
Joerg Sonnenberger
d6a76ffd81 Add a Python-like join function to merge a list of strings with a
separator between each two elements.

llvm-svn: 189846
2013-09-03 20:43:54 +00:00
Eli Friedman
bb860a63ef Change default # of digits for APFloat::toString
This is a re-commit of r189442; I'll follow up with clang changes.

The previous default was almost, but not quite enough digits to
represent a floating-point value in a manner which preserves the
representation when it's read back in.  The larger default is much
less confusing.

I spent some time looking into printing exactly the right number of
digits if a precision isn't specified, but it's kind of complicated,
and I'm not really sure I understand what APFloat::toString is supposed
to output for FormatPrecision != 0 (or maybe the current API specification
is just silly, not sure which).  I have a WIP patch if anyone is interested.

llvm-svn: 189624
2013-08-29 23:44:34 +00:00
Rui Ueyama
3ab487af0b Option parsing: support case-insensitive option matching.
Re-submitting r189416 with fix for Windows build on where strcasecmp is not defined.

llvm-svn: 189501
2013-08-28 20:04:31 +00:00
Ted Kremenek
16beb74d93 Revert r189442 "Change default # of digits for APFloat::toString"
This is breaking numerous Clang tests on the buildbot.

llvm-svn: 189447
2013-08-28 06:21:46 +00:00
Eli Friedman
75cdc76b2b Change default # of digits for APFloat::toString
The previous default was almost, but not quite enough digits to
represent a floating-point value in a manner which preserves the
representation when it's read back in.  The larger default is much
less confusing.

I spent some time looking into printing exactly the right number of
digits if a precision isn't specified, but it's kind of complicated,
and I'm not really sure I understand what APFloat::toString is supposed
to output for FormatPrecision != 0 (or maybe the current API specification
is just silly, not sure which).  I have a WIP patch if anyone is interested.

llvm-svn: 189442
2013-08-28 05:23:51 +00:00
Rui Ueyama
16ae963b6a Revert "Option parsing: support case-insensitive option matching." as it broke Windows buildbot.
This reverts r189416.

llvm-svn: 189424
2013-08-28 00:02:06 +00:00
Rui Ueyama
a9f9cbaaf6 Option parsing: support case-insensitive option matching.
Link.exe's command line options are case-insensitive. This patch
adds a new attribute to OptTable to let the option parser to compare
options, ignoring case.

Command lines are generally case-insensitive on Windows. CL.exe is an
exception. So this new attribute should be useful for other commands
running on Windows.

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

llvm-svn: 189416
2013-08-27 23:47:01 +00:00
NAKAMURA Takumi
6c13dfe866 [Win32] mapped_file_region: Fix a bug in CreateFileMapping() that Size must contain Offset when Offset >= 65536.
llvm-svn: 189021
2013-08-22 15:14:53 +00:00
NAKAMURA Takumi
5915576b5b Whitespace.
llvm-svn: 189020
2013-08-22 15:14:45 +00:00
NAKAMURA Takumi
515692fc0a Suppress MemoryBufferTest.cpp on win32 for now. Investigating.
llvm-svn: 189001
2013-08-22 12:00:44 +00:00
NAKAMURA Takumi
26b76a4a44 MemoryBufferTest.cpp: Tweak offset corresponding to the case that PageSize is greater than 8000.
PageSize, aka AllocationGranularity, is 65536 on Win32 (and Cygwin).

llvm-svn: 188999
2013-08-22 10:23:58 +00:00
David Blaikie
29dad430cd Basic unit tests for PointerUnion
llvm-svn: 188933
2013-08-21 21:30:23 +00:00
Peter Collingbourne
aa48e92de9 Introduce SpecialCaseList::isIn overload for GlobalAliases.
Differential Revision: http://llvm-reviews.chandlerc.com/D1437

llvm-svn: 188688
2013-08-19 19:00:35 +00:00
Peter Collingbourne
ea402298e2 Remove SpecialCaseList::findCategory.
It turned out that I didn't need this for DFSan.

llvm-svn: 188646
2013-08-19 00:24:20 +00:00
Aaron Ballman
73cc6d0b07 Removing a spurious semi-colon; this macro expands into a namespace.
llvm-svn: 188525
2013-08-16 01:53:58 +00:00
Aaron Ballman
ead5a4d04b Tighten up the yamilizer so it stops eliding empty sequences if the embedded empty sequence is the first key/value in a map which is itself in a sequence.
Patch with help from Nick Kledzik.

llvm-svn: 188508
2013-08-15 23:17:53 +00:00
Alexey Samsonov
235b9a341c Expose CRC-32 implementation from zlib
llvm-svn: 188380
2013-08-14 16:03:29 +00:00
Hans Wennborg
581964696d Options: explicit handling of --
Clients of the option parsing library should handle it explicitly
using a KIND_REMAINING_ARGS option.

Clang and lld have been updated in r188316 and r188318, respectively.

Also fix -Wsign-compare warning in the option parsing test.

llvm-svn: 188323
2013-08-13 22:23:05 +00:00
Hans Wennborg
714e82ffc5 Options: Add new option kind that consumes remaining arguments
This adds KIND_REMAINING_ARGS, a class of options that consume
all remaining arguments on the command line.

This will be used to support /link in clang-cl, which is used
to forward all remaining arguments to the linker.

It also allows us to remove the hard-coded handling of "--",
allowing clients (clang and lld) to implement that functionality
themselves with this new option class.

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

llvm-svn: 188314
2013-08-13 21:09:50 +00:00
Nick Lewycky
ce26d6b8d0 Fix an oversight in isPotentiallyReachable where we wouldn't do any CFG-walking
to find loops if the From and To instructions were in the same block.

Refactor the code a little now that we need to fill to start the CFG-walking
algorithm with more than one starting basic block sometimes.

Special thanks to Andrew Trick for catching an error in my understanding of
natural loops in code review.

llvm-svn: 188236
2013-08-13 00:03:47 +00:00
Tareq A. Siraj
135d71f85d Fixes a bug when iterating on paths
This fixes the incorrect implementation of iterating on file/directory
paths.

Differential Review: http://llvm-reviews.chandlerc.com/D1277

llvm-svn: 188183
2013-08-12 17:10:49 +00:00
Alexey Samsonov
92dd689c77 Relax conditions of test added in r188156 to fix it on Windows
llvm-svn: 188157
2013-08-12 09:04:58 +00:00
Alexey Samsonov
d27061d7e7 Introduce factory methods for SpecialCaseList
Summary:
Doing work in constructors is bad: this change suggests to
call SpecialCaseList::create(Path, Error) instead of
"new SpecialCaseList(Path)". Currently the latter may crash with
report_fatal_error, which is undesirable - sometimes we want to report
the error to user gracefully - for example, if he provides an incorrect
file as an argument of Clang's -fsanitize-blacklist flag.

Reviewers: pcc

Reviewed By: pcc

CC: llvm-commits

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

llvm-svn: 188156
2013-08-12 07:49:36 +00:00
Alexey Samsonov
1021d4d06d Fix off-by-one error in Regex::isValid
llvm-svn: 187992
2013-08-08 17:32:45 +00:00
Benjamin Kramer
ef710e7620 Use EXPECT_TRUE/EXPECT_FALSE to avoid bogus warnings from the guts of gtest.
llvm-svn: 187976
2013-08-08 11:17:39 +00:00
Alexander Kornienko
8030dee9b6 Changed isPrint for U+00AD SOFT HYPHEN to return true.
Summary:
This is consistent with MacOSX implementation, and most terminals
actually display this character (checked on gnome-terminal, lxterminal, lxterm,
Terminal.app, iterm2). Actually, this is in line with the ISO Latin 1 standard
(ISO 8859-1), which defines it differently from the Unicode Standard. More
information here: http://www.cs.tut.fi/~jkorpela/shy.html

Reviewers: gribozavr, jordan_rose

CC: llvm-commits

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

llvm-svn: 187949
2013-08-08 01:10:50 +00:00
Alexander Kornienko
220f2326c6 Disabled columnWidth test for OSX, need someone with Mac to deal with this effectively.
llvm-svn: 187848
2013-08-07 02:08:31 +00:00
Alexander Kornienko
7963f834a9 Use correct platform detection macro: __MACOSX__ -> __APPLE__
llvm-svn: 187847
2013-08-07 01:23:28 +00:00
Reid Kleckner
6f129a9240 Fix boolean logic in LockFileManager and test it
This fixes a bug from r187826.

Reviewers: hans

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

llvm-svn: 187846
2013-08-07 01:22:04 +00:00
Alexander Kornienko
7cc4e92aef Disable tests on WIN32 (which has incorrect implementation of isPrint and
columnWidth), and partially disable tests on MACOSX (which handles some
characters differently).

llvm-svn: 187842
2013-08-07 00:41:18 +00:00
Alexander Kornienko
340c08d4fe Implemented llvm::sys::locale::columnWidth and isPrint for the case of generic UTF8-capable terminal.
Summary:
This is a second attempt to get this right. After reading the Unicode
Standard I came up with the code that uses definitions of "printable" and
"column width" more suitable for terminal output (i.e. fixed-width fonts and
special treatment of many control characters).
The implementation here can probably be used for Windows and MacOS if someone
can test it properly.
The patch addresses PR14910.

Reviewers: jordan_rose, gribozavr

CC: llvm-commits

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

llvm-svn: 187837
2013-08-07 00:07:07 +00:00
Peter Collingbourne
8df077ca5e Introduce Regex::isLiteralERE function.
This will be used to implement an optimisation for literal entries
in special case lists.

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

llvm-svn: 187731
2013-08-05 17:47:59 +00:00
Peter Collingbourne
6ee348574a Make one of the AttributeSet ctors maintain the invariant that the
attribute list is ordered by index.

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

llvm-svn: 187682
2013-08-02 22:29:40 +00:00
Hans Wennborg
749f8bc956 Option parsing: recognize the special -- token
Everything that comes after -- should be treated as a filename. This
enables passing in filenames that would otherwise be conflated with
command-line options.

This is especially important for clang-cl which supports options
starting with /, which are easily conflatable with Unix-style
path names.

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

llvm-svn: 187675
2013-08-02 21:20:27 +00:00
Sean Silva
34ac6fd42a Update incorrect file headers.
One of these was spotted in review by Rafael.

llvm-svn: 187598
2013-08-01 18:42:28 +00:00
Hans Wennborg
9c475c6d9d Option parsing: remove non-SUPPORT_ALIASARGS fall-back
The clients of this code have been updated to all support AliasArgs.

This depends on Clang r187538 and lld r187541.

llvm-svn: 187546
2013-07-31 23:28:51 +00:00
Hans Wennborg
ad911dcfea Option parsing: add support for alias arguments.
This makes option aliases more powerful by enabling them to
pass along arguments to the option they're aliasing.

For example, if we have a joined option "-foo=", we can now
specify a flag option "-bar" to be an alias of that, with the
argument "baz".

This is especially useful for the cl.exe compatible clang driver,
where many options are aliases. For example, this patch enables
us to alias "/Ox" to "-O3" (-O is a joined option), and "/WX" to
"-Werror" (again, -W is a joined option).

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

llvm-svn: 187537
2013-07-31 22:44:41 +00:00
Matt Arsenault
c8e1c3d111 Fix ptr vector inconsistency in CreatePointerCast
One form would accept a vector of pointers, and the other did not.
Make both accept vectors of pointers, and add an assertion
for the number of elements.

llvm-svn: 187464
2013-07-31 00:17:33 +00:00
Rafael Espindola
553f85ed4b Fix windows' implementation of status when a file doesn't exist.
The unix one was returning no_such_file_or_directory, but the windows one
was return success.

Update the one one caller that was depending on the old behavior.

llvm-svn: 187463
2013-07-31 00:10:25 +00:00
Matt Arsenault
07681f54ed Respect address space sizes in isEliminableCastPair.
This avoids constant folding bitcast/ptrtoint/inttoptr combinations
that have illegal bitcasts between differently sized address spaces.

llvm-svn: 187455
2013-07-30 22:27:10 +00:00
Matt Arsenault
f58e03599f Revert "Remove isCastable since nothing uses it now"
Apparently dragonegg uses it.

llvm-svn: 187454
2013-07-30 22:02:14 +00:00
Matt Arsenault
2121a49954 Remove isCastable since nothing uses it now
llvm-svn: 187448
2013-07-30 21:11:17 +00:00
Matt Arsenault
c825ddd4ca Change behavior of calling bitcasted alias functions.
It will now only convert the arguments / return value and call
the underlying function if the types are able to be bitcasted.
This avoids using fp<->int conversions that would occur before.

llvm-svn: 187444
2013-07-30 20:45:05 +00:00
Rafael Espindola
0de5f81e03 Implement getUniqueID for directories on windows.
llvm-svn: 187441
2013-07-30 20:25:53 +00:00
Rui Ueyama
4c06308b07 Implement TokenizeWindowsCommandLine.
This is a follow up patch for r187390 to implement the parser for the
Windows-style command line. This should follow the rule as described
at http://msdn.microsoft.com/en-us/library/windows/desktop/17w5ykft(v=vs.85).aspx

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

llvm-svn: 187430
2013-07-30 19:03:20 +00:00
Rafael Espindola
2bf7932f99 Include st_dev to make the result of getUniqueID actually unique.
This will let us use getUniqueID instead of st_dev directly on clang.

llvm-svn: 187378
2013-07-29 21:26:49 +00:00
Michael Gottesman
f899e8827f [APFloat] Make all arithmetic operations with NaN produce positive NaNs.
IEEE-754R 1.4 Exclusions states that IEEE-754R does not specify the
interpretation of the sign of NaNs. In order to remove an irrelevant
variable that most floating point implementations do not use,
standardize add, sub, mul, div, mod so that operating anything with
NaN always yields a positive NaN.

In a later commit I am going to update the APIs for creating NaNs so
that one can not even create a negative NaN.

llvm-svn: 187314
2013-07-27 21:49:25 +00:00
Nick Lewycky
5cf284ba76 Update this CMakeLists.txt for r187283 too.
llvm-svn: 187286
2013-07-27 01:26:30 +00:00
Nick Lewycky
3d5df03884 Reimplement isPotentiallyReachable to make nocapture deduction much stronger.
Adds unit tests for it too.

Split BasicBlockUtils into an analysis-half and a transforms-half, and put the
analysis bits into a new Analysis/CFG.{h,cpp}. Promote isPotentiallyReachable
into llvm::isPotentiallyReachable and move it into Analysis/CFG.

llvm-svn: 187283
2013-07-27 01:24:00 +00:00
Rafael Espindola
326babb234 Revert "[PowerPC] Improve consistency in use of __ppc__, __powerpc__, etc."
This reverts commit r187248. It broke many bots.

llvm-svn: 187254
2013-07-26 22:13:57 +00:00
Bill Schmidt
149eda1b1e [PowerPC] Improve consistency in use of __ppc__, __powerpc__, etc.
Both GCC and LLVM will implicitly define __ppc__ and __powerpc__ for
all PowerPC targets, whether 32- or 64-bit.  They will both implicitly
define __ppc64__ and __powerpc64__ for 64-bit PowerPC targets, and not
for 32-bit targets.  We cannot be sure that all other possible
compilers used to compile Clang/LLVM define both __ppc__ and
__powerpc__, for example, so it is best to check for both when relying
on either inside the Clang/LLVM code base.

This patch makes sure we always check for both variants.  In addition,
it fixes one unnecessary check in lib/Target/PowerPC/PPCJITInfo.cpp.
(At least one of __ppc__ and __powerpc__ should always be defined when
compiling for a PowerPC target, no matter which compiler is used, so
testing for them is unnecessary.)

There are some places in the compiler that check for other variants,
like __POWERPC__ and _POWER, and I have left those in place.  There is
no need to add them elsewhere.  This seems to be in Apple-specific
code, and I won't take a chance on breaking it.

There is no intended change in behavior; thus, no test cases are
added.

llvm-svn: 187248
2013-07-26 21:39:15 +00:00
Rafael Espindola
28c7549697 Don't end a file name with a dot. It looks odd.
llvm-svn: 187124
2013-07-25 15:00:17 +00:00
Akira Hatanaka
69d1c115db [mips] Use pristine object file while processing relocations.
Similar to ARM change r182800, dynamic linker will read bits/addends from
    the original object rather than from the object that might have been patched
    previously. For the purpose of relocations for MCJIT stubs on MIPS, we
    internally use otherwise unused MIPS relocations.
    
    The change also enables MCJIT unit tests for MIPS (EL/BE), and the following
    two tests now pass:
    
    - MCJITTest.return_global and
    - MCJITTest.multiple_functions.
    
    These issues have been tracked as Bug 16250.

    Patch by Petar Jovanovic.

llvm-svn: 187019
2013-07-24 01:58:40 +00:00
Eli Bendersky
3cde6ffa64 Refactor the unit test for MemoryBuffer::getOpenFileSlice
Run in two different modes: with and without reopening the temporary file
between creating it and mapping it with MemoryBuffer.

llvm-svn: 186986
2013-07-23 20:58:51 +00:00
Rafael Espindola
f3a9f67eee Split getOpenFile into getOpenFile and getOpenFileSlice.
The main observation is that we never need both the filesize and the map size.
When mapping a slice of a file, it doesn't make sense to request a null
terminator and that would be the only case where the filesize would be used.

There are other cleanups that should be done in this area:

* A client should not have to pass the size (even an explicit -1) to say if
  it wants a null terminator or not, so we should probably swap the argument
  order.
* The default should be to not require a null terminator. Very few clients
  require this, but many end up asking for it just because it is the default.

llvm-svn: 186984
2013-07-23 20:25:01 +00:00
Eli Bendersky
44a6964953 Add a simple unit test for MemoryBuffer::getOpenFile
llvm-svn: 186887
2013-07-22 22:46:21 +00:00
Hans Wennborg
0eedbce23d Option parsing: allow aliases in groups
Option aliases in option groups were previously disallowed by an assert.
As far as I can tell, there was no technical reason for this, and I would
like to be able to put cl.exe compatible options in their own group for Clang,
so let's change the assert.

llvm-svn: 186838
2013-07-22 16:18:13 +00:00
Hans Wennborg
0bea6b44c7 Add Option unit tests to the make build
Previously, they were only built and run in the CMake build.

llvm-svn: 186756
2013-07-20 03:04:36 +00:00
Reid Kleckner
d00a7da89a Add some flag exclusion tests.
llvm-svn: 186704
2013-07-19 18:05:13 +00:00
Rafael Espindola
949820eabd Add a unit test for checking that we respect the F_Binary flag.
llvm-svn: 186676
2013-07-19 14:41:25 +00:00
Reid Kleckner
c1af8a0511 [Support] Beef up and expose the response file parsing in llvm::cl
The plan is to use it for clang and lld.

Major behavior changes:
- We can now parse UTF-16 files that have a byte order mark.
- PR16209: Don't drop backslashes on the floor if they don't escape
  anything.

The actual parsing loop was based on code from Clang's driver.cpp,
although it's been rewritten to track its state with control flow rather
than state variables.

Reviewers: hans

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

llvm-svn: 186587
2013-07-18 16:52:05 +00:00
Rafael Espindola
d5796b9a12 Remove dead code.
llvm-svn: 186561
2013-07-18 03:29:51 +00:00
Rafael Espindola
9e2da8f46a Fix a regression I introduced back in r178147.
We don't want cast and dyn_cast to work on temporaries. They don't extend
lifetime like a direct bind to a reference would, so they can introduce
hard to find bugs.

I added tests to make sure we don't regress this. Thanks to Eli Friedman for
noticing this and for his suggestions on how to test it.

llvm-svn: 186559
2013-07-18 02:42:40 +00:00
Eli Friedman
d18dd0a7b0 Handle '.' correctly in hex float literal parsing.
There were a couple of different loops that were not handling
'.' correctly in APFloat::convertFromHexadecimalString; these mistakes
could lead to assertion failures and incorrect rounding for overlong
hex float literals.

Fixes PR16643.

llvm-svn: 186539
2013-07-17 22:17:29 +00:00
Rafael Espindola
2a9326a78f Add a wrapper for open.
This centralizes the handling of O_BINARY and opens the way for hiding more
differences (like how open behaves with directories).

llvm-svn: 186447
2013-07-16 19:44:17 +00:00
Peter Collingbourne
82d932d6c2 Make SpecialCaseList match full strings, as documented, using anchors.
Differential Revision: http://llvm-reviews.chandlerc.com/D1149

llvm-svn: 186431
2013-07-16 17:56:07 +00:00
Reid Kleckner
362d3541d3 [Support] Add a Unicode conversion wrapper from UTF16 to UTF8
This is to support parsing UTF16 response files in LLVM/lib/Option for
lld and clang.

Reviewers: hans

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

llvm-svn: 186426
2013-07-16 17:14:33 +00:00
NAKAMURA Takumi
146b5ba105 unittests/Support: Add TimeValue.Win32FILETIME, corresponding to r186374.
llvm-svn: 186375
2013-07-16 02:44:23 +00:00
NAKAMURA Takumi
a97dcc8354 Rename Support.TimeValue to TimeValue.time_t in unittests/Support.
llvm-svn: 186372
2013-07-16 02:03:32 +00:00
Stephen Lin
ece45b5ee9 Convert Windows to Unix line endings, no functionality change.
llvm-svn: 186264
2013-07-13 22:08:55 +00:00
Rafael Espindola
3a35f99e5a Attempt at fixing a mingw bot.
It is failing with

YAMLTest.cpp:38:   instantiated from here
YAMLTraits.h:226: error: 'llvm::yaml::MappingTraits<<unnamed>::BinaryHolder>::mapping' is not a valid template argument for type 'void (*)(llvm::yaml::IO&, <unnamed>::BinaryHolder&)' because function 'static void llvm::yaml::MappingTraits<<unnamed>::BinaryHolder>::mapping(llvm::yaml::IO&, <unnamed>::BinaryHolder&)' has not external linkage

llvm-svn: 186245
2013-07-13 12:36:30 +00:00
Benjamin Kramer
5d304115ca Sync SmallBitVector with BitVector. Add unit tests for the missing methods.
llvm-svn: 186123
2013-07-11 21:59:16 +00:00
Peter Collingbourne
16d8086f72 Implement categories for special case lists.
A special case list can now specify categories for specific globals,
which can be used to instruct an instrumentation pass to treat certain
functions or global variables in a specific way, such as by omitting
certain aspects of instrumentation while keeping others, or informing
the instrumentation pass that a specific uninstrumentable function
has certain semantics, thus allowing the pass to instrument callers
according to those semantics.

For example, AddressSanitizer now uses the "init" category instead of
global-init prefixes for globals whose initializers should not be
instrumented, but which in all other respects should be instrumented.

The motivating use case is DataFlowSanitizer, which will have a
number of different categories for uninstrumentable functions, such
as "functional" which specifies that a function has pure functional
semantics, or "discard" which indicates that a function's return
value should not be labelled.

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

llvm-svn: 185978
2013-07-09 22:03:17 +00:00
Peter Collingbourne
87165fe6e5 Add some SpecialCaseList unit tests.
Differential Revision: http://llvm-reviews.chandlerc.com/D1091

llvm-svn: 185977
2013-07-09 22:03:12 +00:00
Sean Silva
dbfeeb71d5 Make BinaryRef output correctly in case of empty data.
Previously, it would simply output nothing, but it should output an
empty string `""`.

llvm-svn: 185894
2013-07-09 00:54:46 +00:00
Rafael Espindola
fc25f0c6cf We now always create files with the correct permissions. Simplify the interface.
llvm-svn: 185834
2013-07-08 16:42:01 +00:00
Rafael Espindola
9afbde4cba Fix windows build.
llvm-svn: 185730
2013-07-05 22:32:33 +00:00
Rafael Espindola
d6fa9469ca Use sys::fs::createTemporaryFile.
llvm-svn: 185719
2013-07-05 20:14:52 +00:00
Craig Topper
783617eba7 Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size.
llvm-svn: 185606
2013-07-04 01:31:24 +00:00
David Blaikie
c69f695988 Fix -Wsign-compare warning and remove windows-style line endings introduced by r185421
llvm-svn: 185443
2013-07-02 16:48:10 +00:00
Elena Demikhovsky
a6f1ca6a6f Fixed alignment of code sections in the JIT mode. Added a test to the JITMemoryManager.
llvm-svn: 185421
2013-07-02 12:24:22 +00:00
Michael Gottesman
b399188af0 [APFloat] Ensure that we can properly parse strings that do not have null terminators.
rdar://14323230

llvm-svn: 185397
2013-07-01 23:54:08 +00:00
Matt Arsenault
5b3f0a05c2 Fix copypaste error in test.
Thename says it's an i32*, but it was actually creating another i8*

llvm-svn: 185239
2013-06-28 23:24:10 +00:00
Daniel Malea
8f769455dc Replace UNIXy path with os-independent one in DebugIR unit test
- should resolve windows buildbot failure

llvm-svn: 185232
2013-06-28 22:17:57 +00:00
Jakob Stoklund Olesen
e4b031bd1a Fix a bad overflow check pointed out by Ben.
llvm-svn: 185226
2013-06-28 21:51:18 +00:00
Daniel Malea
e29c3e7e3d Fix Windows/Darwin build error in DebugIR unit tests
- mistakenly used get_current_dir() linux function
- replaced with getcwd/_getcwd as appropriate for current platform

llvm-svn: 185225
2013-06-28 21:49:53 +00:00
Andrew Kaylor
89294db42d Revising the MCJIT ObjectCache interface to allow subclasses to avoid retaining references to returned objects
llvm-svn: 185221
2013-06-28 21:40:16 +00:00
Daniel Malea
f5547eb2d8 Adding tests for DebugIR pass
- lit tests verify that each line of input LLVM IR gets a !dbg node and a
  corresponding entry of metadata that contains the line number 
- unit tests verify that DebugIR works as advertised in the interface
- refactored some useful IR generation functionality from the MCJIT unit tests
  so it can be reused

llvm-svn: 185212
2013-06-28 20:37:20 +00:00
Jakob Stoklund Olesen
a9465b9413 Add a division operator to BlockFrequency.
Allow a BlockFrequency to be divided by a non-zero BranchProbability
with saturating arithmetic. This will be used to compute the frequency
of a loop header given the probability of leaving the loop.

Our long division algorithm already saturates on overflow, so that was a
freebie.

llvm-svn: 185184
2013-06-28 18:23:42 +00:00
Rafael Espindola
ac62522b9b Add a convenience createUniqueDirectory function.
There are a few valid situation where we care about the structure inside a
directory, but not about the directory itself. A simple example is for unit
testing directory traversal.

PathV1 had a function like this, add one to V2 and port existing users of the
created temp file and delete it hack to using it.

llvm-svn: 185059
2013-06-27 03:45:31 +00:00
Michael Gottesman
6fb80a527d [APFloat] Added unittest for APFloat.divide that checks special cases, result categories, and result statuses.
llvm-svn: 185050
2013-06-27 00:42:00 +00:00
Michael Gottesman
e83cdadda7 Removed two logging printf statements from the APFloat tests... = /.
llvm-svn: 185045
2013-06-27 00:00:45 +00:00
Michael Gottesman
34f626681a [APFloat] Added unittest for APFloat.multiply that checks special cases, result categories, and result status.
llvm-svn: 185044
2013-06-26 23:55:26 +00:00
Michael Gottesman
78c7b539c6 [APFloat] Added unittest for APFloat.subtract that checks special cases, result categories, and result status.
llvm-svn: 185043
2013-06-26 23:55:23 +00:00
Michael Gottesman
e1dcbcd7a2 [APFloat] Removed debugging cruft that snuck in.
llvm-svn: 184974
2013-06-26 17:59:36 +00:00
Rafael Espindola
50996b2c4d Remove unused includes.
llvm itself is now PathV1 clean.

llvm-svn: 184947
2013-06-26 13:54:34 +00:00
Rafael Espindola
07ffa7d08b Port GetMainExecutable over to PathV2.
I will remove the V1 version as soon as I change clang in the next commit.

llvm-svn: 184914
2013-06-26 05:01:35 +00:00
Michael Gottesman
85c75137ce [APFloat] Removed trailing whitespace from unittests.
llvm-svn: 184715
2013-06-24 09:58:09 +00:00
Michael Gottesman
69c24d2254 [APFloat] Added a large unittest for APFloat.add that checks that special values are computed correctly.
llvm-svn: 184714
2013-06-24 09:58:07 +00:00
Benjamin Kramer
30c35d5305 Revert "BlockFrequency: Saturate at 1 instead of 0 when multiplying a frequency with a branch probability."
This reverts commit r184584. Breaks PPC selfhost.

llvm-svn: 184590
2013-06-21 20:20:27 +00:00
Benjamin Kramer
3315e168ee BlockFrequency: Saturate at 1 instead of 0 when multiplying a frequency with a branch probability.
Zero is used by BlockFrequencyInfo as a special "don't know" value. It also
causes a sink for frequencies as you can't ever get off a zero frequency with
more multiplies.

This recovers a 10% regression on MultiSource/Benchmarks/7zip. A zero frequency
was propagated into an inner loop causing excessive spilling.

PR16402.

llvm-svn: 184584
2013-06-21 19:30:05 +00:00
Akira Hatanaka
28386f0db3 [mips] Remove Triple:mips from SupportedArchs in MCJIT unittests
MIPS does not handle multiple relocations correctly, so two tests from the
unittests are expected to fail. These are:
 - MCJITTest.return_global and
 - MCJITTest.multiple_functions.

Until the multiple relocations are fixed, XFAIL the MCJIT unittests for
MIPS. This issue is tracked as Bug 16250.

Patch by Petar Jovanovic.

llvm-svn: 184461
2013-06-20 20:33:06 +00:00
Michael Gottesman
5982da1002 [APFloat] Rename isIEEENormal => isNormal and remove old isNormal method.
The old isNormal is already functionally replaced by the method isFiniteNonZero
in r184350 and all references to said method were replaced in LLVM/clang in
r184356/134366.

llvm-svn: 184449
2013-06-20 18:34:38 +00:00
Michael Gottesman
c03c0f1f1b [APFloat] Fix typo in test so we actually test if we handle denormals.
llvm-svn: 184447
2013-06-20 18:25:16 +00:00
Rafael Espindola
dc37cdb22d Rename fs::GetUniqueID to fs::getUniqueID to match the style guide.
llvm-svn: 184431
2013-06-20 15:06:35 +00:00
Michael Gottesman
7af8cd5aad [APFloat] Changed APFloat::isNormal => APFloat::isFiniteNonZero for all tests in unittests.
I forgot to to do this in r184356. The only references were in APFloatTest.cpp.

llvm-svn: 184366
2013-06-19 21:53:45 +00:00
Aaron Ballman
406fa22a89 Modified the implementation of fs::GetUniqueID on Windows such that it actually finds a unique identifier for a file. Also adds unit tests for GetUniqueID.
llvm-svn: 184351
2013-06-19 21:03:50 +00:00
Michael Gottesman
c82a0b3e6d [APFloat] Added isFiniteNonZero predicate.
This is the first patch in a series of patches to rename isNormal =>
isFiniteNonZero and isIEEENormal => isNormal. In order to prevent careless
errors on my part the overall plan is:

1. Add the isFiniteNonZero predicate with tests. I can do this in a method
independent of isNormal. (This step is this patch).
2. Convert all references to isNormal with isFiniteNonZero. My plan is to
comment out isNormal locally and continually convert isNormal references =>
isFiniteNonZero until llvm/clang compiles.
3. Remove old isNormal and rename isIEEENormal to isNormal.
4. Look through all of said references from patch 2 and see if we can simplify
them by using the new isNormal.

llvm-svn: 184350
2013-06-19 21:00:17 +00:00
Bill Wendling
8d83852261 Add unit test to test a trivial verifier check.
llvm-svn: 184338
2013-06-19 19:26:44 +00:00
Rafael Espindola
ef0d0d8b0b Avoid using PathV1.h in Program.h.
llvm-svn: 183940
2013-06-13 20:25:38 +00:00
Rafael Espindola
5b921b1aa1 Remove the program class.
It was only used to implement ExecuteAndWait and ExecuteNoWait. Expose just
those two functions and make Execute and Wait implementations details.

llvm-svn: 183864
2013-06-12 20:58:35 +00:00
Rafael Espindola
191f66d683 Move PathV2.h to Path.h
Most clients have already been moved from Path V1 to V2. The ones using V1
now include PathV1.h explicitly.

llvm-svn: 183801
2013-06-11 22:21:28 +00:00
Aaron Ballman
8be7652e28 sys::process::get_id() now returns the process ID instead of a process handle on Windows. Patch thanks to Kim Gräsman!
llvm-svn: 183621
2013-06-08 20:29:03 +00:00
Benjamin Kramer
2fbc7287e4 BitVector: Do the right thing in all() when Size is a multiple of BITWORD_SIZE.
llvm-svn: 183525
2013-06-07 15:14:31 +00:00
Benjamin Kramer
5f752c703f Optimize BitVector::all().
llvm-svn: 183521
2013-06-07 14:14:38 +00:00
Michael Gottesman
b152f55b6e IEEE-754R 5.7.2 General Operations is* operations (except for isCanonical).
Specifically the following work was done:

1. If the operation was not implemented, I implemented it.

2. If the operation was already implemented, I just moved its location
in the APFloat header into the IEEE-754R 5.7.2 section. If the name was
incorrect, I put in a comment giving the true IEEE-754R name.

Also unittests have been added for all of the functions which did not
already have a unittest.

llvm-svn: 183179
2013-06-04 03:46:25 +00:00
Benjamin Kramer
36e2996805 Try to avoid "integer literal too big" warnings from older GCCs.
llvm-svn: 183081
2013-06-01 22:29:41 +00:00
Eric Christopher
67d642450e Add support for adding the contents of a StringRef to the MD5 hash.
llvm-svn: 183054
2013-05-31 22:34:56 +00:00
Eric Christopher
3b08ea0a4f Convert more unsigned char -> uint8_t.
llvm-svn: 183053
2013-05-31 22:34:52 +00:00
Michael Gottesman
cad66f5206 [APFloat] Added a unittest for APFloat::getZero.
llvm-svn: 183028
2013-05-31 18:43:34 +00:00
Rafael Espindola
bd67fd9669 Remove unused member.
llvm-svn: 182958
2013-05-30 20:19:35 +00:00
Michael Gottesman
2adb2144bb Implement IEEE-754R 2008 nextUp/nextDown functions in the guise of the function APFloat::next(bool nextDown).
rdar://13852078

llvm-svn: 182945
2013-05-30 18:07:13 +00:00
Eric Christopher
30048ba007 Add a comment and some tests including the NULL byte.
llvm-svn: 182900
2013-05-30 00:43:26 +00:00
Michael Gottesman
bff1b48095 Added a unittest for APFloat::getSmallestNormalized.
llvm-svn: 182897
2013-05-30 00:18:47 +00:00
Michael Gottesman
09f3ab01b8 Added code to the unittest for APFloat::getSmallest to double check that we consider the result to be denormal.
I additionally changed certain checks to use EXPECT_FALSE instead of a boolean
complement with EXPECT_TRUE.

llvm-svn: 182896
2013-05-30 00:18:44 +00:00
Michael Gottesman
7fceea7dae Add a unittest for APFloat::getSmallest.
llvm-svn: 182894
2013-05-29 23:58:29 +00:00
Michael Gottesman
2a51955f08 [APInt] Implement tcDecrement as a counterpart to tcIncrement. This is for use in APFloat IEEE-754R 2008 nextUp/nextDown function.
rdar://13852078

llvm-svn: 182801
2013-05-28 19:50:20 +00:00
Eric Christopher
fae8590f51 Add to testsuite.
llvm-svn: 182693
2013-05-24 23:20:16 +00:00
Eric Christopher
ad99dcf36c ArrayRef-ize MD5 and clean up a few variable names.
Add a stringize method to make dumping a bit easier, and add a testcase
exercising a few different paths.

llvm-svn: 182692
2013-05-24 23:08:17 +00:00
Michael J. Spencer
02fa6608fd [Support] Remove Count{Leading,Trailing}Zeros_{32,64}.
llvm-svn: 182690
2013-05-24 22:58:37 +00:00
Michael J. Spencer
f5ff6c7f54 [Support][MathExtras] Fix literal type issues.
llvm-svn: 182679
2013-05-24 22:19:05 +00:00
Michael J. Spencer
dbf83dd515 [Support] Add type generic bit utilities to MathExtras.h
llvm-svn: 182667
2013-05-24 20:29:47 +00:00
Filip Pizlo
26d10a1d63 Expose the RTDyldMemoryManager through the C API. This allows clients of
the C API to provide their own way of allocating JIT memory (both code 
and data) and finalizing memory permissions (page protections, cache 
flush).

llvm-svn: 182448
2013-05-22 02:46:43 +00:00
Filip Pizlo
40c1832484 Roll out r182407 and r182408 because they broke builds.
llvm-svn: 182409
2013-05-21 20:03:01 +00:00
Filip Pizlo
46c8b4222c Expose the RTDyldMemoryManager through the C API. This allows clients of
the C API to provide their own way of allocating JIT memory (both code 
and data) and finalizing memory permissions (page protections, cache 
flush).

llvm-svn: 182408
2013-05-21 20:00:56 +00:00
Ulrich Weigand
ec9f537092 Alternative fix for problem addressed in r182233
Revision r182233 partially reverted the change in r181200 to simplify
JIT unif test #ifdefs, because that change caused a link error on some
host operating systems where the export list requires the following
symbols to be defined:

 JITTest_AvailableExternallyFunction
 JITTest_AvailableExternallyGlobal

As discussed on the list, the commit reverts r182233 (and re-installs
the full r181200 change), and instead fixes the link problem by moving
those two symbols to the top of the file and unconditionally defining
them.

llvm-svn: 182367
2013-05-21 10:30:59 +00:00
Bob Wilson
de1f36eea4 Partially revert change in r181200 that tried to simplify JIT unit test #ifdefs.
The export list for this test requires the following symbols to be available:
  JITTest_AvailableExternallyFunction
  JITTest_AvailableExternallyGlobal
The change in r181200 commented them out, which caused the test to fail to
link, at least on Darwin. I have only reverted the change for arm, since I
can't test the other targets and since it sounds like that change was fixing
real problems for those other targets. It should be possible to rearrange the
code to keep those definitions outside the #ifdefs, but that should be done by
someone who can reproduce the problems that r181200 was trying to fix.

llvm-svn: 182233
2013-05-20 06:13:09 +00:00
Renato Golin
56e43f179a SubArch support in MCJIT unittest
llvm-svn: 182220
2013-05-19 20:10:10 +00:00
Tim Northover
04eba4a59a AArch64: enable MCJIT unittests
llvm-svn: 182217
2013-05-19 19:44:56 +00:00
David Tweed
ccbb603f31 Minor changes to the MCJITTest unittests to use the correct API for finalizing
the JIT object (including XFAIL an ARM test that now needs fixing). Also renames
internal function for consistency.

llvm-svn: 182085
2013-05-17 10:01:46 +00:00
David Blaikie
898763a097 Use only explicit bool conversion operators
BitVector/SmallBitVector::reference::operator bool remain implicit since
they model more exactly a bool, rather than something else that can be
boolean tested.

The most common (non-buggy) case are where such objects are used as
return expressions in bool-returning functions or as boolean function
arguments. In those cases I've used (& added if necessary) a named
function to provide the equivalent (or sometimes negative, depending on
convenient wording) test.

One behavior change (YAMLParser) was made, though no test case is
included as I'm not sure how to reach that code path. Essentially any
comparison of llvm::yaml::document_iterators would be invalid if neither
iterator was at the end.

This helped uncover a couple of bugs in Clang - test cases provided for
those in a separate commit along with similar changes to `operator bool`
instances in Clang.

llvm-svn: 181868
2013-05-15 07:36:59 +00:00
Filip Pizlo
585f35b5a0 SectionMemoryManager shouldn't be a JITMemoryManager. Previously, the
EngineBuilder interface required a JITMemoryManager even if it was being used 
to construct an MCJIT. But the MCJIT actually wants a RTDyldMemoryManager. 
Consequently, the SectionMemoryManager, which is meant for MCJIT, derived 
from the JITMemoryManager and then stubbed out a bunch of JITMemoryManager 
methods that weren't relevant to the MCJIT.

This patch fixes the situation: it teaches the EngineBuilder that 
RTDyldMemoryManager is a supertype of JITMemoryManager, and that it's 
appropriate to pass a RTDyldMemoryManager instead of a JITMemoryManager if 
we're using the MCJIT. This allows us to remove the stub methods from 
SectionMemoryManager, and make SectionMemoryManager a direct subtype of 
RTDyldMemoryManager.

llvm-svn: 181820
2013-05-14 19:29:00 +00:00
Duncan Sands
d4dd4dcf15 Get the unittests compiling when building with cmake and the setting
-DLLVM_ENABLE_THREADS=false.

llvm-svn: 181788
2013-05-14 13:29:16 +00:00
Shuxin Yang
e016d80534 Fix a bug that APFloat::fusedMultiplyAdd() mistakenly evaluate "14.5f * -14.5f + 225.0f" to 225.0f.
llvm-svn: 181715
2013-05-13 18:03:12 +00:00
Andrew Kaylor
50bcd67af6 Fix MCJITCAPITest.cpp unit test on Windows.
MCJIT on Windows requires an explicit target triple with "-elf" appended to generate objects in ELF format.  The common test framework was setting up this triple, but it wasn't passed to the C API in the test.

llvm-svn: 181614
2013-05-10 17:58:41 +00:00
Rafael Espindola
b0598a0361 Remove exception handling support from the old JIT.
llvm-svn: 181354
2013-05-07 20:53:59 +00:00
Andrew Trick
66c37e7321 Implemented public interface for modifying registered (not positional or sink options) command line options at runtime.
Patch by Dan Liew!

llvm-svn: 181254
2013-05-06 21:56:35 +00:00
Andrew Trick
7cf2347306 Support command line option categories.
Patch by Dan Liew!

llvm-svn: 181253
2013-05-06 21:56:23 +00:00
Ulrich Weigand
dbdc6e0306 [SystemZ] Set up JIT/MCJIT test cases
This patch adds the necessary configuration bits and #ifdef's to set up
the JIT/MCJIT test cases for SystemZ.  Like other recent targets, we do
fully support MCJIT, but do not support the old JIT at all.  Set up the
lit config files accordingly, and disable old-JIT unit tests.

Patch by Richard Sandiford.

llvm-svn: 181207
2013-05-06 16:21:50 +00:00
Ulrich Weigand
64a9e145f1 Simplify JIT unit test #ifdefs
Several platforms need to disable all old-JIT unit tests, since they only
support the new MCJIT.  This currently done via #ifdef'ing out those tests
in the ExecutionEngine/JIT/*.cpp files.  As those #ifdef's have grown
historically, we now have a number of repeated directives which -in total-
cover nearly the whole file, but leave a couple of helper functions out.
When building the tests with clang itself, those helper functions now
cause spurious "unused function" warnings.

To fix those warnings, and also to remove the duplicate #ifdef conditions
and make it easier to disable the tests for a new target, this patch
consolidates the #ifdefs into a single one per file, which covers all
the tests including all helper routines.

Tested on PowerPC and SystemZ.

llvm-svn: 181200
2013-05-06 16:10:35 +00:00
Arnold Schwaighofer
64ae7f79b0 Add missing PatternMatch.cpp to CMakeLists.txt
llvm-svn: 181147
2013-05-05 02:14:28 +00:00
Arnold Schwaighofer
83cedfffb0 PatternMatch: Matcher for (un)ordered floating point min/max
Add support for matching 'ordered' and 'unordered' floating point min/max
constructs.

In LLVM we can express min/max functions as a combination of compare and select.
We have support for matching such constructs for integers but not for floating
point. In floating point math there is no total order because of the presence of
'NaN'. Therefore, we have to be careful to preserve the original fcmp semantics
when interpreting floating point compare select combinations as a minimum or
maximum function. The resulting 'ordered/unordered' floating point maximum
function has to select the same value as the select/fcmp combination it is based
on.

 ordered_max(x,y)   = max(x,y) iff x and y are not NaN, y otherwise
 unordered_max(x,y) = max(x,y) iff x and y are not NaN, x otherwise
 ordered_min(x,y)   = min(x,y) iff x and y are not NaN, y otherwise
 unordered_min(x,y) = min(x,y) iff x and y are not NaN, x otherwise

This matches the behavior of the underlying select(fcmp(olt/ult/.., L, R), L, R)
construct.

Any code using this predicate has to preserve this semantics.

A follow-up patch will use this to implement floating point min/max reductions
in the vectorizer.

radar://13723044

llvm-svn: 181143
2013-05-05 01:54:46 +00:00
Filip Pizlo
9f6e32ea72 This exposes more MCJIT options via the C API:
CodeModel: It's now possible to create an MCJIT instance with any CodeModel you like.  Previously it was only possible to 
create an MCJIT that used CodeModel::JITDefault.

EnableFastISel: It's now possible to turn on the fast instruction selector.

The CodeModel option required some trickery.  The problem is that previously, we were ensuring future binary compatibility in 
the MCJITCompilerOptions by mandating that the user bzero's the options struct and passes the sizeof() that he saw; the 
bindings then bzero the remaining bits.  This works great but assumes that the bitwise zero equivalent of any field is a 
sensible default value.

But this is not the case for LLVMCodeModel, or its internal equivalent, llvm::CodeModel::Model.  In both of those, the default 
for a JIT is CodeModel::JITDefault (or LLVMCodeModelJITDefault), which is not bitwise zero.

Hence this change introduces LLVMInitializeMCJITCompilerOptions(), which will initialize the user's options struct with
defaults. The user will use this in the same way that they would have previously used memset() or bzero(). MCJITCAPITest.cpp
illustrates the change, as does the comment in ExecutionEngine.h.

llvm-svn: 180893
2013-05-01 22:58:00 +00:00
Filip Pizlo
a32d795d04 Wrap some lines to bring MCJITCAPITest into conformance with the 80 column limit.
llvm-svn: 180839
2013-05-01 06:46:59 +00:00
Reid Kleckner
1d971b9998 Try to fix ProgramTest on FreeBSD
This seemed like the cleanest way to find the test executable.  Also fix
the file mode.

llvm-svn: 180770
2013-04-30 04:30:41 +00:00
Andrew Kaylor
36788b2f65 Exposing MCJIT through C API
Re-submitting with fix for OCaml dependency problems (removing dependency on SectionMemoryManager when it isn't used).

Patch by Fili Pizlo

llvm-svn: 180720
2013-04-29 17:49:40 +00:00
Andrew Kaylor
b5c81265a9 Re-enabling MCJIT object caching with memory leak fixed
llvm-svn: 180575
2013-04-25 21:02:36 +00:00
Rafael Espindola
d89ddc118c Revert "Adding object caching support to MCJIT"
This reverts commit 07f03923137a91e3cca5d7fc075a22f8c9baf33a.

Looks like it broke the valgrind bot:

http://lab.llvm.org:8011/builders/llvm-x86_64-linux-vg_leak/builds/649

llvm-svn: 180249
2013-04-25 03:47:41 +00:00
Rafael Espindola
ec78b42518 Revert "Exposing MCJIT through C API"
This reverts commit 8c31b298149ca3c3f2bbd9e8aa9a01c4d91f3d74.

It looks like this commit broke some bots:

http://lab.llvm.org:8011/builders/llvm-ppc64-linux2/builds/5209

llvm-svn: 180248
2013-04-25 03:19:12 +00:00
Andrew Kaylor
57cfdd1d3d Exposing MCJIT through C API
Patch by Filip Pizlo

llvm-svn: 180229
2013-04-24 23:33:53 +00:00
Reid Kleckner
466affe6ec Don't forward declare environ on Windows
That seems to interact poorly with the environ and _environ macros
defined in MSVC's <stdlib.h>.

Also remove the incorrect comment about _NSGetEnviron().

llvm-svn: 180200
2013-04-24 17:50:30 +00:00
Andrew Kaylor
5aa8854f0e Fixing cmake build for MCJIT unit tests
llvm-svn: 180150
2013-04-23 21:46:56 +00:00
Andrew Kaylor
af75f2d095 Adding object caching support to MCJIT
llvm-svn: 180146
2013-04-23 21:26:38 +00:00
Reid Kleckner
e3c8c81c87 Un-revert the environ copy in ProgramTest after fixing it on OS X
This was r180041 and r180046, which was reverted in r180066.
Re-committing this should fix the dragonegg bootstrap, which I presume
needs LD_LIBRARY_PATH to be propagated to the child.

Tested on Linux, Windows, and Mac OS 10.6.

llvm-svn: 180099
2013-04-23 13:15:51 +00:00
Alexey Samsonov
31d66490c8 Add more guards around zlib-dependent code
llvm-svn: 180084
2013-04-23 08:57:30 +00:00
Alexey Samsonov
30f0410c39 Add basic zlib support to LLVM. This would allow to use compression/uncompression in selected LLVM tools.
llvm-svn: 180083
2013-04-23 08:28:39 +00:00
Michael Gottesman
face3ce082 Revert "Add a missing reference on a std::vector<> out param"
Revert "[Support] Propagate the environment into the test child process"

This reverts commit r180046.
This reverts commit r180041.

These have broken buildbots for ~3 hours:

http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RAincremental/builds/763

llvm-svn: 180066
2013-04-22 22:51:55 +00:00
Reid Kleckner
7a94b9d4da Add a missing reference on a std::vector<> out param
Pointed out by Eli.  The test passes for me either way, so I missed
this.

llvm-svn: 180046
2013-04-22 20:58:09 +00:00
Reid Kleckner
c3f485579d [Support] Propagate the environment into the test child process
Should fix the dragonegg bootstrap builder, which reasonably needs
LD_LIBRARY_PATH to be set.

llvm-svn: 180041
2013-04-22 20:23:41 +00:00
Reid Kleckner
521e47ef4f [Support] Fix argv string escape bug on Windows
Summary:
This is http://llvm.org/PR15802.  Backslashes preceding double quotes in
arguments must be escaped.  The interesting bit is that all other
backslashes should *not* be escaped, because the un-escaping logic is
only triggered by the presence of a double quote character.

Reviewers: Bigcheese

CC: llvm-commits

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

llvm-svn: 180035
2013-04-22 19:03:55 +00:00
Alexey Samsonov
542f535116 Create a stub for DWARF parser unittests
Moves one DWARF-specific header to include/llvm/DebugInfo from lib/.
Add a short unittest for r179095.

llvm-svn: 179678
2013-04-17 08:29:02 +00:00
Benjamin Kramer
b7bf971543 Fix a disconcerting bug in Value::isUsedInBasicBlock, which gave wrong answers for blocks larger than 3 instrs.
Also add a unit test. PR15727.

llvm-svn: 179370
2013-04-12 08:33:11 +00:00
Joey Gouly
08202d2a86 Delete the functions F1 and F2 to appease the valgrind bot.
llvm-svn: 179239
2013-04-10 23:21:26 +00:00
Joey Gouly
853c05b365 Change CloneFunctionInto to always clone Argument attributes induvidually,
rather than checking if the source and destination have the same number of
arguments and copying the attributes over directly.

llvm-svn: 179169
2013-04-10 10:37:38 +00:00
Michael J. Spencer
61add4113e [Support][FileSystem] Fix identify_magic for big endian ELF.
llvm-svn: 178905
2013-04-05 20:10:04 +00:00
Jyotsna Verma
3dc90eb23f Enable JIT/MCJIT unit tests for targets with JIT support.
Change unittests/ExecutionEngine/Makefile to include Makefile.config before
TARGET_HAS_JIT flag is checked.

Fixes bug: http://llvm.org/bugs/show_bug.cgi?id=15669

llvm-svn: 178871
2013-04-05 14:26:16 +00:00
Rafael Espindola
f0937372e8 Explicitly add -Wl,--export-all-symbols on mingw/cygwin.
Looks like cmake on windows is not expanding ENABLE_EXPORTS to
-Wl,--export-all-symbols on mingw or cygwin, so add this back.

llvm-svn: 178730
2013-04-04 01:19:55 +00:00
Rafael Espindola
bf8dcf15ed Don't export symbols in every binary on linux.
On freebsd this makes sure that symbols are exported on the binaries that need
them. The net result is that we should get symbols in the binaries that need
them on every platform.

On linux x86-64 this reduces the size of the bin directory from 262MB to 250MB.

Patch by Stephen Checkoway.

llvm-svn: 178725
2013-04-04 01:01:32 +00:00
Jean-Luc Duprat
7776961622 SmallVector and SmallPtrSet allocations now power-of-two aligned.
This time tested on both OSX and Linux.

llvm-svn: 178377
2013-03-29 22:07:12 +00:00
Rafael Espindola
e78555387c Revert "Fix allocations of SmallVector and SmallPtrSet so they are more prone to"
This reverts commit 617330909f0c26a3f2ab8601a029b9bdca48aa61.

It broke the bots:

/home/clangbuild2/clang-ppc64-2/llvm.src/unittests/ADT/SmallVectorTest.cpp:150: PushPopTest
/home/clangbuild2/clang-ppc64-2/llvm.src/unittests/ADT/SmallVectorTest.cpp:118: Failure
Value of: v[i].getValue()
  Actual: 0
Expected: value
Which is: 2

llvm-svn: 178334
2013-03-29 07:11:21 +00:00
Jean-Luc Duprat
0ba254f23f Fix allocations of SmallVector and SmallPtrSet so they are more prone to
being power-of-two sized.

llvm-svn: 178332
2013-03-29 05:45:22 +00:00
Jyotsna Verma
7bc9287a33 Disable JIT/MCJIT tests in unittests/ExecutionEngine for the targets that don't support JIT.
llvm-svn: 178221
2013-03-28 03:38:29 +00:00
Evgeniy Stepanov
4459064d7b Disable Initialize.MultipleThreads test under MemorySanitizer.
Fails due to insufficient thread stack.

llvm-svn: 178135
2013-03-27 12:50:49 +00:00
Aaron Ballman
2d482d7e25 Test case for graceful handling of long file names on Windows. Patch thanks to Paul Robinson!
llvm-svn: 177223
2013-03-16 15:00:51 +00:00
Michael J. Spencer
e31ecbd512 [Support][Test] Missed this in the API change.
llvm-svn: 176996
2013-03-14 00:33:37 +00:00
Michael J. Spencer
55347a0780 [Support][ErrorOr] Add support for implicit conversion from error code/condition enums.
llvm-svn: 176228
2013-02-28 01:44:26 +00:00
David Blaikie
b39f6eaf73 Only include move-related Optional<T> tests when rvalue references are available.
llvm-svn: 175730
2013-02-21 07:58:45 +00:00
David Blaikie
117a44bd1a Add move ctor/assignment to Optional<T>
Code review feedback for r175580 by Jordan Rose.

llvm-svn: 175729
2013-02-21 07:55:39 +00:00
Benjamin Kramer
a2f37d8d3b Move the SplatByte helper to APInt and generalize it a bit.
llvm-svn: 175621
2013-02-20 13:00:06 +00:00
David Blaikie
05260669b1 Rename llvm::Optional<T>::Reset to 'reset' as per LLVM naming conventions.
Code review feedback on r175580 from Jordan Rose.

llvm-svn: 175595
2013-02-20 06:25:36 +00:00
David Blaikie
cbe2e7eb6b Allow llvm::Optional to work with types without default constructors.
This generalizes Optional to require less from the T type by using aligned
storage for backing & placement new/deleting the T into it when necessary.

Also includes unit tests.

llvm-svn: 175580
2013-02-20 00:26:04 +00:00
Douglas Gregor
567c8d3dc3 Remove my bogus MapVector::erase() with a narrower ::pop_back(), and add a unit test.
llvm-svn: 175538
2013-02-19 18:26:07 +00:00
Meador Inge
58a7392486 ADT: Correct APInt::getActiveWords for zero values
PR15138 was opened because of a segfault in the Bitcode writer.
The actual issue ended up being a bug in APInt where calls to
APInt::getActiveWords returns a bogus value when the APInt value
is 0.  This patch fixes the problem by ensuring that getActiveWords
returns 1 for 0 valued APInts.

llvm-svn: 174641
2013-02-07 18:36:50 +00:00
Michael J. Spencer
c795dd0ca7 [Support][ErrorOr] Add support for convertable types.
Thanks to Andrew, David, and Aaron for helping fix this.

llvm-svn: 174552
2013-02-06 22:28:53 +00:00
Andrew Trick
2e729a5aff Revert "[Support][ErrorOr] Add support for convertable types."
This reverts commit a33e1fafac7fedb1b080ef07ddf9ad6ddff3a830.

This unit test crashes on Darwon. It needs to be temporarily reverted
to unblock the test infrastructure.

llvm-svn: 174458
2013-02-05 22:50:20 +00:00
Michael J. Spencer
2da5c2c32d [Support][ErrorOr] Add support for convertable types.
llvm-svn: 174357
2013-02-05 08:22:27 +00:00
Dan Gohman
7eac0c2694 Change GetPointerBaseWithConstantOffset's DataLayout argument from a
reference to a pointer, so that it can handle the case where DataLayout
is not available and behave conservatively.

llvm-svn: 174024
2013-01-31 02:00:45 +00:00
Michael Gottesman
0b23f2000b Added a unit test for r173983 that verifies that Target.isiOS() works correctly.
As a bonus I put in some extra checks to make sure that we are identifying the
machine word of various Mac OS X/iOS targets appropriately.

llvm-svn: 173994
2013-01-30 23:48:13 +00:00
Andrew Kaylor
50e524dec5 Add support for source and line information to IntelJITEventListener for object emitted by MCJIT.
llvm-svn: 173712
2013-01-28 19:52:37 +00:00
Bill Wendling
761ddf3dd9 Fix test to not use the AttributeSet's AttributeWithIndex creation method.
llvm-svn: 173608
2013-01-27 03:39:10 +00:00
Dmitri Gribenko
b7967d1481 Add file to CMakeLists (file added in r173505)
llvm-svn: 173513
2013-01-25 22:29:23 +00:00
Nick Lewycky
4c1f132b0c Add an insert() method to MapVector. Adds the first MapVector unit test.
llvm-svn: 173505
2013-01-25 22:11:02 +00:00
Benjamin Kramer
429ac6dc9a APFloat: Make sure that we get a well-formed x87 NaN when converting from a smaller type.
Fixes PR15054.

llvm-svn: 173459
2013-01-25 17:01:00 +00:00
NAKAMURA Takumi
b38e0d46cb unittests/SupportTests/Initialize.MultipleThreads: Enable pthread_attr_setstack(3) only on Linux.
I got blamed on darwin11;
unittests/Support/ManagedStatic.cpp:35: error: 'pthread_attr_setstack' was not declared in this scope

llvm-svn: 173355
2013-01-24 15:29:27 +00:00
NAKAMURA Takumi
a9a3c17cd4 unittests/SupportTests/Initialize.MultipleThreads: Appease --vg-leak to allocate stack explicitly for glibc.
llvm-svn: 173350
2013-01-24 14:44:02 +00:00
NAKAMURA Takumi
d0d93db5cb llvm/unittests: Use OwningPtr to fix --vg-leak.
llvm-svn: 173240
2013-01-23 08:33:13 +00:00
NAKAMURA Takumi
634ae981a3 IRTests/WaymarkTest.cpp: Fix in --vg-leak.
llvm-svn: 173239
2013-01-23 08:33:05 +00:00
NAKAMURA Takumi
be9f7c27f1 IRTests/IRBuilderTest.cpp: GetIntTy: Delete DL at yourself since it is not linked.
llvm-svn: 173238
2013-01-23 08:31:28 +00:00
NAKAMURA Takumi
9a7842a6f2 IRTests/IRBuilderTest.cpp: Let GV added to the module.
It fixes --vg-leak.

llvm-svn: 173237
2013-01-23 08:30:39 +00:00
NAKAMURA Takumi
71fc8c35b0 IRTests/ConstantsTest.cpp: AsInstructionsTest: Delete each instruction immediately if it is not linked.
llvm-svn: 173236
2013-01-23 08:30:26 +00:00
NAKAMURA Takumi
90605a6d70 Untabify.
llvm-svn: 173235
2013-01-23 08:30:21 +00:00
NAKAMURA Takumi
b34fb03d75 Whitespace.
llvm-svn: 173234
2013-01-23 08:30:15 +00:00
NAKAMURA Takumi
29f8905caa DominatorTreeTest.cpp: Add the file header.
llvm-svn: 173233
2013-01-23 08:30:10 +00:00
Michael J. Spencer
a34e71c387 [Support][ErrorOr] Add optimized specialization of ErrorOr<void>.
ErrorOr<void> represents an operation that returns nothing, but can still fail.
It should be used in cases where you need the aditional user data that ErrorOr
provides over error_code.

llvm-svn: 173209
2013-01-23 00:18:31 +00:00
NAKAMURA Takumi
48e4712d87 ADT/SparseMultiSetTest.cpp: Try to appease cygwin-clang on stage2, take two. [-Wsign-compare]
llvm-svn: 173144
2013-01-22 10:39:31 +00:00
NAKAMURA Takumi
7a2be44b4e ADT/SparseMultiSetTest.cpp: Try to appease cygwin-clang (libstdc++-4.5) on stage2. [-Wsign-compare]
llvm-svn: 173127
2013-01-22 05:30:15 +00:00
NAKAMURA Takumi
65a1d5e982 ErrorOrTest.cpp: Check existence of EXPECT_DEBUG_DEATH. It is not always available.
llvm-svn: 173123
2013-01-22 04:02:41 +00:00
Michael Ilseman
ff647f94ab Introduce a new data structure, the SparseMultiSet, and changes to the MI scheduler to use it.
A SparseMultiSet adds multiset behavior to SparseSet, while retaining SparseSet's desirable properties. Essentially, SparseMultiSet provides multiset behavior by storing its dense data in doubly linked lists that are inlined into the dense vector. This allows it to provide good data locality as well as vector-like constant-time clear() and fast constant time find(), insert(), and erase(). It also allows SparseMultiSet to have a builtin recycler rather than keeping SparseSet's behavior of always swapping upon removal, which allows it to preserve more iterators. It's often a better alternative to a SparseSet of a growable container or vector-of-vector.

llvm-svn: 173064
2013-01-21 18:18:53 +00:00
Michael J. Spencer
cfd7b9e015 [Support] Make test C++03.
llvm-svn: 173004
2013-01-21 05:39:07 +00:00
Benjamin Kramer
804fa9cc43 Disable test that fails due to lack of std::true_type in C++03.
Michael, can this test be ported to C++03?

llvm-svn: 172996
2013-01-20 21:52:27 +00:00
Michael J. Spencer
74395cc7b4 [Support] Port ErrorOr<T> from lld to C++03.
llvm-svn: 172991
2013-01-20 20:32:30 +00:00
Peter Collingbourne
5f190b5e4e Introduce llvm::sys::getProcessTriple() function.
In r143502, we renamed getHostTriple() to getDefaultTargetTriple()
as part of work to allow the user to supply a different default
target triple at configure time.  This change also affected the JIT.
However, it is inappropriate to use the default target triple in the
JIT in most circumstances because this will not necessarily match
the current architecture used by the process, leading to illegal
instruction and other such errors at run time.

Introduce the getProcessTriple() function for use in the JIT and
its clients, and cause the JIT to use it.  On architectures with a
single bitness, the host and process triples are identical.  On other
architectures, the host triple represents the architecture of the
host CPU, while the process triple represents the architecture used
by the host CPU to interpret machine code within the current process.
For example, when executing 32-bit code on a 64-bit Linux machine,
the host triple may be 'x86_64-unknown-linux-gnu', while the process
triple may be 'i386-unknown-linux-gnu'.

This fixes JIT for the 32-on-64-bit (and vice versa) build on non-Apple
platforms.

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

llvm-svn: 172627
2013-01-16 17:27:22 +00:00
Evgeniy Stepanov
044fd8aa94 Allow vectors in CreatePointerCast of constants.
llvm-svn: 172615
2013-01-16 14:41:46 +00:00
Evgeniy Stepanov
c6431b5743 A test for r172535.
llvm-svn: 172614
2013-01-16 14:38:50 +00:00
Dmitri Gribenko
521181bcca Improve r172464: const_cast is not needed if the variable is not const
llvm-svn: 172474
2013-01-14 21:23:37 +00:00
David Greene
6d59c943e8 Fix Casts
Use const_cast<> to avoid cast-away-const errors.

llvm-svn: 172464
2013-01-14 21:04:35 +00:00
Benjamin Kramer
de89fe30e0 Add a unit test to verifies that attribute uniquing works so it doesn't break again.
The folding set details can be subtle and broke twice in the last couple of weeks.

llvm-svn: 172313
2013-01-12 14:13:45 +00:00
Eli Bendersky
30fd822f06 Fix bug in exception table allocation (PR13678)
Patch by Michael Muller.

llvm-svn: 172214
2013-01-11 16:33:30 +00:00
Dmitri Gribenko
501313b41b Replace memcpys by a static_cast and an integral promotion.
llvm-svn: 172108
2013-01-10 21:21:32 +00:00
Dmitri Gribenko
db86689e43 Fix coding style
llvm-svn: 172107
2013-01-10 21:10:44 +00:00
Jakub Staszak
3871426bfd Unbreak tests after regression from r172081.
llvm-svn: 172105
2013-01-10 21:02:05 +00:00
David Greene
2ce09092a4 Fix Alias Bug
Use memcpy to do type punning instead of a cast.  A cast or similar
operation through a union breaks strict aliasing rules.

llvm-svn: 172081
2013-01-10 18:17:54 +00:00
Shuxin Yang
0640c4a0dc Implement APFloat::isDenormal()
llvm-svn: 171764
2013-01-07 18:59:35 +00:00
Chandler Carruth
bcfdf656b1 Rename the VMCore unittest tree to IR. Somehow was missed when doing the
library rename.

llvm-svn: 171747
2013-01-07 15:35:46 +00:00
Chandler Carruth
4c4c8c33e1 Move CallGraphSCCPass.h into the Analysis tree; that's where the
implementation lives already.

llvm-svn: 171746
2013-01-07 15:26:48 +00:00
Chandler Carruth
8053e55beb Rename the unittest from ArrayRecylerTest.cpp to ArrayRecyclerTest.cpp.
Fixes the CMake build. It took me cutting and pasting this before
I managed to see the missing character. =]

llvm-svn: 171589
2013-01-05 02:08:43 +00:00
Jakob Stoklund Olesen
2166929062 Add an ArrayRecycler class.
This is similar to the existing Recycler allocator, but instead of
recycling individual objects from a BumpPtrAllocator, arrays of
different sizes can be allocated.

llvm-svn: 171581
2013-01-05 00:57:11 +00:00
Chandler Carruth
ae1954050c Add time getters to the process interface for requesting the elapsed
wall time, user time, and system time since a process started.

For walltime, we currently use TimeValue's interface and a global
initializer to compute a close approximation of total process runtime.

For user time, this adds support for an somewhat more precise timing
mechanism -- clock_gettime with the CLOCK_PROCESS_CPUTIME_ID clock
selected.

For system time, we have to do a full getrusage call to extract the
system time from the OS. This is expensive but unavoidable.

In passing, clean up the implementation of the old APIs and fix some
latent bugs in the Windows code. This might have manifested on Windows
ARM systems or other systems with strange 64-bit integer behavior.

The old API for this both user time and system time simultaneously from
a single getrusage call. While this results in fewer system calls, it
also results in a lower precision user time and if only user time is
desired, it introduces a higher overhead. It may be worthwhile to switch
some of the pass timers to not track system time and directly track user
and wall time. The old API also tracked walltime in a confusing way --
it just set it to the current walltime rather than providing any measure
of wall time since the process started the way buth user and system time
are tracked. The new API is more consistent here.

The plan is to eventually implement these methods for a *child* process
by using the wait3(2) system call to populate an rusage struct
representing the whole subprocess execution. That way, after waiting on
a child process its stats will become accurate and cheap to query.

llvm-svn: 171551
2013-01-04 23:19:55 +00:00
Jakob Stoklund Olesen
499d789d2b Add an iplist::clearAndLeakNodesUnsafely() function.
The iplist::clear() function can be quite expensive because it traverses
the entire list, calling deleteNode() and removeNodeFromList() on each
element. If node destruction and deallocation can be handled some other
way, clearAndLeakNodesUnsafely() can be used to jettison all nodes
without bringing them into cache.

The function name is meant to be ominous.

llvm-svn: 171540
2013-01-04 22:35:42 +00:00
Nick Kledzik
8ae5e45184 Fix how YAML I/O detects flow sequences.
Update test case to verify flow sequence is
written as a flow sequence.

llvm-svn: 171514
2013-01-04 19:32:00 +00:00
Michael J. Spencer
8e9968e6f2 [Support][Endian] Add support for specifying the alignment and native unaligned types.
* Add support for specifying the alignment to use.
* Add the concept of native endianness. Used for unaligned native types.

The native alignment and read/write simplification is based on a patch by Richard Smith.

llvm-svn: 171406
2013-01-02 20:14:11 +00:00
Chandler Carruth
4c1f3c24db Move all of the header files which are involved in modelling the LLVM IR
into their new header subdirectory: include/llvm/IR. This matches the
directory structure of lib, and begins to correct a long standing point
of file layout clutter in LLVM.

There are still more header files to move here, but I wanted to handle
them in separate commits to make tracking what files make sense at each
layer easier.

The only really questionable files here are the target intrinsic
tablegen files. But that's a battle I'd rather not fight today.

I've updated both CMake and Makefile build systems (I think, and my
tests think, but I may have missed something).

I've also re-sorted the includes throughout the project. I'll be
committing updates to Clang, DragonEgg, and Polly momentarily.

llvm-svn: 171366
2013-01-02 11:36:10 +00:00
Chandler Carruth
03fda8f594 Sort a few more #include lines in tools/... unittests/... and utils/...
llvm-svn: 171363
2013-01-02 10:26:28 +00:00
Chandler Carruth
206011250c Go ahead and get rid of the old page size interface and convert all the
users over to the new one. No sense maintaining this "compatibility"
layer it seems.

llvm-svn: 171331
2012-12-31 23:31:56 +00:00
Chandler Carruth
13b537a99b Flesh out a page size accessor in the new API.
Implement the old API in terms of the new one. This simplifies the
implementation on Windows which can now re-use the self_process's once
initialization.

llvm-svn: 171330
2012-12-31 23:23:35 +00:00
Michael J. Spencer
d221e06c0a [AlignOf] Add AlignedCharArray and refactor AlignedCharArrayUnion.
This adds AlignedCharArray<Alignment, Size>. A templated struct that contains
a member named buffer of type char[Size] that is aligned to Alignment.

llvm-svn: 171319
2012-12-31 19:54:45 +00:00
Chandler Carruth
a7f5a01dc6 Begin sketching out the process interface.
The coding style used here is not LLVM's style because this is modeled
after a Boost interface and thus done in the style of a candidate C++
standard library interface. I'll probably end up proposing it as
a standard C++ library if it proves to be reasonably portable and
useful.

This is just the most basic parts of the interface -- getting the
process ID out of it. However, it helps sketch out some of the boiler
plate such as the base class, derived class, shared code, and static
factory function. It also introduces a unittest so that I can
incrementally ensure this stuff works.

However, I've not even compiled this code for Windows yet. I'll try to
fix any Windows fallout from the bots, and if I can't fix it I'll revert
and get someone on Windows to help out. There isn't a lot more that is
mandatory, so soon I'll switch to just stubbing out the Windows side and
get Michael Spencer to help with implementation as he can test it
directly.

llvm-svn: 171289
2012-12-31 11:17:50 +00:00
Duncan Sands
b535136495 Test that a landingpad gets the name provided when it was created (see commit
170318).

llvm-svn: 170886
2012-12-21 12:03:03 +00:00
Jakob Stoklund Olesen
223ce5e130 Add an assertion for a likely ilist::splice() contract violation.
The single-element ilist::splice() function supports a noop move:

  List.splice(I, List, I);

The corresponding std::list function doesn't allow that, so add a unit
test to document that behavior.

This also means that

  List.splice(I, List, F);

is somewhat surprisingly not equivalent to

  List.splice(I, List, F, next(F));

This patch adds an assertion to catch the illegal case I == F above.
Alternatively, we could make I == F a legal noop, but that would make
ilist differ even more from std::list.

llvm-svn: 170443
2012-12-18 19:28:37 +00:00
Nick Kledzik
3b2c99b998 Fix some integer constant warnings by using a suffix
llvm-svn: 170376
2012-12-17 22:11:17 +00:00
Nick Kledzik
c826b396ef re-enable test cases now that traits work with g++. Fix some g++ warnings
llvm-svn: 170369
2012-12-17 20:43:53 +00:00
Nick Kledzik
f37b944ea2 Temporarily disable test cases until they compile with g++ too.
llvm-svn: 170035
2012-12-12 22:39:45 +00:00
David Blaikie
f993478af6 Unbreak the build. Fallout from r170019.
llvm-svn: 170033
2012-12-12 22:14:32 +00:00
Nick Kledzik
2516df02eb Initial implementation of a utility for converting native data
structures to and from YAML using traits.  The first client will
be the test suite of lld.  The documentation will show up at:

   http://llvm.org/docs/YamlIO.html

llvm-svn: 170019
2012-12-12 20:46:15 +00:00
Michael Ilseman
2f7539fd12 Reorganize FastMathFlags to be a wrapper around unsigned, and streamline some interfaces.
llvm-svn: 169712
2012-12-09 21:12:04 +00:00
Bill Wendling
3f153ce37b s/AttrListPtr/AttributeSet/g to better label what this class is going to be in the near future.
llvm-svn: 169651
2012-12-07 23:16:57 +00:00
Akira Hatanaka
92dcde6e6d Do not run tests MappedMemoryTest.BasicWrite and MultipleWrite unless both
MF_READ and MF_WRITE are set.

llvm-svn: 169439
2012-12-05 22:43:07 +00:00
Michael J. Spencer
c0bd8f95ce Copy clang/Driver/<Option parsing stuff> to llvm.
llvm-svn: 169344
2012-12-05 00:29:32 +00:00
Chandler Carruth
f413c260cc Sort the #include lines for unittest/...
llvm-svn: 169250
2012-12-04 10:23:08 +00:00
NAKAMURA Takumi
573678d9a5 VMCoreTests/PassManagerTest.cpp: Appease msvc not to do "using llvm::Pass" in class template.
FIXME: I have not checked whether to be compiled on msvc11.
llvm-svn: 169225
2012-12-04 07:25:24 +00:00
Matt Beaumont-Gay
3e68d7d342 Add 'using' declarations to suppress -Woverloaded-virtual warnings.
llvm-svn: 169214
2012-12-04 05:41:27 +00:00
Michael J. Spencer
8d8b62ec5d [Support] Make FileOutputBuffer work on Windows.
llvm-svn: 169167
2012-12-03 22:09:52 +00:00
Chandler Carruth
5286042938 Switch LLVM_USE_RVALUE_REFERENCES to LLVM_HAS_RVALUE_REFERENCES.
Rationale:
1) This was the name in the comment block. ;]
2) It matches Clang's __has_feature naming convention.
3) It matches other compiler-feature-test conventions.

Sorry for the noise. =]

I've also switch the comment block to use a \brief tag and not duplicate
the name.

llvm-svn: 168996
2012-11-30 11:45:22 +00:00
Michael Ilseman
d71b8c4e64 copyFastMathFlags utility and test case
llvm-svn: 168943
2012-11-29 21:25:12 +00:00
Michael Ilseman
19c9ae38cf Whoops, fixed bad merge
llvm-svn: 168816
2012-11-28 21:21:18 +00:00
Michael Ilseman
8ff81910ee Fixed bad test case
llvm-svn: 168815
2012-11-28 21:19:52 +00:00
Michael Ilseman
1349abeb09 Fast-math: IRBuilder test for creating instructions with fast-math flags
llvm-svn: 168814
2012-11-28 21:17:34 +00:00
Eli Bendersky
09ca9737c2 Add backreference matching capabilities to Support/Regex, with
appropriate unit tests. This change in itself is not expected to
affect any functionality at this point, but it will serve as a
stepping stone to improve FileCheck's variable matching capabilities.

Luckily, our regex implementation already supports backreferences,
although a bit of hacking is required to enable it. It supports both
Basic Regular Expressions (BREs) and Extended Regular Expressions
(EREs), without supporting backrefs for EREs, following POSIX strictly
in this respect. And EREs is what we actually use (rightly). This is
contrary to many implementations (including the default on Linux) of
POSIX regexes, that do allow backrefs in EREs.

Adding backref support to our EREs is a very simple change in the
regcomp parsing code. I fail to think of significant cases where it
would clash with existing things, and can bring more versatility to
the regexes we write. There's always the danger of a backref in a
specially crafted regex causing exponential matching times, but since
we mainly use them for testing purposes I don't think it's a big
problem. [it can also be placed behind a flag specific to FileCheck,
if needed].

For more details, see:

* http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-November/055840.html
* http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121126/156878.html

llvm-svn: 168802
2012-11-28 19:00:02 +00:00
Andrew Kaylor
ca8d63b46f Moving SectionMemoryManager into RuntimeDyld and adding unit tests for it.
The SectionMemoryManager now supports (and requires) applying section-specific page permissions.  Clients using this memory manager must call either MCJIT::finalizeObject() or SectionMemoryManager::applyPermissions() before executing JITed code.

See r168718 for changes from the previous implementation.

llvm-svn: 168721
2012-11-27 19:42:02 +00:00
Andrew Kaylor
e6c3b1a551 Implementing page permission setting in MCJIT unit test SectionMemoryManager.cpp
This commit is primarily here for the revision history.  I'm about to move the SectionMemoryManager into the RuntimeDyld library, but I wanted to check the changes in here so people could see the differences in the updated implementation.

llvm-svn: 168718
2012-11-27 19:00:17 +00:00
Sean Silva
e0e760dc93 Allow using MemoryBuffers with yaml::Stream directly.
The rationale is to get YAML filenames in diagnostics from
yaml::Stream::printError -- currently the filename is hard-coded as
"YAML" because there's no buffer information available.

Patch by Kim Gräsman!

llvm-svn: 168341
2012-11-19 23:21:47 +00:00
James Molloy
0915ec1560 Add a new function to ConstantExpr - getAsInstruction. This returns its Instruction* corollary, which may be useful if a user
wishes to transform a ConstantExpr so that one of its operands is no longer constant.

llvm-svn: 168262
2012-11-17 17:56:30 +00:00
Joe Abbey
c5c8f1686e Removing utf-8 smart quote and trailing whitespace
llvm-svn: 168253
2012-11-17 05:13:16 +00:00
Joe Abbey
454c19f9ee Suppressing the 'direct base ‘{anonymous}::S1’ inaccessible in ‘{anonymous}::D9’
due to ambiguity' warning.

llvm-svn: 168251
2012-11-17 04:54:22 +00:00
Andrew Kaylor
bf5ce8a2b0 Interface changes to allow RuntimeDyld memory managers to set memory permissions after an object has been loaded.
llvm-svn: 168114
2012-11-15 23:50:01 +00:00
Jakub Staszak
14a889a054 Remove DOS line endings.
llvm-svn: 167968
2012-11-14 20:18:34 +00:00
Gabor Greif
e410d28c25 do not play preprocessor tricks with 'private', use public interfaces instead; this appeases the VC++ buildbots
llvm-svn: 167724
2012-11-12 13:34:59 +00:00
Gabor Greif
269fe89c77 add unit test for waymarking algorithm (Use::getUser)
llvm-svn: 167720
2012-11-12 10:01:17 +00:00
Benjamin Kramer
20d52f752f Provide definitions for all functions.
ICC refuses to compile a class in an anonymous namespace if some functions
aren't defined. Fixes PR13477.

llvm-svn: 167676
2012-11-10 16:10:16 +00:00
Benjamin Kramer
9647e19de7 Drop the limitation to IEEE floating point types from the fdiv of pow2 -> fmul transform.
This is safe for x87 long doubles and ppc double doubles too.

llvm-svn: 167582
2012-11-08 13:58:10 +00:00
Amara Emerson
efb5b4e564 MCJIT unit test: add calls to ensure that instruction caches are properly invalidated before code execution.
llvm-svn: 167146
2012-10-31 17:44:16 +00:00
Amara Emerson
a42e54ebd4 Port lli bug fix from r166920 to MCJIT unit test.
llvm-svn: 167145
2012-10-31 17:41:51 +00:00
Amara Emerson
6abdedd25e Commit access test.
llvm-svn: 167144
2012-10-31 17:35:12 +00:00
Ulrich Weigand
d3685b18a9 Disable all old-JIT unit tests on PowerPC.
These tests were all failing since the old JIT doesn't work
for PowerPC (any more), and there are no plans to attempt to
fix it again (instead, work focuses on MCJIT).

llvm-svn: 167133
2012-10-31 16:18:02 +00:00
Evgeniy Stepanov
00759553de Add IRBuilderBase::getIntPtrTy.
llvm-svn: 167111
2012-10-31 09:50:01 +00:00
Duncan Sands
bce56286fb Fix isEliminableCastPair to work correctly in the presence of pointers
with different sizes.

llvm-svn: 167018
2012-10-30 16:03:32 +00:00
Ulrich Weigand
c504e37126 Implement arithmetic on APFloat with PPCDoubleDouble semantics by
treating it as if it were an IEEE floating-point type with 106-bit
mantissa.

This makes compile-time arithmetic on "long double" for PowerPC
in clang (in particular parsing of floating point constants)
work, and fixes all "long double" related failures in the test
suite.

llvm-svn: 166951
2012-10-29 18:09:01 +00:00
Pete Cooper
ccb3ee0d18 Fixed bug in SmallDenseMap where it wouldn't leave enough space for an empty bucket if the number of values was exactly equal to the small capacity. This led to an infinite loop when finding a non-existent element
llvm-svn: 166492
2012-10-23 18:47:35 +00:00
Bob Wilson
62af1bf601 Use an export list when building JIT unittests. <rdar://problem/12473675>
When building with LTO, the internalize pass is hiding some global symbols
that are necessary for the JIT unittests. It seems like that may be a bug in
LTO to do that by default, but until that gets fixed, this change makes sure
that we export the necessary symbols for the tests to pass.

llvm-svn: 166220
2012-10-18 20:25:36 +00:00
Bill Wendling
4314405e52 Marked this variable as 'used' so that LTO doesn't get rid of it.
llvm-svn: 166092
2012-10-17 08:08:06 +00:00
Owen Anderson
cb8d1f6815 Fix a bug in the set(I,E)/reset(I,E) methods that I recently added. The boundary condition for checking if I and E were in the same word were incorrect, and, beyond that, the mask computation was not using a wide enough constant.
llvm-svn: 166015
2012-10-16 06:04:27 +00:00
Owen Anderson
e678a60cc8 Add range-based set()/reset() to BitVector. These allow fast setting/resetting of ranges of bits, particularly useful when dealing with very large BitVector's.
llvm-svn: 165984
2012-10-15 22:05:27 +00:00
Benjamin Kramer
e80e7ac945 Update CMake build.
llvm-svn: 165908
2012-10-14 16:06:09 +00:00
Benjamin Kramer
25522ac16c Fix a typo that made ImmutableMap::getMaxElement() useless.
Add a basic unit test for ImmutableMap. Found by inspection.

llvm-svn: 165907
2012-10-14 15:56:39 +00:00
Duncan Sands
fe6c41af6b Add powerpc-ibm-aix to Triple. Patch by Kai.
llvm-svn: 165792
2012-10-12 11:08:57 +00:00
NAKAMURA Takumi
bf43385b69 JITTest.cpp: Use LLVM_ATTRIBUTE_USED, rather than __attribute__ directly!
llvm-svn: 165790
2012-10-12 08:09:29 +00:00
Bill Wendling
27bc2dc4ce Mark function as 'used' so that LTO doesn't try to get rid of it.
llvm-svn: 165781
2012-10-12 01:44:08 +00:00
NAKAMURA Takumi
cd0b92f629 Revert r165777, "Mark function as 'used' so that LTO doesn't try to get rid of it."
llvm-svn: 165780
2012-10-12 01:34:07 +00:00
Bill Wendling
e069473ee5 Mark function as 'used' so that LTO doesn't try to get rid of it.
llvm-svn: 165777
2012-10-12 01:15:17 +00:00
Sean Silva
356281d8ad Casting.h: Automatically handle isa<Base>(Derived).
Additionally, all such cases are handled with no dynamic check.

All `classof()` of the form

    class Foo {
      [...]
      static bool classof(const Bar *) { return true; }
      [...]
    }

where Foo is an ancestor of Bar are no longer necessary.
Don't write them!

Note: The exact test is `is_base_of<Foo, Bar>`, which is non-strict, so
that Foo is considered an ancestor of itself.

This leads to the following rule of thumb for LLVM-style RTTI:

    The argument type of `classof()` should be a strict ancestor.

For more information about implementing LLVM-style RTTI, see
docs/HowToSetUpLLVMStyleRTTI.rst

llvm-svn: 165765
2012-10-11 23:30:40 +00:00
Micah Villmow
fe3338a7eb Move TargetData to DataLayout.
llvm-svn: 165403
2012-10-08 16:39:34 +00:00
James Molloy
6addd26621 Some regression tests which are testing the old jit and are exercising functionality which is both known to be broken and not expected to be fixed in the old jit. To remove these from the regression test output, I've marked them XFAIL (for lit tests) and ifdef'd them out (unit tests). These modifications remove the last long-standing regression test failures from the buildbots (though updating the triple to reflect new ubuntu configuration has temporarily caused some new failures). Tested on x86-64 and ARM Linux.
Patch by David Tweed!

llvm-svn: 165390
2012-10-08 13:06:30 +00:00
Andrew Kaylor
17202594ad Adding MCJIT and MemoryBuffer unit tests
Patch by Daniel Malea.

llvm-svn: 165246
2012-10-04 20:29:44 +00:00
Nick Kledzik
df402d7821 Use unsigned long long instead of uin64_t for OS where that matters.
llvm-svn: 165147
2012-10-03 19:27:25 +00:00
Benjamin Kramer
c4738f8eac Don't call getAsUnsignedInteger directly, it fails to compile if uint64_t is not "unsigned long long".
while there add more test cases.

llvm-svn: 165140
2012-10-03 18:54:36 +00:00
Nick Kledzik
9057d55506 Add getAsUnsignedInteger test case that checks that known bad values are rejected
llvm-svn: 165136
2012-10-03 18:15:27 +00:00
Andrew Kaylor
6b7788b0c5 Removing dependency on third party library for Intel JIT event support.
Patch committed on behalf of Kirill Uhanov

llvm-svn: 164831
2012-09-28 17:35:20 +00:00
Andrew Kaylor
d4fd8dc580 Fix of hang during Intel JIT profiling
Committed on behalf of Kirill Uhanov

llvm-svn: 164736
2012-09-26 23:43:56 +00:00
Benjamin Kramer
9cd31639d0 Remove unneeded and invalid SetInsertPoint calls from unittest.
BB->end() returns a sentinel value that is not a legal insert point.

llvm-svn: 164699
2012-09-26 15:16:05 +00:00
Benjamin Kramer
6b5f441814 APFloat::roundToIntegral: Special values don't keep the exponent value up to date, don't rely on it.
Add a couple of unit tests for special floats. Fixes 13929, found by MemorySanitizer.

llvm-svn: 164698
2012-09-26 14:06:58 +00:00
Michael Ilseman
3e79cb01e7 Expansions for u/srem, using the udiv expansion. More unit tests for udiv and u/srem.
Fixed issue with Release build.

llvm-svn: 164654
2012-09-26 01:55:01 +00:00
Chad Rosier
28c95ff726 Revert r164614 to appease the buildbots.
llvm-svn: 164627
2012-09-25 19:57:20 +00:00
Michael Ilseman
16fda61fbf Expansions for u/srem, using the udiv expansion. More unit tests for udiv and u/srem.
llvm-svn: 164614
2012-09-25 17:56:47 +00:00
Michael Ilseman
9900dd8c89 Unit tests for IntegerDivision. Currently, just a basic sanity check to ensure that the code was generated properly. Future work would be finding some way to test the actual result that would be computed.
llvm-svn: 164582
2012-09-25 01:33:33 +00:00
Andrew Kaylor
960981f691 This patch adds memory support functions which will later be used to implement section-specific protection handling in MCJIT.
llvm-svn: 164249
2012-09-19 20:46:12 +00:00
Craig Topper
845fbb6919 Fix includes of llvm files that used angle brackets.
llvm-svn: 163979
2012-09-15 18:45:38 +00:00
Daniel Dunbar
edb47ce314 cmake: Fix file path.
llvm-svn: 163950
2012-09-14 23:36:56 +00:00
Daniel Dunbar
aec33914ca formatted_raw_ostream: Fix a serious bug in tell().
- The current_pos function is supposed to return all the written bytes, not the
   current position of the underlying stream.
 - This caused tell() to be broken whenever the underlying stream had buffered
   content.

llvm-svn: 163948
2012-09-14 23:15:56 +00:00
David Blaikie
c05c0c5f06 Fix up erroneous alignas usage while making this portable to GCC 4.7
Review by Chandler Carruth.

llvm-svn: 163944
2012-09-14 22:26:11 +00:00
NAKAMURA Takumi
6ed297bdc3 ADTTests: [CMake] Exclude DenseMapTest.cpp and SmallVectorTest.cpp on MSVC9 due to its bug.
llvm-svn: 162918
2012-08-30 16:22:32 +00:00
Richard Smith
2735d2748d Don't pass a null pointer to cast<> in its unit tests.
llvm-svn: 162310
2012-08-21 20:39:25 +00:00
Benjamin Kramer
3c9d9b798d DataExtractor: Fix integer truncation issues in LEB128 extraction.
llvm-svn: 162201
2012-08-20 10:52:11 +00:00
Chandler Carruth
c90bc7f318 Flatten the aligned-char-array utility template to be a directly
templated union at the request of Richard Smith. This makes it
substantially easier to type. =]

llvm-svn: 162072
2012-08-17 01:47:25 +00:00
Michael J. Spencer
793631c9bf Properly test the LLVM_USE_RVALUE_REFERENCES macro.
llvm-svn: 161979
2012-08-15 19:21:42 +00:00
Michael J. Spencer
c500bff4cd [PathV2] Add mapped_file_region. Implementation for Windows and POSIX.
llvm-svn: 161976
2012-08-15 19:05:47 +00:00
Owen Anderson
903f25db0a Fix another roundToIntegral bug where very large values could become infinity. Problem and solution identified by Steve Canon.
llvm-svn: 161969
2012-08-15 18:28:45 +00:00
Owen Anderson
3b09e94409 Fix a problem with APFloat::roundToIntegral where it would return incorrect results for negative inputs to trunc. Add unit tests to verify this behavior.
llvm-svn: 161929
2012-08-15 05:39:46 +00:00
Alexander Kornienko
1665252b4b Added test for non-static use of cl::opt (fixed in r160170)
llvm-svn: 161751
2012-08-13 10:43:36 +00:00
Benjamin Kramer
65e524a766 Update cmake build.
llvm-svn: 161297
2012-08-04 09:52:39 +00:00
Benjamin Kramer
c1a7151fa1 Postpone the deletion of the old name in StructType::setName to allow using a slice of the old name.
Fixes PR13522. Add a rudimentary unit test to exercise the behavior.

llvm-svn: 161296
2012-08-04 09:47:02 +00:00
Chandler Carruth
892c043c64 Add range erase, element insert, and range insert methods to
TinyPtrVector. With these, it is sufficiently functional for my more
normal / pedestrian uses.

I've not included some r-value reference stuff here because the value
type for a TinyPtrVector is, necessarily, just a pointer.

I've added tests that cover the basic behavior of these routines, but
they aren't as comprehensive as I'd like. In particular, they don't
really test the iterator semantics as thoroughly as they should. Maybe
some brave soul will feel enterprising and flesh them out. ;]

llvm-svn: 161104
2012-08-01 08:40:48 +00:00
Nick Kledzik
f4e550e004 Initial commit of new FileOutputBuffer support class.
Since the llvm::sys::fs::map_file_pages() support function it relies on
is not yet implemented on Windows, the unit tests for FileOutputBuffer 
are currently conditionalized to run only on unix.

llvm-svn: 161099
2012-08-01 02:29:50 +00:00
Akira Hatanaka
731add334a Implement MipsJITInfo::replaceMachineCodeForFunction.
No new test case is added.
This patch makes test JITTest.FunctionIsRecompiledAndRelinked pass on mips
platform.

Patch by Petar Jovanovic.

llvm-svn: 161098
2012-08-01 02:29:24 +00:00
Nick Kledzik
0bf7cbd969 Suppress stderr noise when test case runs.
llvm-svn: 161085
2012-07-31 22:18:15 +00:00
Chandler Carruth
7a45c5707e Implement copy and move assignment for TinyPtrVector. These try to
re-use allocated vectors as much as possible.

llvm-svn: 161041
2012-07-31 09:42:24 +00:00
Chandler Carruth
58525185d2 Bring TinyPtrVector under test. Somehow we never picked up unit tests
for this class. These tests exercise most of the basic properties, but
the API for TinyPtrVector is very strange currently. My plan is to start
fleshing out the API to match that of SmallVector, but I wanted a test
for what is there first.

Sadly, it doesn't look reasonable to just re-use the SmallVector tests,
as this container can only ever store pointers, and much of the
SmallVector testing is to get construction and destruction right.

Just to get this basic test working, I had to add value_type to the
interface.

While here I found a subtle bug in the combination of 'erase', 'begin',
and 'end'. Both 'begin' and 'end' wanted to use a null pointer to
indicate the "end" iterator of an empty vector, regardless of whether
there is actually a vector allocated or the pointer union is null.
Everything else was fine with this except for erase. If you erase the
last element of a vector after it has held more than one element, we
return the end iterator of the underlying SmallVector which need not be
a null pointer. Instead, simply use the pointer, and poniter + size()
begin/end definitions in the tiny case, and delegate to the inner vector
whenever it is present.

llvm-svn: 161024
2012-07-31 02:48:31 +00:00
Chandler Carruth
a15888ba2d Move the SmallVector unit tests to be type-parameterized so that we can
test more than a single instantiation of SmallVector.

Add testing for 0, 1, 2, and 4 element sized "small" buffers. These
appear to be essentially untested in the unit tests until now.

Fix several tests to be robust in the face of a '0' small buffer. As
a consequence of this size buffer, the growth patterns are actually
observable in the test -- yes this means that many tests never caused
a grow to occur before. For some tests I've merely added a reserve call
to normalize behavior. For others, the growth is actually interesting,
and so I captured the fact that growth would occur and adjusted the
assertions to not assume how rapidly growth occured.

Also update the specialization for a '0' small buffer length to have all
the same interface points as the normal small vector.

llvm-svn: 161001
2012-07-30 22:17:52 +00:00
Nuno Lopes
8c7d50f03f make ConstantRange::zeroExtend() optimal
llvm-svn: 160643
2012-07-23 20:33:29 +00:00
Nuno Lopes
92f0125e44 teach ConstantRange that zero times X is always zero
llvm-svn: 160317
2012-07-16 20:47:16 +00:00
Nuno Lopes
fcfb1788ca make ConstantRange::getSetSize() properly compute the size of wrapped and full sets.
Make it always return APInts with the same bitwidth for the same ConstantRange bitwidth to simply clients

llvm-svn: 160294
2012-07-16 18:08:12 +00:00
Chandler Carruth
b86140e9db Add support for attaching branch weight metadata directly from the IRBuilder.
Added a basic unit test for this with CreateCondBr. I didn't go all the
way and test the switch side as the boilerplate for setting up the
switch IRBuilder unit tests is a lot more. Fortunately, the two share
all the interesting code paths.

llvm-svn: 160251
2012-07-16 07:45:06 +00:00
Chandler Carruth
ef88c4c679 Add a boring bit of boilerplate to start testing IRBuilder::CreateCondBr.
This is in anticipation of changing CreateCondBr and wanting to test
those changes.

llvm-svn: 160250
2012-07-16 07:44:51 +00:00
Chandler Carruth
e4022aa4c4 Move the IRBuilder unittest from Support to VMCore. This got missed in
the original move of IRBuilder.

llvm-svn: 160249
2012-07-16 07:44:45 +00:00
Chandler Carruth
0e3ed1b1f3 Move llvm/Support/TypeBuilder.h -> llvm/TypeBuilder.h. This completes
the move of *Builder classes into the Core library.

No uses of this builder in Clang or DragonEgg I could find.

If there is a desire to have an IR-building-support library that
contains all of these builders, that can be easily added, but currently
it seems likely that these add no real overhead to VMCore.

llvm-svn: 160243
2012-07-15 23:45:24 +00:00
Chandler Carruth
8748299227 Move llvm/Support/MDBuilder.h to llvm/MDBuilder.h, to live with
IRBuilder, DIBuilder, etc.

This is the proper layering as MDBuilder can't be used (or implemented)
without the Core Metadata representation.

Patches to Clang and Dragonegg coming up.

llvm-svn: 160237
2012-07-15 23:26:50 +00:00
Eric Christopher
185293d560 Revert "IntRange:" as it appears to be breaking self hosting.
This reverts commit b2833d9dcba88c6f0520cad760619200adc0442c.

llvm-svn: 159618
2012-07-02 23:22:21 +00:00
Stepan Dyatkovskiy
fff4579249 IntRange:
- Changed isSingleNumber method behaviour. Now this flag is calculated on demand.
IntegersSubsetMapping
  - Optimized diff operation.
  - Replaced type of Items field from std::list with std::map.
  - Added new methods:
    bool isOverlapped(self &RHS)
    void add(self& RHS, SuccessorClass *S)
    void detachCase(self& NewMapping, SuccessorClass *Succ)
    void removeCase(SuccessorClass *Succ)
    SuccessorClass *findSuccessor(const IntTy& Val)
    const IntTy* getCaseSingleNumber(SuccessorClass *Succ)
IntegersSubsetTest
  - DiffTest: Added checks for successors.
SimplifyCFG
  Updated SwitchInst usage (now it is case-ragnes compatible) for
    - SimplifyEqualityComparisonWithOnlyPredecessor
    - FoldValueComparisonIntoPredecessors

llvm-svn: 159527
2012-07-02 13:02:18 +00:00