summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Remove this test too.Fariborz Jahanian2014-11-111-0/+0
| | | | llvm-svn: 221715
* Revert r221702 until I address Richard Trieu'sFariborz Jahanian2014-11-116-104/+3
| | | | | | comments. llvm-svn: 221714
* Simplify the test by using multiple --check-prefix argumentsAlexey Samsonov2014-11-111-253/+160
| | | | llvm-svn: 221713
* Revert "IR: MDNode => Value: Update for LLVM API change in r221375"Duncan P. N. Exon Smith2014-11-111-1/+1
| | | | | | | | This reverts commit r221376. The API change was reverted in r221711. llvm-svn: 221712
* Revert "IR: MDNode => Value"Duncan P. N. Exon Smith2014-11-1146-201/+173
| | | | | | | | | | | | | | | | | Instead, we're going to separate metadata from the Value hierarchy. See PR21532. This reverts commit r221375. This reverts commit r221373. This reverts commit r221359. This reverts commit r221167. This reverts commit r221027. This reverts commit r221024. This reverts commit r221023. This reverts commit r220995. This reverts commit r220994. llvm-svn: 221711
* Fix build break: remove unused variable in FCFI.Tom Roeder2014-11-111-1/+0
| | | | llvm-svn: 221710
* Totally forget deallocated SDNodes in SDDbgInfo.Frederic Riss2014-11-112-4/+16
| | | | | | | | | | | | | | | | What would happen before that commit is that the SDDbgValues associated with a deallocated SDNode would be marked Invalidated, but SDDbgInfo would keep a map entry keyed by the SDNode pointer pointing to this list of invalidated SDDbgNodes. As the memory gets reused, the list might get wrongly associated with another new SDNode. As the SDDbgValues are cloned when they are transfered, this can lead to an exponential number of SDDbgValues being produced during DAGCombine like in http://llvm.org/bugs/show_bug.cgi?id=20893 Note that the previous behavior wasn't really buggy as the invalidation made sure that the SDDbgValues won't be used. This commit can be considered a memory optimization and as such is really hard to validate in a unit-test. llvm-svn: 221709
* Add Forward Control-Flow Integrity.Tom Roeder2014-11-1129-133/+873
| | | | | | | | | | | | | | | | | | | | This commit adds a new pass that can inject checks before indirect calls to make sure that these calls target known locations. It supports three types of checks and, at compile time, it can take the name of a custom function to call when an indirect call check fails. The default failure function ignores the error and continues. This pass incidentally moves the function JumpInstrTables::transformType from private to public and makes it static (with a new argument that specifies the table type to use); this is so that the CFI code can transform function types at call sites to determine which jump-instruction table to use for the check at that site. Also, this removes support for jumptables in ARM, pending further performance analysis and discussion. Review: http://reviews.llvm.org/D4167 llvm-svn: 221708
* [llvm-mc] Fixing case where if a file ended with non-newline whitespace or a ↵Colin LeMahieu2014-11-112-15/+11
| | | | | | | | comma it would access invalid memory. Cleaned up parse loop. llvm-svn: 221707
* Use rcpss/rcpps (X86) to speed up reciprocal calcs (PR21385).Sanjay Patel2014-11-115-1/+116
| | | | | | | | | | | | | | | | | | | | | | This is a first step for generating SSE rcp instructions for reciprocal calcs when fast-math allows it. This is very similar to the rsqrt optimization enabled in D5658 ( http://reviews.llvm.org/rL220570 ). For now, be conservative and only enable this for AMD btver2 where performance improves significantly both in terms of latency and throughput. We may never enable this codegen for Intel Core* chips because the divider circuits are just too fast. On SandyBridge, divss can be as fast as 10 cycles versus the 21 cycle critical path for the rcp + mul + sub + mul + add estimate. Follow-on patches may allow configuration of the number of Newton-Raphson refinement steps, add AVX512 support, and enable the optimization for more chips. More background here: http://llvm.org/bugs/show_bug.cgi?id=21385 Differential Revision: http://reviews.llvm.org/D6175 llvm-svn: 221706
* Simplify testcase. NFC.Rafael Espindola2014-11-111-2/+2
| | | | | | Thanks to Filipe Cabecinhas for the tip. llvm-svn: 221705
* PR16091 continued: Debug Info for member functions with undeduced return types.David Blaikie2014-11-112-15/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So DWARF5 specs out auto deduced return types as DW_TAG_unspecified_type with DW_AT_name "auto", and GCC implements this somewhat, but it presents a few problems to do this with Clang. GCC's implementation only applies to member functions where the auto return type isn't deduced immediately (ie: member functions of templates or member functions defined out of line). In the common case of an inline deduced return type function, GCC emits the DW_AT_type as the deduced return type. Currently GDB doesn't seem to behave too well with this debug info - it treats the return type as 'void', even though the definition of the function has the correctly deduced return type (I guess it sees the return type the declaration has, doesn't understand it, and assumes void). This means the function's ABI might be broken (non-trivial return types, etc), etc. Clang, on the other hand doesn't track this particular case of a deducable return type that is deduced immediately versus one that is deduced 'later'. So if we implement the DWARF5 representation, all deducible return type functions would get adverse GDB behavior (including deduced return type lambda functions, inline deduced return type functions, etc). Also, we can't just do this for auto types that are not deduced - because Clang marks even the declaration's return type as deduced (& provides the underlying type) once a definition is seen that allows the deduction. So we have to ignore even deduced types - but we can't do that for auto variables (because this representation only applies to function declarations - variables and function definitions need the real type so the function can be called, etc) so we'd need to add an extra flag to the type unwrapping/creation code to indicate when we want to see through deduced types and when we don't. It's also not as simple as just checking at the top level when building a function type (for one thing, we reuse the function type building for building function pointer types which might also have 'auto' in them - but be the type of a variable instead) because the auto might be arbitrarily deeply nested ("auto &", "auto (*)()", etc...) So, with all that said, let's do the simple thing that works in existing debuggers for now and treat these functions the same way we do function templates and implicit special members: omit them from the member list, since they can't be correctly called anyway (without knowing the return type the ABI isn't know and a function call could put the arguments in the wrong place) so they're not much use to the user. At some point in the future, when GDB understands the DWARF5 representation better it might be worth plumbing through the extra type builder handling to avoid looking through AutoType for some callers, etc... llvm-svn: 221704
OpenPOWER on IntegriCloud