summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Mark TypeDecls used in member initializers as referenced.Nico Weber2014-11-122-0/+13
| | | | | | | | | | | | | | | | | | Without this, -Wunused-local-typedef would incorrectly warn on the two typedefs in this program: void foo() { struct A {}; struct B : public A { typedef A INHERITED; B() : INHERITED() {} typedef B SELF; B(int) : SELF() {} }; } llvm-svn: 221765
* clang-format a few lines, fixes one 80col violation. nfc.Nico Weber2014-11-121-6/+5
| | | | llvm-svn: 221764
* Fix non-variadic function_ref cases to match r221753David Blaikie2014-11-121-4/+16
| | | | llvm-svn: 221763
* Don't duplicate name in comments. NFC.Rafael Espindola2014-11-122-40/+33
| | | | llvm-svn: 221762
* Revert "Use a function_ref now that it works (r221753)."Rafael Espindola2014-11-121-2/+2
| | | | | | | | This reverts commit r221756. David Blaikie pointed out it was unsafe. llvm-svn: 221761
* Enable armv7 core file writing for Mach-O binaries. Jason Molenda2014-11-121-3/+4
| | | | | | | The problems with the dyld all image infos struct seems to be specific to arm64. llvm-svn: 221760
* Remove unused method. NFC.Rafael Espindola2014-11-123-22/+0
| | | | llvm-svn: 221759
* Make readBytes pure virtual. Every real implementation has it.Rafael Espindola2014-11-122-20/+2
| | | | llvm-svn: 221758
* Remove unused method. NFC.Rafael Espindola2014-11-124-8/+1
| | | | llvm-svn: 221757
* Use a function_ref now that it works (r221753).Rafael Espindola2014-11-121-2/+2
| | | | llvm-svn: 221756
* Remove the now unused StringRefMemoryObject.h.Rafael Espindola2014-11-127-75/+0
| | | | llvm-svn: 221755
* Try a different workaround for GCC 4.7.2 lambda capture bug. The previousRichard Smith2014-11-121-7/+8
| | | | | | workaround took us from wrong-code to ICE. llvm-svn: 221754
* Ensure function_refs are copyable even from non-const referencesDavid Blaikie2014-11-123-2/+34
| | | | | | | | | | | | | | | | | | A subtle bug was found where attempting to copy a non-const function_ref lvalue would actually invoke the generic forwarding constructor (as it was a closer match - being T& rather than the const T& of the implicit copy constructor). In the particular case this lead to a dangling function_ref member (since it had referenced the function_ref passed by value to its ctor, rather than the outer function_ref that was still alive) SFINAE the converting constructor to not be considered if the copy constructor is available and demonstrate that this causes the copy to refer to the original functor, not to the function_ref it was copied from. (without the code change, the test would fail as Y would be referencing X and Y() would see the result of the mutation to X, ie: 2) llvm-svn: 221753
* Update for llvm API change.Rafael Espindola2014-11-121-4/+2
| | | | llvm-svn: 221752
* Pass an ArrayRef to MCDisassembler::getInstruction.Rafael Espindola2014-11-1217-113/+95
| | | | | | | | | | | | With this patch MCDisassembler::getInstruction takes an ArrayRef<uint8_t> instead of a MemoryObject. Even on X86 there is a maximum size an instruction can have. Given that, it seems way simpler and more efficient to just pass an ArrayRef to the disassembler instead of a MemoryObject and have it do a virtual call every time it wants some extra bytes. llvm-svn: 221751
* Instantiate exception specifications when instantiating function types (otherRichard Smith2014-11-1215-241/+423
| | | | | | | | | | | | | | | | | | | | | | | | | | | than the type of a function declaration). We previously didn't instantiate these at all! This also covers the pathological case where the only mention of a parameter pack is within the exception specification; this gives us a second way (other than alias templates) to reach the horrible state where a type contains an unexpanded pack, but its canonical type does not. This is a re-commit of r219977: r219977 was reverted in r220038 because it hit a wrong-code bug in GCC 4.7.2. (That's gcc.gnu.org/PR56135, and affects any implicit lambda-capture of 'this' within a template.) r219977 was a re-commit of r217995, r218011, and r218053: r217995 was reverted in r218058 because it hit a rejects-valid bug in MSVC. (Incorrect overload resolution in the presence of using-declarations.) It was re-committed in r219977 with a workaround for the MSVC rejects-valid. r218011 was a workaround for an MSVC parser bug. (Incorrect desugaring of unbraced range-based for loop). llvm-svn: 221750
* Revert "Update for LLVM API change in r221024"Duncan P. N. Exon Smith2014-11-122-2/+2
| | | | | | This reverts commit r221073 to match upstream revert in r221711. llvm-svn: 221749
* PR21536: Fix a corner case where we'd get confused by a pack expanding into theRichard Smith2014-11-122-2/+18
| | | | | | | penultimate parameter of a template parameter list, where the last parameter is itself a pack, and build a bogus empty final pack argument. llvm-svn: 221748
* Object, support both mach-o archive t.o.c file namesNick Kledzik2014-11-123-1/+2
| | | | | | | | | | For historical reasons archives on mach-o have two possible names for the file containing the table of contents for the archive: "__.SYMDEF SORTED" and "__.SYMDEF". But the libObject archive reader only supported the former. This patch fixes llvm::object::Archive to support both names. llvm-svn: 221747
* Remove a bit of dead code.Rafael Espindola2014-11-124-20/+11
| | | | | | Every "real" object file implements this an ptx doesn't use it. llvm-svn: 221746
* Fix this code to follow the coding style regarding anonymous namespaces andRichard Smith2014-11-122-108/+58
| | | | | | | static functions. Make a bunch of file-local functions static. Remove one unused static function revealed by this. llvm-svn: 221745
* Make Sema::CollectMultipleMethodsInGlobalPool() public.Douglas Gregor2014-11-121-2/+4
| | | | | | | It's useful for out-of-tree clients to be able to query the global Objective-C method pool, and only Sema can do that right now. llvm-svn: 221744
* Sketch out the armv7 and arm64 core file writing support inJason Molenda2014-11-122-9/+171
| | | | | | | | | | | | | | | ObjectFileMachO. It's close but we seem to be missing some of the memory region segments - not exactly sure how that's happening. The register context writing into the LC_THREAD load commands is working correctly though. Slightly reordered the arm64 definitions in ArchSpec.cpp so when we look for an arm64 core file definiton we're getting a cpu subtype of CPU_ANY which we can't put in the mach header of a core file. Make the first definition we find by linear search have the currently correct '1' cpu subtype. llvm-svn: 221743
* Extend intrinsic name mangling to support arrays, named structs, and ↵Philip Reames2014-11-121-6/+28
| | | | | | | | | | | | | function types. Currently, we have a type parameter mechanism for intrinsics. Rather than having to specify a separate intrinsic for each combination of argument and return types, we can specify a single intrinsic with one or more type parameters. These type parameters are passed explicitly to Intrinsic::getDeclaration or can be specified implicitly in the naming of the intrinsic function in an LL file. Today, the types are limited to integer, floating point, and pointer types. With a goal of supporting symbolic targets for patchpoints and statepoints, this change adds support for function types. The change also includes support for first class aggregate types (named structures and arrays) since these appear in function types we've encountered. Reviewed by: atrick, ributzka Differential Revision: http://reviews.llvm.org/D4608 llvm-svn: 221742
* clang/test/CodeGenCXX/debug-info-cxx1y.cpp: Add %itanium_abi_triple for ↵NAKAMURA Takumi2014-11-111-1/+1
| | | | | | incompatible MS targets. llvm-svn: 221741
* Make TreePattern::error use TwineMatt Arsenault2014-11-112-2/+2
| | | | | | | The underlying error function already uses a Twine, and most of the uses build up strings. llvm-svn: 221740
* [clang/asan] Do not emit memcpy for trivial operator= when ↵Kostya Serebryany2014-11-112-1/+18
| | | | | | | | | | | | | | | | | | -fsanitize-address-field-padding >= 1 Summary: If we've added poisoned paddings to a type do not emit memcpy for operator=. Test Plan: regression tests. Reviewers: majnemer, rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6160 llvm-svn: 221739
* [Reassociate] Canonicalize negative constants out of expressions.Chad Rosier2014-11-112-1/+50
| | | | | | Add support for FDiv, which was regressed by the previous commit. llvm-svn: 221738
* Canonicalize an assume(load != null) into !nonnull metadataPhilip Reames2014-11-112-0/+94
| | | | | | | | | | | We currently have two ways of informing the optimizer that the result of a load is never null: metadata and assume. This change converts the second in to the former. This avoids a need to implement optimizations using both forms. We should probably extend this basic idea to metadata of other forms; in particular, range metadata. We view is that assumes should be considered a "last resort" for when there isn't a more canonical way to represent something. Reviewed by: Hal Differential Revision: http://reviews.llvm.org/D5951 llvm-svn: 221737
* Have LookupMemberExprInRecord only call CorrectTypoDelayed, dropping theKaelyn Takata2014-11-112-68/+45
| | | | | | | | | code for calling CorrectTypo. Includes a needed fix for non-C++ code to not choke on TypoExprs (which also resolves a TODO from r220698). llvm-svn: 221736
* Create two helpers for running the typo-correction tree transform.Kaelyn Takata2014-11-112-16/+40
| | | | | | | | | | | | | One takes an Expr* and the other is a simple wrapper that takes an ExprResult instead, and handles checking whether the ExprResult is invalid. Additionally, allow an optional callback that is run on the full result of the tree transform, for filtering potential corrections based on the characteristics of the resulting expression once all of the typos have been replaced. llvm-svn: 221735
* Replace MemberTypoDiags and MemberExprTypoRecovery with lambdas.Kaelyn Takata2014-11-111-83/+39
| | | | llvm-svn: 221734
* libLTO: Allow linker to choose context of modules and codegenDuncan P. N. Exon Smith2014-11-112-1/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add API for specifying which `LLVMContext` each `lto_module_t` and `lto_code_gen_t` is in. In particular, this enables the following flow: for (auto &File : Files) { lto_module_t M = lto_module_create_in_local_context(File...); querySymbols(M); lto_module_dispose(M); } lto_code_gen_t CG = lto_codegen_create_in_local_context(); for (auto &File : FilesToLink) { lto_module_t M = lto_module_create_in_codegen_context(File..., CG); lto_codegen_add_module(CG, M); lto_module_dispose(M); } lto_codegen_compile(CG); lto_codegen_write_merged_modules(CG, ...); lto_codegen_dispose(CG); This flow has a few benefits. - Only one module (two if you count the combined module in the code generator) is in memory at a time. - Metadata (and constants) from files that are parsed to query symbols but not linked into the code generator don't pollute the global context. - The first for loop can be parallelized, since each module is in its own context. - When the code generator is disposed, the memory from LTO gets freed. rdar://problem/18767512 llvm-svn: 221733
* Remove unnecessary semicolon.Kaelyn Takata2014-11-111-1/+1
| | | | llvm-svn: 221732
* Initialize new subtarget feature variable for generating reciprocal estimate ↵Sanjay Patel2014-11-111-0/+1
| | | | | | | | instructions. This was missed in r221706. llvm-svn: 221731
* libLTO: Assert if LTOCodeGenerator and LTOModule are from different contextsDuncan P. N. Exon Smith2014-11-111-0/+3
| | | | llvm-svn: 221730
* [FastISel][AArch64] Add support for fabs intrinsic.Juergen Ributzka2014-11-112-0/+45
| | | | | | | | Lower the llvm.fabs intrinsic to the 'fabs' MI instruction. This fixes rdar://problem/18946552. llvm-svn: 221729
* libLTO: Allow LTOModule to own a contextDuncan P. N. Exon Smith2014-11-113-9/+59
| | | | llvm-svn: 221728
* clang-format: Improve handling of comments in binary expressions.Daniel Jasper2014-11-112-2/+4
| | | | | | | | | | | | | | | | | Before: b = a && // Comment b.c && d; After: b = a && // Comment b.c && d; This fixes llvm.org/PR21535. llvm-svn: 221727
* libLTO: Allow LTOCodeGenerator to own a contextDuncan P. N. Exon Smith2014-11-112-4/+21
| | | | llvm-svn: 221726
* [asan] adding ShadowOffset64 for mips64, patch by Kumar SukhaniKostya Serebryany2014-11-111-0/+5
| | | | llvm-svn: 221725
* Make LookupResult be copyable to avoid decomposing an existing one andKaelyn Takata2014-11-113-16/+16
| | | | | | initializing a new one every time a copy is needed. llvm-svn: 221724
* Explicitly exclude keywords from the member validator.Kaelyn Takata2014-11-111-10/+9
| | | | | | Also simply and remove dead code from MemberExprTypoRecovery. llvm-svn: 221723
* Fix some formatting prior to refactoring the code.Kaelyn Takata2014-11-111-21/+23
| | | | llvm-svn: 221722
* [Reassociate] Canonicalize negative constants out of expressions.Chad Rosier2014-11-115-115/+205
| | | | | | | | This is a reapplication of r221171, but we only perform the transformation on expressions which include a multiplication. We do not transform rem/div operations as this doesn't appear to be safe in all cases. llvm-svn: 221721
* [asan] fix coverage tests to use the new flag syntax (-fsanitize-coverage=N)Kostya Serebryany2014-11-1111-16/+16
| | | | llvm-svn: 221720
* Introduce -fsanitize-coverage=N flagKostya Serebryany2014-11-117-0/+47
| | | | | | | | | | | | | | | | | | | Summary: This change makes the asan-coverge (formerly -mllvm -asan-coverge) accessible via a clang flag. Companion patch to LLVM is http://reviews.llvm.org/D6152 Test Plan: regression tests, chromium Reviewers: samsonov Reviewed By: samsonov Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6153 llvm-svn: 221719
* Move asan-coverage into a separate phase.Kostya Serebryany2014-11-119-171/+287
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This change moves asan-coverage instrumentation into a separate Module pass. The other part of the change in clang introduces a new flag -fsanitize-coverage=N. Another small patch will update tests in compiler-rt. With this patch no functionality change is expected except for the flag name. The following changes will make the coverage instrumentation work with tsan/msan Test Plan: Run regression tests, chromium. Reviewers: nlewycky, samsonov Reviewed By: nlewycky, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6152 llvm-svn: 221718
* Replaced checking in string_view::remove_suffix/remove_prefix by ↵Marshall Clow2014-11-113-14/+6
| | | | | | _LIBCPP_ASSERT, since this is technically undefined behavior. Fixes PR#21496 llvm-svn: 221717
* Bundle conditions checked by UBSan with sanitizer kinds they implement.Alexey Samsonov2014-11-118-81/+87
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This change makes CodeGenFunction::EmitCheck() take several conditions that needs to be checked (all of them need to be true), together with sanitizer kinds these checks are for. This would allow to split one call into UBSan runtime into several calls in case different sanitizer kinds would have different recoverability settings. Tests should be fixed accordingly, I'm working on it. Test Plan: regression test suite. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6219 llvm-svn: 221716
OpenPOWER on IntegriCloud