Commit Graph

1014 Commits

Author SHA1 Message Date
Aaron Ballman 3cab3740b6 Silencing an MSVC warning.
llvm-svn: 192042
2013-10-05 19:41:41 +00:00
Tim Northover 39ddb3f9c1 MCJIT: skip some more new multi-module tests on unsupported platforms.
This should fix the i386 Darwin build-bot.

llvm-svn: 191840
2013-10-02 16:11:07 +00:00
Filip Pizlo 7aa695e026 This threads SectionName through the allocateCodeSection/allocateDataSection APIs, both in C++ and C land.
It's useful for the memory managers that are allocating a section to know what the name of the section is.  
At a minimum, this is useful for low-level debugging - it's customary for JITs to be able to tell you what 
memory they allocated, and as part of any such dump, they should be able to tell you some meta-data about 
what each allocation is for.  This allows clients that supply their own memory managers to do this.  
Additionally, we also envision the SectionName being useful for passing meta-data from within LLVM to an LLVM 
client.

This changes both the C and C++ APIs, and all of the clients of those APIs within LLVM.  I'm assuming that 
it's safe to change the C++ API because that API is allowed to change.  I'm assuming that it's safe to change 
the C API because we haven't shipped the API in a release yet (LLVM 3.3 doesn't include the MCJIT memory 
management C API).

llvm-svn: 191804
2013-10-02 00:59:25 +00:00
Tareq A. Siraj d88b9832c8 Add non-blocking Wait() for launched processes
- New ProcessInfo class to encapsulate information about child processes.
- Generalized the Wait() to support non-blocking wait on child processes.
- ExecuteNoWait() now returns a ProcessInfo object with information about
  the launched child. Users will be able to use this object to
  perform non-blocking wait.
- ExecuteNoWait() now accepts an ExecutionFailed param that tells if execution
  failed or not.

These changes will allow users to implement basic process parallel
tools.

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

llvm-svn: 191763
2013-10-01 14:28:18 +00:00
Andrew Kaylor 6bbb2c9fcd Tests for MCJIT multiple module support
llvm-svn: 191723
2013-10-01 01:48:36 +00:00
Matt Arsenault 27e783e90d Fix getOrInsertGlobal dropping the address space.
Currently it will insert an illegal bitcast.
Arguably, the address space argument should be
added for the creation case.

llvm-svn: 191702
2013-09-30 21:23:03 +00:00
Benjamin Kramer d36f1abefd IRBuilder: Add RAII objects to reset insertion points or fast math flags.
Inspired by the object from the SLPVectorizer. This found a minor bug in the
debug loc restoration in the vectorizer where the location of a following
instruction was attached instead of the location from the original instruction.

llvm-svn: 191673
2013-09-30 15:39:48 +00:00
Benjamin Kramer 0f01d4e309 Plug a memory leak in a unit test. Stack allocation is sufficient here.
llvm-svn: 191638
2013-09-29 11:29:20 +00:00
Dmitri Gribenko 78fe2ba3ba SourceMgr diagnotics printing: fix a bug where printing a fixit for a source
range that includes a tab character will cause out-of-bounds access to the
fixit string.

llvm-svn: 191563
2013-09-27 21:24:36 +00:00
Dmitri Gribenko 8f944628ac Make SourceMgr::PrintMessage() testable and add unit tests
llvm-svn: 191558
2013-09-27 21:09:25 +00:00
Tareq A. Siraj bf40e95959 Fixed typo in CreateProcessTrailingSlash test
--gtest_filter was filtering an invalid name for the test.

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

llvm-svn: 191100
2013-09-20 18:21:59 +00:00
Rui Ueyama 106ededc4e Re-submit r190469: YAMLIO: Fix string quoting logic.
llvm-svn: 190485
2013-09-11 04:00:08 +00:00
Hans Wennborg 33ae7cea9f Revert "YAMLIO: Fix string quoting logic." (r190469)
It was turning the buildbots red.

llvm-svn: 190480
2013-09-11 01:59:32 +00:00
Rui Ueyama 38dfffa891 Remove trailing whitespace
llvm-svn: 190472
2013-09-11 00:53:07 +00:00
Rui Ueyama 9a40ae8935 YAMLIO: Fix string quoting logic.
YAMLIO printed a string as is without quotes unless it contains a newline
character. That did not suffice. We also need to quote a string if it starts
with a backquote, quote, double quote or atsign, or it's the empty string.

llvm-svn: 190469
2013-09-11 00:45:48 +00:00
Rui Ueyama 754a3ead62 Try to unbreak mingw32 buildbot.
llvm-svn: 190438
2013-09-10 21:32:42 +00:00
Rui Ueyama 471d0c57e7 Add getenv() wrapper that works on multibyte environment variable.
On Windows, character encoding of multibyte environment variable varies
depending on settings. The only reliable way to handle it I think is to use
GetEnvironmentVariableW().

