summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* AArch64: use less cluttered intrinsic for vtbl/vtbxTim Northover2014-02-261-6/+2
| | | | | | | The table is always 128-bit so there's no reason to specify it every time we want the intrinsic. llvm-svn: 202259
* AArch64: simplify tbl/tbx polymorphismTim Northover2014-02-262-100/+100
| | | | | | | | | The table argument is always 128-bit (and interpreted as <16 x i8>) so the extra specifier for it is just clutter. No user-visible behaviour change, so no tests. llvm-svn: 202258
* ARMv8 IfConversion must skip narrow instructions that a) define CPSR and b) ↵Artyom Skrobov2014-02-264-16/+139
| | | | | | wouldn't affect CPSR in an IT block llvm-svn: 202257
* Stop test/CodeGen/ARM/a15.ll targetting non-ARM targets.Daniel Sanders2014-02-261-1/+1
| | | | | | | | | | | | | | | | | Summary: Fixes an issue where a test attempts to use -mcpu=cortex-a15 on non-ARM targets. This triggers an assertion on MIPS since it doesn't know what ABI to use by default for unrecognized processors. Reviewers: rengolin Reviewed By: rengolin CC: llvm-commits, aemerson, rengolin Differential Revision: http://llvm-reviews.chandlerc.com/D2876 llvm-svn: 202256
* Add a StmtPrinter test for implicit and explicit conversion operator calls.Benjamin Kramer2014-02-262-5/+52
| | | | | | Put back a comment that I removed too aggressively. llvm-svn: 202255
* Fix typoTobias Grosser2014-02-261-1/+1
| | | | llvm-svn: 202254
* [mips] Treat -mcpu=generic the same way as an empty CPU string.Daniel Sanders2014-02-262-2/+2
| | | | | | | | | | | | | | | | | Summary: This should fix the MCJIT unit tests that were broken by r201792 on the MIPS buildbot. MIPS currently uses the default implementation of sys::getHostCPUName() which always returns "generic". For now, we will accept "generic" and coerce it to "mips32" or "mips64" depending on the target architecture like we do for empty CPU names. Reviewers: jacksprat, matheusalmeida Reviewed By: jacksprat Differential Revision: http://llvm-reviews.chandlerc.com/D2878 llvm-svn: 202253
* [SROA] Use the correct index integer size in GEPs through non-defaultChandler Carruth2014-02-262-6/+11
| | | | | | | | | | | address spaces. This isn't really a correctness issue (the values are truncated) but its much cleaner. Patch by Matt Arsenault! llvm-svn: 202252
* Add two helpers to IRBuilder to flesh the interface out to N-widthChandler Carruth2014-02-261-0/+11
| | | | | | integers. Complements the interfaces it is wrapping. llvm-svn: 202251
* [asan] Fix printing of long reports to logcat on Android.Evgeniy Stepanov2014-02-261-1/+12
| | | | | | | __android_log_write has an implicit message length limit. Print one line at a time. llvm-svn: 202250
* [sanitizer] Add a flag to enable/disable report colorization.Evgeniy Stepanov2014-02-265-1/+15
| | | | llvm-svn: 202249
* [PECOFF] Emit Load Configuration and SEH Table for x86.Rui Ueyama2014-02-2610-5/+589
| | | | | | | | | | | | | | | | | | | | | | | | | | If all input files are compatible with Structured Exception Handling, linker is supposed to create an exectuable with a table for SEH handlers. The table consists of exception handlers entry point addresses. The basic idea of SEH in x86 Microsoft ABI is to list all valid entry points of exception handlers in an read-only memory, so that an attacker cannot override the addresses in it. In x86 ABI, data for exception handling is mostly on stack, so it's volnerable to stack overflow attack. In order to protect against it, Windows runtime uses the table to check a return address, to ensure that the address is really an valid entry point for an exception handler. Compiler emits a list of exception handler functions to .sxdata section. It also emits a marker symbol "@feat.00" to indicate that the object is compatible with SEH. SEH is a relatively new feature for COFF, and mixing SEH-compatible and SEH-incompatible objects will result in an invalid executable, so is the marker. If all input files are compatible with SEH, LLD emits a SEH table. SEH table needs to be pointed by Load Configuration strucutre, so when emitting a SEH table LLD emits it too. The address of a Load Configuration will be stored to the file header. llvm-svn: 202248
* [SROA] Teach SROA how to handle pointers from address spaces other thanChandler Carruth2014-02-264-10/+149
| | | | | | | | | | | | | | | the default. Based on the patch by Matt Arsenault, D1764! I switched one place to use the more direct pointer type to compute the desired address space, and I reworked the memcpy rewriting section to reflect significant refactorings that this patch helped inspire. Thanks to several of the folks who helped review and improve the patch as well. llvm-svn: 202247
* [asan] asan_device_setup: fix a typo in usage textEvgeniy Stepanov2014-02-261-2/+2
| | | | llvm-svn: 202246
* [asan] Remove .sh extension from asan_device_setup.Evgeniy Stepanov2014-02-261-1/+1
| | | | llvm-svn: 202245
* Revert r201783 until all FreeBSD fixes are submitted.Alexey Samsonov2014-02-261-4/+2
| | | | llvm-svn: 202244
* Suppress python readline module under Linux to fix a seg fault.Todd Fiala2014-02-2610-1/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug fix for pr18841: http://llvm.org/bugs/show_bug.cgi?id=18841 This change creates a stub Python readline.so module that does almost nothing. Its whole purpose is to prevent Python from loading the real module, something it does during the embedded Python interpreter's initialization sequence (and way before lldb ever requests it within embedded_interpreter.py). On Ubuntu 12.04 and 13.10 x86_64, and in the Python 2.7.6 tree, the stock Python readline module links against the GNU readline library. This appears to be the case on all Pythons except where __APPLE__ is defined. LLDB now requires linking against the libedit library. Something about having both libedit.so and libreadline.so linked into the same process space is causing the Python readline.so to trigger a NULL memory access. I have put in a separate patch to python.org. This suppression of embedded interpreter readline support can be removed if at least any one of the following happens: 1. The stock python distribution accepts a patch similar to what I submitted to Python 2.7.6's Modules/readline.c file. 2. The stock python distribution implements Modules/readline.c in terms of libedit's readline compatibility mode (i.e. essentially compiles it the way __APPLE__ compiles that module) under Linux. 3. a clean-room implementation of the python readline module is implemented against libedit (either readline compatibility mode or native libedit). This could be implemented within the readline.cpp file that this change introduces. It cannot be a fork of python's readline.c module due to llvm licensing. The net effect of this change on Linux is that the embedded python's readline support will not exist. llvm-svn: 202243
* [SROA] Split the alignment computation complete for the memcpy rewritingChandler Carruth2014-02-262-16/+32
| | | | | | | | | | | | | to work independently for the slice side and the other side. This allows us to only compute the minimum of the two when we actually rewrite to a memcpy that needs to take the minimum, and preserve higher alignment for one side or the other when rewriting to loads and stores. This fix was inspired by seeing the result of some refactoring that makes addrspace handling better. llvm-svn: 202242
* [CMake] Use target_link_libraries(INTERFACE|PRIVATE) on CMake-2.8.12 to ↵NAKAMURA Takumi2014-02-266-7/+20
| | | | | | | | | | | | | | | | | | increase opportunity for parallel build. target_link_libraries(INTERFACE) doesn't bring inter-target dependencies in add_library, although final targets have dependencies to whole dependent libraries. It makes most libraries can be built in parallel. target_link_libraries(PRIVATE) is used to shaared library. Each dependent library is linked to the target.so, and its user will not see its grandchildren. For example, - libclang.so has sufficient libclang*.a(s). - c-index-test requires just only libclang.so. FIXME: lld is tweaked minimally. Adding INTERFACE in each library would be better thing. llvm-svn: 202241
* [x86] Add same itinerary to SYSEXIT64 as SYSEXIT for consistency.Craig Topper2014-02-261-2/+2
| | | | llvm-svn: 202240
* [CMake] Introduce cmake_policy(CMP0022) for ↵NAKAMURA Takumi2014-02-264-0/+57
| | | | | | | | | | | | target_link_libraries(INTERFACE|PRIVATE). For now, use both keywords, INTERFACE and PRIVATE via the variable, - ${cmake_2_8_12_INTERFACE} - ${cmake_2_8_12_PRIVATE} They could be cleaned up when we introduce 2.8.12. llvm-svn: 202239
* [CMake] Use LINK_LIBS instead of target_link_libraries().NAKAMURA Takumi2014-02-2631-76/+58
| | | | llvm-svn: 202238
* [CMake] Apply DEPENDS intrinsics_gen in clangCodeGen.NAKAMURA Takumi2014-02-261-0/+3
| | | | llvm-svn: 202237
* lldReaderWriter: move LLVM_LINK_COMPONENTS. It seems Subdirectories don't ↵NAKAMURA Takumi2014-02-261-2/+3
| | | | | | | | depend on LLVMObject. Please give LLVMObject explicitly in each subdirectory if any of subdirectories required it. llvm-svn: 202236
* [CMake] Declare cmake_minimum_required() unconditionally.NAKAMURA Takumi2014-02-261-2/+1
| | | | llvm-svn: 202235
* [x86] Remove some unused instruction format classes.Craig Topper2014-02-261-12/+0
| | | | llvm-svn: 202234
* [x86] Simplify disassembler code slightly.Craig Topper2014-02-262-8/+12
| | | | llvm-svn: 202233
* [SROA] The original refactoring inspired by the addrspace patch inChandler Carruth2014-02-261-21/+21
| | | | | | | | | | | | | | | | | | | | | | D1764, which in turn set off the other refactorings to make 'getSliceAlign()' a sensible thing. There are two possible inputs to the required alignment of a memory transfer intrinsic: the alignment constraints of the source and the destination. If we are *only* introducing a (potentially new) offset onto one side of the transfer, we don't need to consider the alignment constraints of the other side. Use this to simplify the logic feeding into alignment computation for unsplit transfers. Also, hoist the clamp of the magical zero alignment for these intrinsics to the more customary one alignment early. This lets several other conditions melt away. No functionality changed. There is a further improvement this exposes which *will* change functionality, but that's arriving in a separate patch. llvm-svn: 202232
* [SROA] Yet another slight refactoring that simplifies an API in theChandler Carruth2014-02-261-20/+19
| | | | | | | | | | | | | | | | rewriting logic: don't pass custom offsets for the adjusted pointer to the new alloca. We always passed NewBeginOffset here. Sometimes we spelled it BeginOffset, but only when they were in fact equal. Whats worse, the API is set up so that you can't reasonably call it with anything else -- it assumes that you're passing it an offset relative to the *original* alloca that happens to fall within the new one. That's the whole point of NewBeginOffset, it's the clamped beginning offset. No functionality changed. llvm-svn: 202231
* [SROA] Simplify the computing of alignment: we only ever need theChandler Carruth2014-02-261-30/+16
| | | | | | | | | | | | | | | alignment of the slice being rewritten, not any arbitrary offset. Every caller is really just trying to compute the alignment for the whole slice, never for some arbitrary alignment. They are also just passing a type when they have one to see if we can skip an explicit alignment in the IR by using the type's alignment. This makes for a much simpler interface. Another refactoring inspired by the addrspace patch for SROA, although only loosely related. llvm-svn: 202230
* [SROA] Use NewOffsetBegin in the unsplit case for memset merely forChandler Carruth2014-02-261-3/+4
| | | | | | | | | | | | | | | | | consistency with memcpy rewriting, and fix a latent bug in the alignment management for memset. The alignment issue is that getAdjustedAllocaPtr is computing the *relative* offset into the new alloca, but the alignment isn't being set to the relative offset, it was using the the absolute offset which is into the old alloca. I don't think its possible to write a test case that actually reaches this code where the resulting alignment would be observably different, but the intent was clearly to use the relative offset within the new alloca. llvm-svn: 202229
* [SROA] Use the members for New{Begin,End}Offset in the rewrite helpersChandler Carruth2014-02-261-14/+8
| | | | | | | | | | | | | | | rather than passing them as arguments. While I generally prefer actual arguments, in this case the readability loss is substantial. By using members we avoid repeatedly calculating the offsets, and once we're using members it is useful to ensure that those names *always* refer to the original-alloca-relative new offset for a rewritten slice. No functionality changed. Follow-up refactoring, all toward getting the address space patch merged. llvm-svn: 202228
* [SROA] Compute the New{Begin,End}Offset values once for each allocaChandler Carruth2014-02-261-40/+24
| | | | | | | | | | | | | | slice being rewritten. We had the same code scattered across most of the visits. Instead, compute the new offsets and the slice size once when we start to visit a particular slice, and use the member variables from then on. This reduces quite a bit of code duplication. No functionality changed. Refactoring inspired to make it easier to apply the address space patch to SROA. llvm-svn: 202227
* clang/test/CodeGenCXX/debug-info-varargs.cpp: Appease msvc with ↵NAKAMURA Takumi2014-02-261-1/+1
| | | | | | %itanium_abi_triple. llvm-svn: 202226
* Use StringRef in raw_fd_ostream constructorBen Langmuir2014-02-262-4/+3
| | | | llvm-svn: 202225
* [SROA] Fix PR18615 with some long overdue simplifications to the boundsChandler Carruth2014-02-262-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | checking in SROA. The primary change is to just rely on uge for checking that the offset is within the allocation size. This removes the explicit checks against isNegative which were terribly error prone (including the reversed logic that led to PR18615) and prevented us from supporting stack allocations larger than half the address space.... Ok, so maybe the latter isn't *common* but it's a silly restriction to have. Also, we used to try to support a PHI node which loaded from before the start of the allocation if any of the loaded bytes were within the allocation. This doesn't make any sense, we have never really supported loading or storing *before* the allocation starts. The simplified logic just doesn't care. We continue to allow loading past the end of the allocation in part to support cases where there is a PHI and some loads are larger than others and the larger ones reach past the end of the allocation. We could solve this a different and more conservative way, but I'm still somewhat paranoid about this. llvm-svn: 202224
* Remove 'tctx->name' from a logical statement since it is a pointer and alwaysRichard Trieu2014-02-261-1/+1
| | | | | | is converted to a true value. Detected by Clang's improved -Wbool-conversion llvm-svn: 202223
* Remove spurious emacs major mode marker, these should only go on .h files.Nick Lewycky2014-02-261-1/+1
| | | | llvm-svn: 202222
* 80-col.Eric Christopher2014-02-261-1/+2
| | | | llvm-svn: 202221
* Formatting fixups.Eric Christopher2014-02-261-2/+2
| | | | llvm-svn: 202220
* 80-col and bad line ending fixups.Eric Christopher2014-02-261-8/+8
| | | | llvm-svn: 202219
* Delete two declared overloads of CallInst::CallInst that are never defined ↵Nick Lewycky2014-02-261-4/+0
| | | | | | or used. No functionality change. llvm-svn: 202218
* [PECOFF] Add a utility function to add DIR32 relocation.Rui Ueyama2014-02-262-4/+16
| | | | llvm-svn: 202217
* PR16074, implement warnings to catch pointer to boolean true and pointer toRichard Trieu2014-02-2621-96/+393
| | | | | | | | | | | | | | | | | | | | | | | | | | | | null comparison when the pointer is known to be non-null. This catches the array to pointer decay, function to pointer decay and address of variables. This does not catch address of function since this has been previously used to silence a warning. Pointer to bool conversion is under -Wbool-conversion. Pointer to null comparison is under -Wtautological-pointer-compare, a sub-group of -Wtautological-compare. void foo() { int arr[5]; int x; // warn on these conditionals if (foo); if (arr); if (&x); if (foo == null); if (arr == null); if (&x == null); if (&foo); // no warning } llvm-svn: 202216
* [PECOFF] Fix DLLCharacteristics field.Rui Ueyama2014-02-263-5/+5
| | | | | | IMAGE_DLL_CHARACTERISTICS_NO_SEH flag should be set only when SEH is disabled. llvm-svn: 202215
* Implement LWG issue 2306: match_results::reference should be value_type&, ↵Marshall Clow2014-02-263-4/+4
| | | | | | not const value_type&. This is a general move by the LWG to have the reference type of read-only containers be a non-const reference; however, there are no methods that return a non-const reference to a match_result entry, so there's no worries about getting a non-const reference to a constant object. llvm-svn: 202214
* Constify the Optnone checks in IR passes.Paul Robinson2014-02-264-8/+8
| | | | llvm-svn: 202213
* [analyzer] NonNullParamChecker: don't freak out about nested transparent_unions.Jordan Rose2014-02-262-2/+49
| | | | | | | | | For now, just ignore them. Later, we could try looking through LazyCompoundVals, but we at least shouldn't crash. <rdar://problem/16153464> llvm-svn: 202212
* Add -Wabsolute-value, warnings about absolute value functions.Richard Trieu2014-02-267-0/+1200
| | | | | | | | | | | | | | | | | | The warnings fall into three groups. 1) Using an absolute value function of the wrong type, for instance, using the int absolute value function when the argument is a floating point type. 2) Using the improper sized absolute value function, for instance, using abs when the argument is a long long. llabs should be used instead. From these two cases, an implicit conversion will occur which may cause unexpected behavior. Where possible, suggest the proper absolute value function to use, and which header to include if the function is not available. 3) Taking the absolute value of an unsigned value. In addition to this warning, suggest to remove the function call. This usually indicates a logic error since the programmer assumed negative values would have been possible. llvm-svn: 202211
* Simplify base64 routine a bit.Rui Ueyama2014-02-251-2/+2
| | | | llvm-svn: 202210
OpenPOWER on IntegriCloud