summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
* Previously, parsing capability of the .debug_frame section was addedEli Bendersky2013-02-211-0/+1
| | | | | | | | | | | | | | | | to lib/DebugInfo, with dumping in llvm-dwarfdump. This patch adds initial ability to parse and dump CFA instructions contained in entries. To keep it manageable, the patch omits some more advanced capabilities (accounted in TODOs): * Parsing of instructions with BLOCK arguments (expression lists) * Dumping of actual instruction arguments (currently only names are dumped). This is quite tricky since the dumper has to effectively "interpret" the instructions. llvm-svn: 175820
* Provide a "None" value for convenience when using Optional<T>()David Blaikie2013-02-211-2/+2
| | | | | | | This implementation of NoneType/None does have some holes but I haven't found one that doesn't - open to improvement. llvm-svn: 175696
* as the allocator is reset zero out the number of bytes allocated, this was justPedro Artigas2013-02-201-0/+1
| | | | | | missed before but probably what was intended. llvm-svn: 175687
* Fix accidental concatenation for "outputuntil" in the -debug-buffer-size ↵Erik Verbruggen2013-02-201-1/+1
| | | | | | option description. llvm-svn: 175682
* Rewrite comments.Dan Gohman2013-02-201-3/+5
| | | | llvm-svn: 175651
* Add comment in Memory.inc explaining r175646.Krzysztof Parzyszek2013-02-201-0/+7
| | | | llvm-svn: 175650
* SIGQUIT is a "kill" signal, rather than an "int" signal, in this context.Dan Gohman2013-02-201-2/+2
| | | | llvm-svn: 175648
* On PowerPC, the cache-flush instructions dcbf and icbi are treated asKrzysztof Parzyszek2013-02-201-0/+4
| | | | | | | loads. On FreeBSD, add PROT_READ page protection flag before flushing cache. llvm-svn: 175646
* Move part of APInt implementation from header to cpp file. These methodsJakub Staszak2013-02-201-0/+40
| | | | | | | require call cpp file anyway, so we wouldn't gain anything by keeping them inline. llvm-svn: 175579
* Update a portability kludge to keep it in sync with changes in the codeDan Gohman2013-02-191-2/+7
| | | | | | | which uses it. This is not ideal, but it ought to at least restore the behavior to what it was before. llvm-svn: 175571
* Whitelist files and block devices instead of blacklisting fifos andDan Gohman2013-02-191-3/+4
| | | | | | character devices. llvm-svn: 175549
* Don't trust st_size of a character device. This fixes usingDan Gohman2013-02-191-3/+3
| | | | | | | | | | /dev/stdin as an input when stdin is connected to a tty, for example. No test, because it's difficult to write a reasonably portable test for this. /dev/stdin isn't a character device when stdin is redirected from a file or connected to a pipe. llvm-svn: 175542
* Fix initialization-order bug in llvm::Support::TimeValue. TimeValue::now() ↵Alexey Samsonov2013-02-192-3/+9
| | | | | | is explicitly called during module initialization of lib/Support/Process.cpp. It reads the field of global object PosixZeroTime, which is not guaranteed to be initialized at this point. Found by AddressSanitizer with -fsanitize=init-order option. llvm-svn: 175509
* Make helpers static. Add missing include so LLVMInitializeObjCARCOpts gets C ↵Benjamin Kramer2013-02-151-2/+2
| | | | | | linkage. llvm-svn: 175264
* Workaround an MSan false positive.Evgeniy Stepanov2013-02-141-0/+2
| | | | llvm-svn: 175156
* Add static cast to unsigned char whenever a character classification ↵Guy Benyei2013-02-124-5/+7
| | | | | | function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration. llvm-svn: 175006
* More MSan/ASan annotations.Evgeniy Stepanov2013-02-042-2/+7
| | | | | | | | | | | | | | This change lets us bootstrap LLVM/Clang under ASan and MSan. It contains fixes for 2 issues: - X86JIT reads return address from stack, which MSan does not know is initialized. - bugpoint tests run binaries with RLIMIT_AS. This does not work with certain Sanitizers. We are no longer including config.h in Compiler.h with this change. llvm-svn: 174306
* Add AArch64 as an experimental target.Tim Northover2013-01-311-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for AArch64 (ARM's 64-bit architecture) to LLVM in the "experimental" category. Currently, it won't be built unless requested explicitly. This initial commit should have support for: + Assembly of all scalar (i.e. non-NEON, non-Crypto) instructions (except the late addition CRC instructions). + CodeGen features required for C++03 and C99. + Compilation for the "small" memory model: code+static data < 4GB. + Absolute and position-independent code. + GNU-style (i.e. "__thread") TLS. + Debugging information. The principal omission, currently, is performance tuning. This patch excludes the NEON support also reviewed due to an outbreak of batshit insanity in our legal department. That will be committed soon bringing the changes to precisely what has been approved. Further reviews would be gratefully received. llvm-svn: 174054
* Annotate BumpPtrAllocator for MemorySanitizer.Evgeniy Stepanov2013-01-311-0/+7
| | | | | | | This change adds MemorySanitizer annotations to BumpPtrAllocator to improve report quality. llvm-svn: 174051
* Move UTF conversion routines from clang/lib/Basic to llvm/lib/SupportDmitri Gribenko2013-01-303-0/+649
| | | | | | This is required to use them in TableGen. llvm-svn: 173923
* Fix gcc/printf/ISO C++ warningEdwin Vane2013-01-281-1/+5
| | | | | | | | | | | | Remove the use of the 't' length modifier to avoid a gcc warning. Based on usage, 32 bits of precision is good enough for printing a stack offset for a stack trace. 't' length modifier isn't in C++03 but it *is* in C++11. Added a FIXME to reintroduce once LLVM makes the switch to C++11. Reviewer: gribozavr llvm-svn: 173711
* APFloat: Make sure that we get a well-formed x87 NaN when converting from a ↵Benjamin Kramer2013-01-251-0/+6
| | | | | | | | smaller type. Fixes PR15054. llvm-svn: 173459
* ScheduleDAG: colorize the DOT graph and improve formatting.Andrew Trick2013-01-251-0/+11
| | | | llvm-svn: 173431
* Initial patch for x32 ABI support.Eli Bendersky2013-01-221-0/+2
| | | | | | | | Add the x32 environment kind to the triple, and separate the concept of pointer size and callee save stack slot size, since they're not equal on x32. llvm-svn: 173175
* Make APFloat constructor require explicit semantics.Tim Northover2013-01-221-16/+32
| | | | | | | | | Previously we tried to infer it from the bit width size, with an added IsIEEE argument for the PPC/IEEE 128-bit case, which had a default value. This default value allowed bugs to creep in, where it was inappropriate. llvm-svn: 173138
* Add llvm::hexDigitValue to convert single characters to hex.Jordan Rose2013-01-181-20/+1
| | | | | | This is duplicated in a couple places in the codebase. Adopt this in APFloat. llvm-svn: 172851
* Introduce llvm::sys::getProcessTriple() function.Peter Collingbourne2013-01-161-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert r171829 "Split changeset_ty using iterators instead of loops" as it ↵Timur Iskhodzhanov2013-01-141-8/+6
| | | | | | breaks the VS2008 build llvm-svn: 172411
* Remove redundant 'llvm::' qualificationsDmitri Gribenko2013-01-132-2/+2
| | | | llvm-svn: 172358
* SMDiagnostic: don't emit ranges if there are /any/ multibyte characters.Jordan Rose2013-01-111-9/+12
| | | | | | | | | Right now, only OS X has a way to determine the column width of a string (PR14910). Until we have a good way to deal with this, we just won't print carets, source ranges, or fixits for SMDiagnostic if the source line has multibyte characters in it. llvm-svn: 172164
* Add basic fix-its to SMDiagnostic.Jordan Rose2013-01-101-32/+158
| | | | | | | | | | | | | Like Clang's FixItHint, SMFixIt represents an insertion, replacement, or removal of source text. One or more fix-its can be emitted as part of a diagnostic, and will be printed below the source range line to show the user how they can fix their code. Currently, the only client of SMFixIt is clang-tblgen; thus, the tests for this behavior live in clang/test/TableGen/tg-fixits.td. If/when SMFixIt is adopted within LLVM itself, those tests should be moved to the LLVM suite. llvm-svn: 172086
* Fix a race condition in the lock-file manager: once the lock file isDouglas Gregor2013-01-101-3/+13
| | | | | | gone, check for the actual file we care about. llvm-svn: 172033
* Fix a race condition in llvm::sys::path::unique_file: when we end upDouglas Gregor2013-01-101-4/+7
| | | | | | | failing to create the unique file because the path doesn't exist, don't fail if someone else manages to create the path before we do. llvm-svn: 172032
* Move the internal PrintStackTrace function that is used for ↵Argyrios Kyrtzidis2013-01-092-11/+19
| | | | | | | | llvm::sys::PrintStackTraceOnErrorSignal(), into a new function llvm::sys::PrintStackTrace, so that it's available to clients for logging purposes. llvm-svn: 171989
* Fix memory leak in YAML I/O.Nick Kledzik2013-01-081-9/+32
| | | | | | | | Stop using BumpPtrAllocator for HNodes because they have fields (vector, map) which require HNode destructors to be run. llvm-svn: 171896
* Remove the llvm-local DW_TAG_vector_type tag and add a test toEric Christopher2013-01-081-1/+0
| | | | | | make sure that vector types do work. llvm-svn: 171833
* Split changeset_ty using iterators instead of loops.Lenny Maiorani2013-01-081-6/+8
| | | | llvm-svn: 171829
* Remove what appears to be a dead llvm-specific debug tag.Eric Christopher2013-01-081-1/+0
| | | | llvm-svn: 171821
* Change SMRange to be half-open (exclusive end) instead of closed (inclusive)Jordan Rose2013-01-071-1/+1
| | | | | | | | | | This is necessary not only for representing empty ranges, but for handling multibyte characters in the input. (If the end pointer in a range refers to a multibyte character, should it point to the beginning or the end of the character in a char array?) Some of the code in the asm parsers was already assuming this anyway. llvm-svn: 171765
* Implement APFloat::isDenormal()Shuxin Yang2013-01-071-0/+7
| | | | llvm-svn: 171764
* Eric thought that Darwin was right to use -1 consistently rather thanChandler Carruth2013-01-051-1/+1
| | | | | | | | | | | leaving this undefined, and despite the sentence in the standard that seems to require it, I'll cede the point and assume its a bug in the wording. Other parts of POSIX regularly allow for things to be -1 instead of undefined, this should too. Makes things more consistent too. This should have to real impact for folks though. llvm-svn: 171574
* Try to suppress the use of clock_gettime on Darwin which apparantlyChandler Carruth2013-01-051-1/+1
| | | | | | | | | | | | | | | | | defines _POSIX_CPUTIME but doesn't support the clock_* functions. I don't test the value of _POSIX_CPUTIME because the spec merely says that if it is defined, the CPU-specific timers are available, whereas it says that _POSIX_TIMERS must be defined and defined to a value greater than zero. However, this may not work, as the POSIX spec clearly states: "If the symbolic constant _POSIX_CPUTIME is defined, then the symbolic constant _POSIX_TIMERS shall also be defined by the implementation to have the value 200112L." If this doesn't work, I'll add more hacks for Darwin. llvm-svn: 171565
* Fix an obvious typo spotted by Reid Kleckner, and breaking windows builds.Chandler Carruth2013-01-041-1/+1
| | | | llvm-svn: 171559
* Add time getters to the process interface for requesting the elapsedChandler Carruth2013-01-043-35/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix how YAML I/O detects flow sequences. Nick Kledzik2013-01-041-1/+1
| | | | | | | Update test case to verify flow sequence is written as a flow sequence. llvm-svn: 171514
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | 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
* Resort the #include lines in include/... and lib/... with theChandler Carruth2013-01-021-1/+1
| | | | | | | | | | utils/sort_includes.py script. Most of these are updating the new R600 target and fixing up a few regressions that have creeped in since the last time I sorted the includes. llvm-svn: 171362
* Remove an unused method on Program.Chandler Carruth2012-12-312-35/+0
| | | | | | | I'm simplifying this interface as much as I can before merging it with the new process interface. llvm-svn: 171334
* Remove an unused method on the Program class.Chandler Carruth2012-12-312-10/+0
| | | | llvm-svn: 171332
* Go ahead and get rid of the old page size interface and convert all theChandler Carruth2012-12-314-19/+11
| | | | | | | users over to the new one. No sense maintaining this "compatibility" layer it seems. llvm-svn: 171331
OpenPOWER on IntegriCloud