summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Do not assume the value passed to memset is an i32.Job Noorman2014-08-292-8/+23
| | | | | | | | | | | | | The code in SelectionDAG::getMemset for some reason assumes the value passed to memset is an i32. This breaks the generated code for targets that only have registers smaller than 32 bits because the value might get split into multiple registers by the calling convention. See the test for the MSP430 target included in the patch for an example. This patch ensures that nothing is assumed about the type of the value. Instead, the type is taken from the selected overload of the llvm.memset intrinsic. llvm-svn: 216716
* unique_ptrify SourceManager::createFileIDDavid Blaikie2014-08-2915-29/+29
| | | | llvm-svn: 216715
* CodeGen: Don't completely mess-up optimized atomic libcallsDavid Majnemer2014-08-293-18/+109
| | | | | | | | | | | | | | | | | | | | | | | Summary: We did a great job getting this wrong: - We messed up which LLVM IR types to use for arguments and return values. The optimized libcalls use integer types for values. Clang attempted to use the IR type which corresponds to the value passed in instead of using an appropriately sized integer type. This would result in violations of the ABI for, as an example, floating point types. - We didn't bother recording the result of the atomic libcall in the destination memory. Instead, call the functions with arguments matching the type of the libcall prototype's parameters. This fixes PR20780. Differential Revision: http://reviews.llvm.org/D5098 llvm-svn: 216714
* unique_ptrify Driver Action handlingDavid Blaikie2014-08-294-80/+97
| | | | | | | | | | | | It hits a limit when we reach ActionList, which is used for dynamic conditional ownership, so we lose type safety there. This did expose at least one caller "lying" about ownership (passing ownership to an Action, then updating the Action to specify that it doesn't actually own the thing that was passed) - changing this to unique_ptr just makes that oddity more obvious. llvm-svn: 216713
* Improve unique_ptr-y ownership in ASTUnit::ComputePreambleDavid Blaikie2014-08-293-54/+48
| | | | | | | | | | | | | | Rather than having a pair of pairs and a reference out parameter, build a structure with everything together and named. A raw pointer and a unique_ptr, rather than a raw pointer and a boolean, are used to communicate ownership transfer. It's possible one day we'll end up with a conditional pointer (probably represented by a raw pointer and a boolean) abstraction to use in places like this. Conditional ownership seems to be coming up more often than I'd hoped... llvm-svn: 216712
* Remove call to llvm::makeArrayRef. Implicit conversion is sufficient.Craig Topper2014-08-291-1/+1
| | | | llvm-svn: 216711
* Use llvm::makeArrayRef instead of explicitly calling ArrayRef constructor ↵Craig Topper2014-08-291-3/+1
| | | | | | and mentioning the type. This works now that we have a conversion from ArrayRef<T*> to ArrayRef<const T*>. llvm-svn: 216710
* Add conversion constructor to convert ArrayRef<T*> to ArrayRef<const T*>. ↵Craig Topper2014-08-291-0/+8
| | | | | | Reviewed with Chandler and David Blaikie. llvm-svn: 216709
* unique_ptrify clang::BackendConsumer::takeModuleDavid Blaikie2014-08-291-2/+2
| | | | llvm-svn: 216707
* [AArch64] Fix some failures exposed by value type v4f16 and v8f16.Jiangning Liu2014-08-293-2/+78
| | | | | | | 1) Add some missing bitcast patterns for v8f16. 2) Add type promotion for operand of ld/st operations. llvm-svn: 216706
* [asan] enable poison_array_cookie backKostya Serebryany2014-08-293-4/+4
| | | | llvm-svn: 216705
* Cleaning up static initializers in Signals.incChris Bieneman2014-08-291-5/+4
| | | | | | Reviewed by: Chandlerc llvm-svn: 216704
* Cleaning up static initializers in TimeValue.Chris Bieneman2014-08-294-18/+22
| | | | | | Code reviewed by Chandlerc llvm-svn: 216703
* call __asan_load_cxx_array_cookie when loading array cookie in asan mode.Kostya Serebryany2014-08-292-6/+16
| | | | | | | | | | | | | | | | | | Summary: The current implementation of asan cookie is incorrect: we add nosanitize metadata to the cookie load, but the metadata may be lost and we will instrument the load from poisoned memory. This change replaces the load with a call to __asan_load_cxx_array_cookie (r216692) Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5111 llvm-svn: 216702
* Introduce -DLLVM_USE_SANITIZER=Undefined CMake option to build UBSan-ified ↵Alexey Samsonov2014-08-294-4/+8
| | | | | | | | | version of LLVM/Clang. I've fixed most of the simple bugs and currently "check-llvm" test suite has 26 failures, and "check-clang" suite has 5 failures. llvm-svn: 216701
* [FastISel][AArch64] Don't fold instructions that are not in the same basic ↵Juergen Ributzka2014-08-292-23/+92
| | | | | | | | | | | | | | | block. This fix checks first if the instruction to be folded (e.g. sign-/zero-extend, or shift) is in the same machine basic block as the instruction we are folding into. Not doing so can result in incorrect code, because the value might not be live-out of the basic block, where the value is defined. This fixes rdar://problem/18169495. llvm-svn: 216700
* Better codegen support for DLL attributes being dropped after the first ↵Hans Wennborg2014-08-292-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | declaration (PR20792) For the following code: __declspec(dllimport) int f(int x); int user(int x) { return f(x); } int f(int x) { return 1; } Clang will drop the dllimport attribute in the AST, but CodeGen would have already put it on the LLVM::Function, and that would never get updated. (The same thing happens for global variables.) This makes Clang check dropped DLL attribute case each time the LLVM object is referenced. This isn't perfect, because we will still get it wrong if the function is never referenced by codegen after the attribute is dropped, but this handles the common cases and makes us not fail in the verifier. llvm-svn: 216699
* Revert two GEP-related InstCombine commitsDavid Majnemer2014-08-292-98/+11
| | | | | | | This reverts commit r216523 and r216598; people have reported regressions. llvm-svn: 216698
* Don't create a null reference in ASTUnit::LoadFromCommandLine.Alexey Samsonov2014-08-281-2/+3
| | | | | | | | | This change is the last in the pack of five commits (also see r216691, r216694, r216695, and r216696) that reduces the number of test failures in "check-clang" invocation in UBSan bootstrap from 2443 down to 5. llvm-svn: 216697
* Don't load invalid enum value in Sema::LazilyCreateBuiltin.Alexey Samsonov2014-08-281-10/+8
| | | | | | This bug was reported by UBSan. llvm-svn: 216696
* Don't load ill-formed AmbiguityKind in Sema::Lookup.Alexey Samsonov2014-08-281-1/+7
| | | | | | This bug was reported by UBSan. llvm-svn: 216695
* Properly align inline space for ImplicitConversionSequences in OverloadSet.Alexey Samsonov2014-08-281-2/+4
| | | | | | This bug was reported by UBSan. llvm-svn: 216694
* Don't promote byval pointer arguments when padding mattersReid Kleckner2014-08-283-3/+141
| | | | | | | | | | | | | | | | Don't promote byval pointer arguments when when their size in bits is not equal to their alloc size in bits. This can happen for x86_fp80, where the size in bits is 80 but the alloca size in bits in 128. Promoting these types can break passing unions of x86_fp80s and other types. Patch by Thomas Jablin! Reviewed By: rnk Differential Revision: http://reviews.llvm.org/D5057 llvm-svn: 216693
* [asan] introduce __asan_load_cxx_array_cookie: check that the array cookie ↵Kostya Serebryany2014-08-283-1/+48
| | | | | | address is properly poisoned and return the cookie value. If not, return 0 to avoid infinite loop of DTORs (in case of use-after-free). Calls to this function will be inserted by clang (separate change) llvm-svn: 216692
* Don't create a null reference to NestedNameSpecifier.Alexey Samsonov2014-08-281-1/+2
| | | | | | This bug was reported by UBSan. llvm-svn: 216691
* Added setting: platform.plugin.linux.use-llgs-for-local (boolean), defaults ↵Todd Fiala2014-08-282-1/+80
| | | | | | | | | to false This setting is not yet hooked up to anything. In preparation for adding/testing llgs for local Linux debugging. llvm-svn: 216690
* AArch64: More correctly constrain target vector extend lowering.Jim Grosbach2014-08-282-3/+14
| | | | | | | | | | | | | | | The AArch64 target lowering for [zs]ext of vectors is set up to handle input simple types and expects the generic SDag path to do something reasonable with anything that's not a simple type. The code, however, was only checking that the result type was a simple type and assuming that implied that the source type would also be a simple type. That's not a valid assumption, as operations like "zext <1 x i1> %0 to <1 x i32>" demonstrate. The fix is to simply explicitly validate the source type as well as the result type. PR20791 llvm-svn: 216689
* Move FNEG next to FABS and make them more similar, so it's easier that they ↵Sanjay Patel2014-08-281-43/+46
| | | | | | can be refactored. NFC. llvm-svn: 216688
* Call powerpc-darwin external tools with -arch ppc.Rafael Espindola2014-08-283-14/+42
| | | | | | | | | | With this patch we call external tools for powerpc-darwin with "-arch ppc" instead of "-arch powerpc", so as to be compatible with the cctools assembler and ld64 linker. Patch by Stephen Drake! llvm-svn: 216687
* Ensure the Host wait4 thread is able to show pid in thread name.Todd Fiala2014-08-281-1/+12
| | | | | | | | | For hosts that cannot support long thread names, shrink the host wait4 thread name so that it does not truncate the PID in the thread name. Change by Shawn Best. llvm-svn: 216686
* Oops, use correct RUN: line for test.Richard Smith2014-08-281-2/+2
| | | | llvm-svn: 216685
* [asan] disable poison_array_cookie while I am investigating a false positive ↵Kostya Serebryany2014-08-282-3/+3
| | | | | | on chromium (I suspect that LLVM looses nosanitizer metadata; no test yet) llvm-svn: 216684
* [modules] PR20786: add (already passing) regression test from the bug report.Richard Smith2014-08-286-0/+21
| | | | llvm-svn: 216683
* On MachO, don't put non-private constants in mergeable sections.Rafael Espindola2014-08-282-6/+27
| | | | | | | | | | | On MachO, putting a symbol that doesn't start with a 'L' or 'l' in one of the __TEXT,__literal* sections prevents the linker from merging the context of the section. Since private GVs are the ones the get mangled to start with 'L' or 'l', we now only put those on the __TEXT,__literal* sections. llvm-svn: 216682
* Constify MCSymbol* parameters to DwarfDebug::attachLowHighPC.Frederic Riss2014-08-282-3/+3
| | | | llvm-svn: 216681
* [PECOFF] Another Win64 relocation bug fixRui Ueyama2014-08-282-71/+58
| | | | | | | | | When a relocation is applied to a location, the new value needs to be added to the existing value at the location. Existing value is in most cases zero, but if not, the current code does not work. llvm-svn: 216680
* Fix a logic bug in x86 vector codegen: sext (zext (x) ) != sext (x) (PR20472).Sanjay Patel2014-08-282-25/+41
| | | | | | | | | | | | | | | | | Remove a block of code from LowerSIGN_EXTEND_INREG() that was added with: http://llvm.org/viewvc/llvm-project?view=revision&revision=177421 And caused: http://llvm.org/bugs/show_bug.cgi?id=20472 (more analysis here) http://llvm.org/bugs/show_bug.cgi?id=18054 The testcases confirm that we (1) don't remove a zext op that is necessary and (2) generate a pmovz instead of punpck if SSE4.1 is available. Although pmovz is 1 byte longer, it allows folding of the load, and so saves 3 bytes overall. Differential Revision: http://reviews.llvm.org/D4909 llvm-svn: 216679
* Do not introduce new shuffle patterns after operation legalization if ↵Owen Anderson2014-08-281-2/+1
| | | | | | | | | SHUFFLE_VECTOR was marked custom. The target independent DAG combine has no way to know if the shuffles it is introducing are ones that the target could support or not. llvm-svn: 216678
* Reverting r216675. This breaks some bots. Before this can be committed ↵Aaron Ballman2014-08-286-108/+19
| | | | | | again, I have to explore runtime ABI requirements with libc++abi. llvm-svn: 216677
* Objective-C IRGen. Fixes an assertion crash caused by inconsistentFariborz Jahanian2014-08-282-2/+19
| | | | | | | | linkage related to generation of OBJC_SELECTOR_REFERENCES symbol needed in generation of call to 'super' in a class method. // rdar://18150301 llvm-svn: 216676
* Throw a std::bad_array_new_length exception when the expression (or ↵Aaron Ballman2014-08-286-19/+108
| | | | | | constant-expression) passed to operator new[] results in overflow in conformance with [expr.new]p7. Fixes PR11644. llvm-svn: 216675
* Janitorial services: "Don’t duplicate function or class name at the ↵Sanjay Patel2014-08-281-134/+119
| | | | | | beginning of the comment." llvm-svn: 216674
* Remove local TLI vars that are just duplicates of the class var. No ↵Sanjay Patel2014-08-281-2/+0
| | | | | | functional change. llvm-svn: 216673
* Use local vars to improve readability. No functional change.Sanjay Patel2014-08-281-42/+37
| | | | | | | Completes what was started in r216611 and r216623. Used const refs instead of pointers; not sure if one is preferable to the other. llvm-svn: 216672
* Cache the memoization data for DynTypedNodes.Samuel Benzaquen2014-08-281-14/+5
| | | | | | | | | | | | | | Summary: Cache the memoization data for DynTypedNodes. It is free to do so on create(), but expensive to determine dynamically. Reviewers: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5101 llvm-svn: 216671
* llgs: add proper exec support for Linux.Todd Fiala2014-08-287-10/+152
| | | | | | | | | | | | | | | This change: * properly captures execs in NativeProcessLinux. * clears out all non-main-thread thread metadata in NativeProcessLinux on exec. * adds a DidExec() method to the NativeProcessProtocol delegate. * clears out the auxv data cache when we exec (on Linux). This is a small part of the llgs for local Linux debugging work going on here: https://github.com/tfiala/lldb/tree/dev-llgs-local I'm breaking it into small patches. llvm-svn: 216670
* arm_acle: Fix error in ROR implementationYi Kong2014-08-281-4/+4
| | | | | | | | The logic in calculating the rotate amount was flawed. Thanks Pasi Parviainen for pointing out! llvm-svn: 216669
* lldb - towards AArch64 being recognised as platform architectureTodd Fiala2014-08-282-0/+38
| | | | | | | | See http://reviews.llvm.org/D4381. Change by Paul Osmialowski. llvm-svn: 216668
* Minor spelling correction.Sid Manning2014-08-281-1/+1
| | | | | | | | Reviewers: adasgupt, jverma, sidneym Differential Revision: http://reviews.llvm.org/D5025 llvm-svn: 216667
* Silence a -Wsign-compare warning. NFC.Aaron Ballman2014-08-281-1/+1
| | | | llvm-svn: 216666
OpenPOWER on IntegriCloud