summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* clang-format: Add option to suppress operator alignment.Daniel Jasper2014-12-026-8/+96
| | | | | | | | | | | | | | | | With alignment: int aaaaaa = aa + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb * cccccccccccccccccccccccccccccccc; Without alignment: int aaaaaa = aa + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb * cccccccccccccccccccccccccccccccc; This fixes llvm.org/PR21666. llvm-svn: 223117
* [NVPTX] Fix type error for some builtins in BuiltinsNVPTX.defJustin Holewinski2014-12-022-15/+17
| | | | llvm-svn: 223116
* Remove unused function.Asiri Rathnayake2014-12-022-12/+0
| | | | | | | | | Removing an unused function which is causing one of the build bots to fail. This was introduced in the commit r223113. A proper cleanup of the so_imm tblgen defintion (made redundant by the mod_imm definition) needs to happen soon. llvm-svn: 223115
* Emit warning if define or undef reserved identifier or keyword.Serge Pavlov2014-12-028-2/+115
| | | | | | | | | | | | | | | | | | | | | Summary: This change implements warnings if macro name is identical to a keyword or reserved identifier. The warnings are different depending on the "danger" of the operation. Defining macro that replaces a keyword is on by default. Other cases produce warning that is off by default but can be turned on using option -Wreserved-id-macro. This change fixes PR11488. Reviewers: rnk Reviewed By: rnk Subscribers: rnk, cfe-commits Differential Revision: http://reviews.llvm.org/D6194 llvm-svn: 223114
* Add support for ARM modified-immediate assembly syntax.Asiri Rathnayake2014-12-0211-42/+690
| | | | | | | | | | | | | | | | | | | | Certain ARM instructions accept 32-bit immediate operands encoded as a 8-bit integer value (0-255) and a 4-bit rotation (0-30, even). Current ARM assembly syntax support in LLVM allows the decoded (32-bit) immediate to be specified as a single immediate operand for such instructions: mov r0, #4278190080 The ARMARM defines an extended assembly syntax allowing the encoding to be made more explicit, as in: mov r0, #255, #8 ; (same 32-bit value as above) The behaviour of the two instructions can be different w.r.t flags, which is documented under "Modified immediate constants" in ARMARM. This patch enables support for this extended syntax at the MC layer. llvm-svn: 223113
* Add ARM relocations to ELFYAMLWill Newton2014-12-021-0/+3
| | | | | | Tested with check-all with no regressions. llvm-svn: 223112
* clang-format: precedence-based indentation when breaking before operators.Daniel Jasper2014-12-022-21/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa == aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > ccccccccccccccccccccccccccccccccccccccccc; After: bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa == aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > ccccccccccccccccccccccccccccccccccccccccc; Not particularly pretty, but can probably help to uncover bugs. And if this bugs somebody, parentheses can help. llvm-svn: 223111
* Emit Tag_ABI_FP_denormal correctly in fast-math mode.Charlie Turner2014-12-023-45/+255
| | | | | | | | | | | | | | | | | | | | The default ARM floating-point mode does not support IEEE 754 mode exactly. Of relevance to this patch is that input denormals are flushed to zero. The way in which they're flushed to zero depends on the architecture, * For VFPv2, it is implementation defined as to whether the sign of zero is preserved. * For VFPv3 and above, the sign of zero is always preserved when a denormal is flushed to zero. When FP support has been disabled, the strategy taken by this patch is to assume the software support will mirror the behaviour of the hardware support for the target *if it existed*. That is, for architectures which can only have VFPv2, it is assumed the software will flush to positive zero. For later architectures it is assumed the software will flush to zero preserving sign. Change-Id: Icc5928633ba222a4ba3ca8c0df44a440445865fd llvm-svn: 223110
* [signext.ll] Removal Of Duplicate Test CasesSonam Kumari2014-12-021-18/+9
| | | | | | Removed the duplicate test case existing in signext.ll file. llvm-svn: 223109
* Re-apply "Revert r166370 and r166540 now that Xcode 4.6 has been available ↵Bob Wilson2014-12-022-7/+0
| | | | | | | | | | | for a while." This reverts commit r176892. I had reverted this a while back to give Chromium more time to update, and Nico says it should be OK now. llvm-svn: 223108
* clang/test/Modules/malformed.cpp REQUIRES shell due to "cd".NAKAMURA Takumi2014-12-021-0/+2
| | | | llvm-svn: 223107
* CMake: make the regexes used for setting HOST_LINK_VERSION more forgiving ↵Hans Wennborg2014-12-021-1/+1
| | | | | | | | | | | | | (PR21268) If the output of 'ld -v' didn't match the regexes, CMake would previously error with a message like: CMake Error at tools/clang/CMakeLists.txt:269 (string): string sub-command REGEX, mode REPLACE regex "[^0-9]*([0-9.]*).*" matched an empty string. llvm-svn: 223106
* Try to fix the MSVC build.Hans Wennborg2014-12-022-11/+10
| | | | llvm-svn: 223105
* [mach-o] Fix TrieEdge leakNick Kledzik2014-12-021-5/+6
| | | | | | | | In PR21682 Jean-Daliel Dupas found a leak in the trie builder and suggested a fix was to use a list instead of SmallVector so that the list elements could be allocated in the BumpPtrAllocator. llvm-svn: 223104
* [mach-o] add support for arm64 compact unwind infoNick Kledzik2014-12-022-11/+348
| | | | | | | Tim previously added generic compact unwind processing and x86_64 support. This patch adds arm64 support. llvm-svn: 223103
* Rely on fewer features of the 'env' command. Darwin only supports '-i'.Chandler Carruth2014-12-021-2/+2
| | | | | | | I'm explicitly setting LC_ALL=C somewhat for documentation, but hopefully this also removes some host variation from the test results. llvm-svn: 223102
* Fix variable used only in assertion.Nick Lewycky2014-12-021-1/+2
| | | | llvm-svn: 223101
* Add a test that ensures the Clang driver behaves itself when the PATHChandler Carruth2014-12-021-0/+25
| | | | | | | | environment variable is changed to strange things out from under it. Prior to r223099 in LLVM, these test cases would crash in various ways (assert fails, stack exhaustion, etc.). llvm-svn: 223100
* Fix several bugs in r221220's new program finding code.Chandler Carruth2014-12-022-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | In both the Unix and Windows variants, std::getenv was called and the result passed directly to a function accepting a StringRef. This isn't OK because it might return a null pointer and that causes the StringRef constructor to assert (and generally produces crash-prone code if asserts are disabled). Fix this by independently testing the result as non-null prior to splitting things. This in turn uncovered another bug in the Unix variant where it would infinitely recurse if PATH="", or after this fix if PATH isn't set. There is no need to recurse at all. Slightly re-arrange the code to make it clear that we can just fixup the Paths argument based on the environment if we find anything. I don't know of a particularly useful way to test these routines in LLVM. I'll commit a test to Clang that ensures that its driver correctly handles various settings of PATH. However, I have no idea how to correctly write a Windows test for the PATHEXT change. Any Windows developers who could provide such a test, please have at. =D Many thanks to Nick Lewycky and others for helping debug this. =/ It was quite nasty for us to track down. llvm-svn: 223099
* Update and simplify to match Clang r223095.Richard Smith2014-12-021-14/+3
| | | | llvm-svn: 223098
* Remove special case for aarch64 static vs. PIC code in iOS kernel code.Bob Wilson2014-12-023-4/+4
| | | | | | | | | | I added this check a while back but then made a note to myself that it should be completely unnecessary since iOS always uses PIC code-gen for aarch64. Since I could never come up with any reason why it would be necessary, I'm just going to remove it and we'll see if anything breaks. rdar://problem/13627985 llvm-svn: 223097
* Fix the behavior of ${current-pc-arrow} in the default disassemblyJason Molenda2014-12-022-7/+15
| | | | | | | | | | | | format for the not-current-stack-frame. This was causing test/functionalities/inferior-assert to fail. Also document the new additions to the format specifications used in the disassembly-format changes to formats.html. <rdar://problem/19102757> llvm-svn: 223096
* [modules] Track how 'header' directives were written in module map files,Richard Smith2014-12-0213-144/+238
| | | | | | | | | | | | | rather than trying to extract this information from the FileEntry after the fact. This has a number of beneficial effects. For instance, diagnostic messages for failed module builds give a path relative to the "module root" rather than an absolute file path, and the contents of the module includes file is no longer dependent on what files the including TU happened to inspect prior to triggering the module build. llvm-svn: 223095
* Add override specifiers to Symbolizer methods. NFC.Alexey Samsonov2014-12-012-10/+10
| | | | llvm-svn: 223094
* Simplify pointer comparisons involving memory allocation functionsHal Finkel2014-12-012-0/+143
| | | | | | | | | | | | | System memory allocation functions, which are identified at the IR level by the noalias attribute on the return value, must return a pointer into a memory region disjoint from any other memory accessible to the caller. We can use this property to simplify pointer comparisons between allocated memory and local stack addresses and the addresses of global variables. Neither the stack nor global variables can overlap with the region used by the memory allocator. Fixes PR21556. llvm-svn: 223093
* Try to fix a bot failure due to a variable used only in an assert.Philip Reames2014-12-011-4/+4
| | | | | | Specifically, bot lld-x86_64-darwin13. Resulting from change 223085. llvm-svn: 223092
* Fix several test failures on Linux/FreeBSD caused by compiler configuration ↵Oleksiy Vyalov2014-12-013-55/+55
| | | | | | | | and invalid environment - make lldbtest.registerSharedLibrariesWithTarget to support multiple platforms. http://reviews.llvm.org/D6392 llvm-svn: 223091
* Perform correct lookup when '__super' is used in class with dependent base.Nikola Smiljanic2014-12-015-13/+36
| | | | llvm-svn: 223090
* Enable enabling and disabling breakpoints on Windows.Zachary Turner2014-12-012-0/+15
| | | | llvm-svn: 223089
* Link test executables with LLD on Windows.Zachary Turner2014-12-011-1/+9
| | | | | | | | | | Clang generates DWARF debug info with section names longer than 8 characters. This is only supported by an extension to PE/COFF which the MSVC linker doesn't implement. So trying to link DWARF-enabled object files with MSVC will lead to corrupt debug information in the executable. llvm-svn: 223088
* Only normalize FileSpec paths *after* resolving them.Zachary Turner2014-12-011-2/+6
| | | | | | | Normalizing paths before resolving them can cause the path to become denormalized after resolution. llvm-svn: 223087
* Make -fuse-ld=lld work properly on Windows.Zachary Turner2014-12-012-4/+23
| | | | | | | | | | | | Using lld on Windows requires calling link-lld.exe instead of lld.exe. This patch puts this knowledge into clang so that when using the GCC style clang driver, it can properly delegate to lld. Differential Revision: http://reviews.llvm.org/D6428 Reviewed by: Reid Kleckner, Rui Ueyama llvm-svn: 223086
* [Statepoints 2/4] Statepoint infrastructure for garbage collection: MI & ↵Philip Reames2014-12-0114-5/+263
| | | | | | | | | | | | | | x86-64 Backend This is the second patch in a small series. This patch contains the MachineInstruction and x86-64 backend pieces required to lower Statepoints. It does not include the code to actually generate the STATEPOINT machine instruction and as a result, the entire patch is currently dead code. I will be submitting the SelectionDAG parts within the next 24-48 hours. Since those pieces are by far the most complicated, I wanted to minimize the size of that patch. That patch will include the tests which exercise the functionality in this patch. The entire series can be seen as one combined whole in http://reviews.llvm.org/D5683. The STATEPOINT psuedo node is generated after all gc values are explicitly spilled to stack slots. The purpose of this node is to wrap an actual call instruction while recording the spill locations of the meta arguments used for garbage collection and other purposes. The STATEPOINT is modeled as modifing all of those locations to prevent backend optimizations from forwarding the value from before the STATEPOINT to after the STATEPOINT. (Doing so would break relocation semantics for collectors which wish to relocate roots.) The implementation of STATEPOINT is closely modeled on PATCHPOINT. Eventually, much of the code in this patch will be removed. The long term plan is to merge the functionality provided by statepoints and patchpoints. Merging their implementations in the backend is likely to be a good starting point. Reviewed by: atrick, ributzka llvm-svn: 223085
* The register keyword is deprecated in C++11, so clang complains strongly ↵Enrico Granata2014-12-011-1/+1
| | | | | | about swig generating register declarations. Abuse the preprocessor to define the keyword away llvm-svn: 223084
* lldb can deadlock when launched with an non-existing executable:Greg Clayton2014-12-012-13/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | % lldb /bin/nonono (lldb) target create "/bin/nonono" error: unable to find executable for '/usr/bin/nonono' <deadlock> The problem was the initial commands 'target create "/bin/nonono"' were put into a pipe and the command interpreter was being run with: void CommandInterpreter::RunCommandInterpreter(bool auto_handle_events, bool spawn_thread, CommandInterpreterRunOptions &options) { // Always re-create the command intepreter when we run it in case // any file handles have changed. bool force_create = true; m_debugger.PushIOHandler(GetIOHandler(force_create, &options)); m_stopped_for_crash = false; if (auto_handle_events) m_debugger.StartEventHandlerThread(); if (spawn_thread) { m_debugger.StartIOHandlerThread(); } else { m_debugger.ExecuteIOHanders(); if (auto_handle_events) m_debugger.StopEventHandlerThread(); } } If "auto_handle_events" was set to true and "spawn_thread" was false, we would execute: m_debugger.StartEventHandlerThread(); m_debugger.ExecuteIOHanders(); m_debugger.StopEventHandlerThread(); The problem was there was no synchonization in Debugger::StartEventHandlerThread() to ensure the event handler was listening to events and the the call to "m_debugger.StopEventHandlerThread()" would do: void Debugger::StopEventHandlerThread() { if (m_event_handler_thread.IsJoinable()) { GetCommandInterpreter().BroadcastEvent(CommandInterpreter::eBroadcastBitQuitCommandReceived); m_event_handler_thread.Join(nullptr); } } The problem was that the event thread might not be listening for the CommandInterpreter::eBroadcastBitQuitCommandReceived event yet. The solution is to make sure the Debugger::DefaultEventHandler() is listening to events before we return from Debugger::StartEventHandlerThread(). Once we have this synchonization we remove the race condition. This fixes radar: <rdar://problem/19041192> llvm-svn: 223083
* Added a new regular expression to the "_regexp-break" command ("b" by default):Greg Clayton2014-12-011-0/+1
| | | | | | | | | | (lldb) b /break here/ This will set a source level regular expression breakpoint on any text between the first '/' and the last '/'. The equivalent command will be: (lldb) breakpoint set --source-pattern-regexp 'break here' llvm-svn: 223082
* Added StringExtractor::DecodeHexU8 && GetHexBytesAvailVince Harron2014-12-013-69/+222
| | | | | | | | | DecodeHexU8 returns a decoded hex character pair, returns -1 if a valid hex pair is not available. GetHexBytesAvail decodes all available hex pairs. llvm-svn: 223081
* StringExtractor unit testsVince Harron2014-12-013-0/+296
| | | | | | | Unit tests to cover StringExtractor in advance of minor new functionality & minor refactor llvm-svn: 223080
* Use nullptr to silence -Wsentinel when self-hosting on WindowsReid Kleckner2014-12-0110-52/+52
| | | | | | | | | | | Richard rejected my Sema change to interpret an integer literal zero in a varargs context as a null pointer, so -Wsentinel sees an integer literal zero and fires off a warning. Only CodeGen currently knows that it promotes integer literal zeroes in this context to pointer size on Windows. I didn't want to teach -Wsentinel about that compatibility hack. Therefore, I'm migrating to C++11 nullptr. llvm-svn: 223079
* [Statepoints 1/4] Statepoint infrastructure for garbage collection: IR ↵Philip Reames2014-12-014-0/+151
| | | | | | | | | | | | | | Intrinsics The statepoint intrinsics are intended to enable precise root tracking through the compiler as to support garbage collectors of all types. The addition of the statepoint intrinsics to LLVM should have no impact on the compilation of any program which does not contain them. There are no side tables created, no extra metadata, and no inhibited optimizations. A statepoint works by transforming a call site (or safepoint poll site) into an explicit relocation operation. It is the frontend's responsibility (or eventually the safepoint insertion pass we've developed, but that's not part of this patch series) to ensure that any live pointer to a GC object is correctly added to the statepoint and explicitly relocated. The relocated value is just a normal SSA value (as seen by the optimizer), so merges of relocated and unrelocated values are just normal phis. The explicit relocation operation, the fact the statepoint is assumed to clobber all memory, and the optimizers standard semantics ensure that the relocations flow through IR optimizations correctly. This is the first patch in a small series. This patch contains only the IR parts; the documentation and backend support will be following separately. The entire series can be seen as one combined whole in http://reviews.llvm.org/D5683. Reviewed by: atrick, ributzka llvm-svn: 223078
* [NVPTX] Do not emit .weak symbols for NVPTXJingyue Wu2014-12-015-3/+16
| | | | | | | | | | | | | | | | | | | Summary: ".weak" symbols cannot be consumed by ptxas (PR21685). This patch makes the weak directive in MCAsmPrinter customizable, and disables emitting ".weak" symbols for NVPTX. Test Plan: weak-linkage.ll Reviewers: jholewinski Reviewed By: jholewinski Subscribers: majnemer, jholewinski, llvm-commits Differential Revision: http://reviews.llvm.org/D6455 llvm-svn: 223077
* Parse 'ghccc' in .ll files as the GHC convention (cc 10)Reid Kleckner2014-12-0112-28/+40
| | | | | | | Previously we just used "cc 10" in the .ll files, but that isn't very human readable. llvm-svn: 223076
* [AArch64] Don't combine "select (setcc i1 LHS, RHS), vL, vR".Ahmed Bougacha2014-12-012-0/+21
| | | | | | | | | | | | | r208210 introduced an optimization that improves the vector select codegen by doing the setcc on vectors directly. This is a problem they the setcc operands are i1s, because the optimization would create vectors of i1, which aren't legal. Part of PR21549. Differential Revision: http://reviews.llvm.org/D6308 llvm-svn: 223075
* [AArch64] Fix v2i8->i16 bitcast legalization.Ahmed Bougacha2014-12-012-5/+19
| | | | | | | | | | | | | | | r213378 improved f16 bitcasts, so that they go directly through subregs, instead of through the stack. That code now causes an assertion failure for bitcasts from other 16-bits types (most importantly v2i8). Correct that by doing the custom lowering for i16 bitcasts only when the input is an f16. Part of PR21549. Differential Revision: http://reviews.llvm.org/D6307 llvm-svn: 223074
* [Core] Remove function to not override RoundTripPasses.Shankar Easwaran2014-12-012-5/+1
| | | | | | | | | RoundTripPasses should always be called in DEBUG mode if the environment variable "LLD_RUN_ROUNDTRIP_TEST" is set. Flavors should not be able to override this behavior. llvm-svn: 223073
* [OCaml] Move Llvm.clone_module to its own Llvm_transform_utils module.Peter Zotov2014-12-0115-7/+117
| | | | | | | This way most code won't link this (substantially large) library, if compiled statically with LLVM. llvm-svn: 223072
* [OCaml] [cmake] Add CMake buildsystem for OCaml.Peter Zotov2014-12-0124-2/+507
| | | | | | Closes PR15325. llvm-svn: 223071
* libc++: add NaCl and PNaCl support for std::random_deviceJF Bastien2014-12-014-38/+118
| | | | | | | | | | | | | | | | | Summary: The NaCl sandbox doesn't allow opening files under /dev, but it offers an API which provides the same capabilities. This is the same random device emulation that nacl_io performs for POSIX support, but nacl_io is an optional library so libc++ can't assume that device emulation will be performed. Note that NaCl only supports /dev/urandom, not /dev/random. This patch also cleans up some of the preprocessor #endif, and fixes the test for Win32 (it accepts any token, and would therefore never throw regardless of the token provided). Test Plan: ninja check-libcxx Reviewers: dschuff, mclow.lists, danalbert Subscribers: jfb, cfe-commits Differential Revision: http://reviews.llvm.org/D6442 llvm-svn: 223068
* Use a continue to reduce indentation and clang-format. NFC.Rafael Espindola2014-12-011-21/+24
| | | | llvm-svn: 223067
* Use a range loop. NFC.Rafael Espindola2014-12-011-3/+3
| | | | llvm-svn: 223066
OpenPOWER on IntegriCloud