summaryrefslogtreecommitdiff
path: root/lib/Support
Commit message (Collapse)AuthorAge
* Recognize 0x0000 as a COFF file magic.Rui Ueyama2013-11-14
| | | | | | | | | | | | | | | Summary: Some machine-type-neutral object files containing only undefined symbols actually do exist in the Windows standard library. Need to recognize them as COFF files. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2164 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194734 91177308-0d34-0410-b5e6-96231b3b80d8
* yaml::Input::mapTag(): Don't use StringRef to hold return type of std::string.NAKAMURA Takumi2013-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194681 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace.NAKAMURA Takumi2013-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194680 91177308-0d34-0410-b5e6-96231b3b80d8
* Add dyn_cast<> support to YAML I/O's IO classNick Kledzik2013-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194655 91177308-0d34-0410-b5e6-96231b3b80d8
* Add simple support for tags in YAML I/ONick Kledzik2013-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194644 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure LLVMLoadLibraryPermanently gets an extern "C" symbol.Benjamin Kramer2013-11-13
| | | | | | | Otherwise it's impossible to use it. Also don't include C++ headers in a C header. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194581 91177308-0d34-0410-b5e6-96231b3b80d8
* Add newline at EOF in DynamicLibrary.cppPeter Zotov2013-11-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194144 91177308-0d34-0410-b5e6-96231b3b80d8
* [llvm-c] Specify explicit namespace in LLVMLoadLibraryPermanentlyPeter Zotov2013-11-06
| | | | | | | Presence of using namespace llvm depended on several #ifdef's, and this broke the build on mswin32. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194142 91177308-0d34-0410-b5e6-96231b3b80d8
* [llvm-c] Expose LLVMLoadLibraryPermanentlyPeter Zotov2013-11-06
| | | | | | Original patch by Chris Wailes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194139 91177308-0d34-0410-b5e6-96231b3b80d8
* X86: Add a description for AMD bdver3 aka Steamroller.Benjamin Kramer2013-11-04
| | | | | | This is just bdver2 + FSGSBase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193984 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the pretty stack trace be an opt-in, rather than opt-out, facility. ↵Filip Pizlo2013-11-04
| | | | | | | | | | | Enable pretty stack traces by default if you use PrettyStackTraceProgram, so that existing LLVM-based tools will continue to get it without any changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193971 91177308-0d34-0410-b5e6-96231b3b80d8
* When LLVM is embedded in a larger application, it's not OK for LLVM to ↵Filip Pizlo2013-11-03
| | | | | | | | | | intercept crashes. LLVM already has the ability to disable this functionality. This patch exposes it via the C API. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193937 91177308-0d34-0410-b5e6-96231b3b80d8
* [ConstantRange] improve my previous patch per Nick suggestionNuno Lopes2013-10-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193795 91177308-0d34-0410-b5e6-96231b3b80d8
* Rules adjustments in order to build on DragonFly BSD.Rafael Espindola2013-10-31
| | | | | | Patch by Robin Hahling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193750 91177308-0d34-0410-b5e6-96231b3b80d8
* [SystemZ] Automatically detect zEC12 and z196 hostsRichard Sandiford2013-10-31
| | | | | | | | | | | As on other hosts, the CPU identification instruction is priveleged, so we need to look through /proc/cpuinfo. I copied the PowerPC way of handling "generic". Several tests were implicitly assuming z10 and so failed on z196. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193742 91177308-0d34-0410-b5e6-96231b3b80d8
* Add {start,end}with_lower methods to StringRef.Rui Ueyama2013-10-30
| | | | | | | | | startswith_lower is ocassionally useful and I think worth adding. endwith_lower is added for completeness. Differential Revision: http://llvm-reviews.chandlerc.com/D2041 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193706 91177308-0d34-0410-b5e6-96231b3b80d8
* make ConstantRange::signExtend() optimalNuno Lopes2013-10-30
| | | | | | the case [x, INT_MIN) was not handled optimally git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193694 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify ConstantRange::getSetSize()Nuno Lopes2013-10-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193523 91177308-0d34-0410-b5e6-96231b3b80d8
* Change MemoryBuffer::getFile to take a Twine.Rafael Espindola2013-10-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193429 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting my r193344 checkin due to build breakage.John Thompson2013-10-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193350 91177308-0d34-0410-b5e6-96231b3b80d8
* Added std::string as a built-in type for mapping.John Thompson2013-10-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193344 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the -Werror -Wpedantic clang selfhost buildAlp Toker2013-10-22
| | | | | | | | This is a stopgap fix for cast warnings introduced in r192864. A proper fix should be investigated by the author when possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193160 91177308-0d34-0410-b5e6-96231b3b80d8
* Can we move to C++11 already?Michael J. Spencer2013-10-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193007 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support][YAML] Add support for accessing tags and tag handle substitution.Michael J. Spencer2013-10-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193004 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a conversion warning in the mingw32 buildAlp Toker2013-10-18
| | | | | | | | | | | gcc diagnoses this: warning: converting to non-pointer type 'unsigned int' from NULL Also remove an empty statement. No change in functionality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192955 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix initialization order warning in mingw32 buildAlp Toker2013-10-18
| | | | | | No change in functionality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192953 91177308-0d34-0410-b5e6-96231b3b80d8
* Expose install_fatal_error_handler() through the C API.Filip Pizlo2013-10-17
| | | | | | | | | | | | | | | | | | | I expose the API with some caveats: - The C++ API involves a traditional void* opaque pointer for the fatal error callback. The C API doesn’t do this. I don’t think that the void* opaque pointer makes any sense since this is a global callback - there will only be one of them. So if you need to pass some data to your callback, just put it in a global variable. - The bindings will ignore the gen_crash_diag boolean. I ignore it because (1) I don’t know what it does, (2) it’s not documented AFAIK, and (3) I couldn’t imagine any use for it. I made the gut call that it probably wasn’t important enough to expose through the C API. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192864 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in Windows resource file detection.Rui Ueyama2013-10-16
| | | | | | The magic bytes should not include the trailing NUL byte. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192769 91177308-0d34-0410-b5e6-96231b3b80d8
* Path: Recognize Windows compiled resource file.Rui Ueyama2013-10-15
| | | | | | | | | | | | | | Some background: One can pass compiled resource files (.res files) directly to the linker on Windows. If a resource file is given, the linker will run "cvtres" command in background to convert the resource file to a COFF file to link it. What I'm trying to do with this patch is to make the linker to recognize the resource file by file magic, so that it can run cvtres command. Differential Revision: http://llvm-reviews.chandlerc.com/D1943 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192742 91177308-0d34-0410-b5e6-96231b3b80d8
* Windows: Fix a typo in an assertDavid Majnemer2013-10-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192564 91177308-0d34-0410-b5e6-96231b3b80d8
* Windows: Don't bother with pinning Kernel32.dllDavid Majnemer2013-10-14
| | | | | | | We don't delay load it so it shouldn't be going anywhere. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192561 91177308-0d34-0410-b5e6-96231b3b80d8
* Windows: Use GetModuleHandleEx instead of LoadLibraryDavid Majnemer2013-10-13
| | | | | | | | | | | | | | | | | | | | We were using an anti-pattern of: - LoadLibrary - GetProcAddress - FreeLibrary This is problematic because of several reasons: - We are holding on to pointers into a library we just unloaded. - Calling LoadLibrary results in an increase in the reference count of the library in question and any libraries that it depends on and so-on and so-forth. This is none too quick. Instead, use GetModuleHandleEx with GET_MODULE_HANDLE_EX_FLAG_PIN. This is done because because we didn't bring the reference for the library into existence and therefor shouldn't count on it being around later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192550 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing #include's to cctype when using isdigit/alpha/etc.Will Dietz2013-10-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192519 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix build on Solaris 11.Rafael Espindola2013-10-08
| | | | | | | | | | | | | Patch by Vladimir Voskresensky. The erros were: Path.inc:274:3: error: ‘Dl_info’ was not declared in this scope ... and usr/include/spawn.h:52:14: error: expected ‘,’ or ‘...’ before ‘argv’ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192185 91177308-0d34-0410-b5e6-96231b3b80d8
* Windows: Avoiding resizing, use uninitialized data() insteadDavid Majnemer2013-10-07
| | | | | | | This is ever-so faster but more importantly matches what we have elsewhere. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192137 91177308-0d34-0410-b5e6-96231b3b80d8
* Formally added an explicit enum for DWARF TLS support. No functionality change.Richard Mitton2013-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192118 91177308-0d34-0410-b5e6-96231b3b80d8
* Windows/Process.inc: Fix for +Asserts. &Buf[0] is not guaranteed if size is ↵NAKAMURA Takumi2013-10-07
| | | | | | zero. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192103 91177308-0d34-0410-b5e6-96231b3b80d8
* Windows: Be more explicit with Win32 APIsDavid Majnemer2013-10-07
| | | | | | | | | | | | | This addresses several issues in a similar vein: - Use the Unicode APIs when possible, running nm on clang shows that we only use Unicode APIs except for FormatMessage, CreateSemaphore, and GetModuleHandle. AFAICT, the latter two are coming from MinGW and not LLVM itself. - Make getMainExecutable more resilient. It previously considered return values of zero from ::GetModuleFileNameA to be acceptable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192096 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Revert "Windows: Add support for unicode command lines""David Majnemer2013-10-07
| | | | | | | | This reverts commit r192070 which reverted r192069, I forgot to regenerate the configure scripts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192079 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Windows: Add support for unicode command lines"David Majnemer2013-10-06
| | | | | | | | This is causing MinGW bots to fail. This reverts commit r192069. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192070 91177308-0d34-0410-b5e6-96231b3b80d8
* Windows: Add support for unicode command linesDavid Majnemer2013-10-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The MSVCRT deliberately sends main() code-page specific characters. This isn't too useful to LLVM as we end up converting the arguments to UTF-16 and subsequently attempt to use the result as, for example, a file name. Instead, we need to have the ability to access the Unicode command line and transform it to UTF-8. This has the distinct advantage over using the MSVC-specific wmain() function as our entry point because: - It doesn't work on cygwin. - It only work on MinGW with caveats and only then on certain versions. - We get to keep our entry point as main(). :) N.B. This patch includes fixes to other parts of lib/Support/Windows s.t. we would be able to take advantage of getting the Unicode paths. E.G. clang spawning clang -cc1 would want to give it Unicode arguments. Reviewers: aaron.ballman, Bigcheese, rnk, ruiu Reviewed By: rnk CC: llvm-commits, ygao Differential Revision: http://llvm-reviews.chandlerc.com/D1834 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192069 91177308-0d34-0410-b5e6-96231b3b80d8
* raw_fd_ostream: Be more verbose about the reason when opening a file fails.Benjamin Kramer2013-10-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191911 91177308-0d34-0410-b5e6-96231b3b80d8
* Add non-blocking Wait() for launched processesTareq A. Siraj2013-10-01
| | | | | | | | | | | | | | | | | | - 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191763 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove several unused variables.Rafael Espindola2013-10-01
| | | | | | Patch by Alp Toker. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191757 91177308-0d34-0410-b5e6-96231b3b80d8
* SourceMgr diagnotics printing: fix a bug where printing a fixit for a sourceDmitri Gribenko2013-09-27
| | | | | | | | range that includes a tab character will cause out-of-bounds access to the fixit string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191563 91177308-0d34-0410-b5e6-96231b3b80d8
* Make SourceMgr::PrintMessage() testable and add unit testsDmitri Gribenko2013-09-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191558 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide basic type safety for array_pod_sort comparators.Benjamin Kramer2013-09-22
| | | | | | | | This makes using array_pod_sort significantly safer. The implementation relies on function pointer casting but that should be safe as we're dealing with void* here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191175 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: GDBIndexEntry*String conversion functions now return const char* ↵David Blaikie2013-09-20
| | | | | | | | | for easy llvm::formating This was previously invoking UB by passing a user-defined type to format. Thanks to Jordan Rose for pointing this out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191060 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Improve IR annotation comments for GNU pubthings.David Blaikie2013-09-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191043 91177308-0d34-0410-b5e6-96231b3b80d8
* Unshift the GDB index/GNU pubnames constants modified in r191025David Blaikie2013-09-19
| | | | | | | | | | | | Based on code review feedback from Eric Christopher, unshifting these constants as they can appear in the gdb_index itself, shifted a further 24 bits. This means that keeping them preshifted is a bit inflexible, so let's not do that. Given the motivation, wrap up some nicer enums, more type safety, and some utility functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191035 91177308-0d34-0410-b5e6-96231b3b80d8