GetEnvironmentVariableW() works on wchar_t string, which is on Windows UTF16
string. That's not ideal because we use UTF-8 as the internal encoding in LLVM.
This patch defines a wrapper function which takes and returns UTF-8 string for
GetEnvironmentVariableW().

The wrapper function does not do any conversion and just forwards the argument
to getenv() on Unix.

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

llvm-svn: 190423
2013-09-10 19:45:51 +00:00
Bob Wilson 6b28b3183e Update CMake file to fix buildbots.
llvm-svn: 190331
2013-09-09 19:25:11 +00:00
Bob Wilson e407736a06 Revert patches to add case-range support for PR1255.
The work on this project was left in an unfinished and inconsistent state.
Hopefully someone will eventually get a chance to implement this feature, but
in the meantime, it is better to put things back the way the were.  I have
left support in the bitcode reader to handle the case-range bitcode format,
so that we do not lose bitcode compatibility with the llvm 3.3 release.

This reverts the following commits: 155464, 156374, 156377, 156613, 156704,
156757, 156804 156808, 156985, 157046, 157112, 157183, 157315, 157384, 157575,
157576, 157586, 157612, 157810, 157814, 157815, 157880, 157881, 157882, 157884,
157887, 157901, 158979, 157987, 157989, 158986, 158997, 159076, 159101, 159100,
159200, 159201, 159207, 159527, 159532, 159540, 159583, 159618, 159658, 159659,
159660, 159661, 159703, 159704, 160076, 167356, 172025, 186736

llvm-svn: 190328
2013-09-09 19:14:35 +00:00
Dmitri Gribenko 415fb584e4 MemoryBufer: add a test: check that a file with size that is a multiple of the
page size can be null terminated correctly by MemoryBuffer.

llvm-svn: 189965
2013-09-04 18:02:13 +00:00
Alexander Kornienko 9aa60fd6f8 Move generic isPrint and columnWidth implementations to a separate header/source to allow using both generic and system-dependent versions on win32.
Summary:
This is needed so we can use generic columnWidthUTF8 in clang-format on
win32 simultaneously with a separate system-dependent implementations of
isPrint/columnWidth in TextDiagnostic.cpp to avoid attempts to print Unicode
characters using narrow-character interfaces (which is not supported on Windows,
and we'll have to figure out how to handle this).

Reviewers: jordan_rose

Reviewed By: jordan_rose

CC: llvm-commits, klimek

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

llvm-svn: 189952
2013-09-04 16:00:12 +00:00
Eric Christopher a923e7b78d It's a very large constant. Say so.
llvm-svn: 189899
2013-09-04 00:58:10 +00:00
Eric Christopher 3e6c93189b Fix copy and pasto with CMake files for unittest.
llvm-svn: 189863
2013-09-03 22:08:28 +00:00
Eric Christopher 25b7adc8ce 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 c2fa3a4e24 Alphabetize.
llvm-svn: 189848
2013-09-03 20:51:14 +00:00
Joerg Sonnenberger 6c4dc2b218 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 e72f132097 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 8fb5a9113a 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 b33f944f4e 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 14cede2829 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 c3779ff83b 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 7159bd9dcb 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 7b5d4f97a0 [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 edf7615332 Whitespace.
llvm-svn: 189020
2013-08-22 15:14:45 +00:00
NAKAMURA Takumi 2f493c7777 Suppress MemoryBufferTest.cpp on win32 for now. Investigating.
llvm-svn: 189001
2013-08-22 12:00:44 +00:00
NAKAMURA Takumi 774cf3190c 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 e2760b75e9 Basic unit tests for PointerUnion
llvm-svn: 188933
2013-08-21 21:30:23 +00:00
Peter Collingbourne aac65a313d 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 03c3324ccd 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 381f59f06f Removing a spurious semi-colon; this macro expands into a namespace.
llvm-svn: 188525
2013-08-16 01:53:58 +00:00
Aaron Ballman 0e63e53da1 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 6ede706d46 Expose CRC-32 implementation from zlib
llvm-svn: 188380
2013-08-14 16:03:29 +00:00
Hans Wennborg 76ff1d915c 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 d505fbf403 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 8d2e86db5a 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 73537eac3d 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 34894630a1 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 9e4fdd2656 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 96dd18c4ee Fix off-by-one error in Regex::isValid
llvm-svn: 187992
2013-08-08 17:32:45 +00:00
Benjamin Kramer 9f74a381a0 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