summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Work around a standard defect: template argument deduction for non-typeRichard Smith2016-12-272-8/+19
| | | | | | | | | template parameters of reference type basically doesn't work, because we're always deducing from an argument expression of non-reference type, so the type of the deduced expression never matches. Instead, compare the type of an expression naming the parameter to the type of the argument. llvm-svn: 290586
* Emit CCEDiags when evaluating a const variable.George Burgess IV2016-12-271-1/+4
| | | | | | This addresses post-review feedback from r290577. llvm-svn: 290584
* [AVX-512] Replace masked 512-bit pmuldq and pmuludq builtins with the newly ↵Craig Topper2016-12-271-30/+18
| | | | | | added unmasked versions and selects. llvm-svn: 290580
* Revert r290574 "foo"Craig Topper2016-12-271-18/+30
| | | | | | This was supposed to be merged with another commit with a real commit message. Sorry. llvm-svn: 290579
* Revert r290575 "[AVX-512] Replace masked 512-bit pmuldq and pmuludq builtins ↵Craig Topper2016-12-271-4/+4
| | | | | | | | with the newly added unmasked versions and selects." I failed to merge this with r290574. llvm-svn: 290578
* Factor out repeated code for deducing a non-type template parameter as a givenRichard Smith2016-12-271-81/+38
| | | | | | argument value. No functionality change intended. llvm-svn: 290576
* [AVX-512] Replace masked 512-bit pmuldq and pmuludq builtins with the newly ↵Craig Topper2016-12-271-4/+4
| | | | | | added unmasked versions and selects. llvm-svn: 290575
* fooCraig Topper2016-12-271-30/+18
| | | | llvm-svn: 290574
* Driver: switch Windows to static RelocModelSaleem Abdulrasool2016-12-273-27/+6
| | | | | | | | | | | | Windows uses PE/COFF which is inherently position independent. The use of the PIC model is unnecessary. In fact, we would generate invalid code using the ELF PIC model when PIC was enabled previously. Now that we no longer accept -fPIC and -fpoc, this switches the internal representation to the static model to permit us to make PIC modules invalid when targeting Windows. This should not change the code generation, only the internal state management. llvm-svn: 290569
* Check and build conversion sequences for non-type template arguments inRichard Smith2016-12-272-11/+9
| | | | | | | dependent contexts when processing the template in C++11 and C++14, just like we do in C++98 and C++1z. This allows us to diagnose invalid templates earlier. llvm-svn: 290567
* [DOXYGEN] Improved doxygen comments for x86 intrinsics.Ekaterina Romanova2016-12-278-203/+217
| | | | | | | | | | Improved doxygen comments for the following intrinsics headers: __wmmintrin_pclmul.h, bmiintrin.h, emmintrin.h, f16cintrin.h, immintrin.h, mmintrin.h, pmmintrin.h, tmmintrin.h Added \n commands to insert a line breaks where necessary, since one long line of documentation is nearly unreadable. Formatted comments to fit into 80 chars. In some cases added \a command in front of the parameter names to display them in italics. llvm-svn: 290561
* [PH] Teach the new PM code path to support -disable-llvm-passes.Chandler Carruth2016-12-271-10/+13
| | | | | | | | | | | This is kind of funny because I specifically did work to make this easy and then it didn't actually get implemented. I've also ported a set of tests that rely on this functionality to run with the new PM as well as the old PM so that we don't mess this up in the future. llvm-svn: 290558
* Update comment to match dr1770.Richard Smith2016-12-261-8/+7
| | | | llvm-svn: 290552
* Wdocumentation fixSimon Pilgrim2016-12-261-2/+2
| | | | llvm-svn: 290547
* Fix build error caused by r290539.Marina Yatsina2016-12-261-3/+2
| | | | llvm-svn: 290541
* [inline-asm]No error for conflict between inputs\outputs and clobber listMarina Yatsina2016-12-264-17/+103
| | | | | | | | | | | | | | | | | | | | | | | | | According to extended asm syntax, a case where the clobber list includes a variable from the inputs or outputs should be an error - conflict. for example: const long double a = 0.0; int main() { char b; double t1 = a; __asm__ ("fucompp": "=a" (b) : "u" (t1), "t" (t1) : "cc", "st", "st(1)"); return 0; } This should conflict with the output - t1 which is st, and st which is st aswell. The patch fixes it. Commit on behald of Ziv Izhar. Differential Revision: https://reviews.llvm.org/D15075 llvm-svn: 290539
* Driver: warn on -fPIC/-fpic/-fPIE/-fpie on WindowsSaleem Abdulrasool2016-12-261-0/+11
| | | | | | | | | | | | Use of these flags would result in the use of ELF-style PIE/PIC code which is incorrect on Windows. Windows is inherently PIC by means of the DLL slide that occurs at load. This also mirrors the behaviour on GCC for MinGW. Currently, the Windows x86_64 forces the relocation model to PIC (Level 2). This is unchanged for now, though we should remove any assumptions on that and change it to a static relocation model. llvm-svn: 290533
* Fix assertion failure when deducing an auto-typed argument against a ↵Richard Smith2016-12-251-1/+1
| | | | | | different-width int. llvm-svn: 290522
* [DebugInfo] Added support for Checksum debug info feature.Amjad Aboud2016-12-252-5/+48
| | | | | | Differential Revision: https://reviews.llvm.org/D27641 llvm-svn: 290515
* Fix some subtle wrong partial ordering bugs particularly with C++1z auto-typedRichard Smith2016-12-252-76/+128
| | | | | | | | | | | | | | | | | | non-type template parameters. During partial ordering, when checking the substituted deduced template arguments match the original, check the types of non-type template arguments match even if they're dependent. The only way we get dependent types here is if they really represent types of the other template (which are supposed to be modeled as being substituted for unique, non-dependent types). In order to make this work for auto-typed non-type template arguments, we need to be able to perform auto deduction even when the initializer and (potentially) the auto type are dependent, support for which is the bulk of this patch. (Note that this requires the ability to deduce only a single level of a multi-level dependent type.) llvm-svn: 290511
* [MS ABI] Mangle unnamed enums correctlyDavid Majnemer2016-12-251-2/+9
| | | | | | Unnamed enums take the name of the first enumerator they define. llvm-svn: 290509
* [OpenMP] Sema and parsing for 'target teams distribute' pragmaKelvin Li2016-12-2513-16/+185
| | | | | | | | This patch is to implement sema and parsing for 'target teams distribute' pragma. Differential Revision: https://reviews.llvm.org/D28015 llvm-svn: 290508
* Fix for PR15623 (corrected r290413 reverted at 290415). The patch eliminates ↵Anton Yartsev2016-12-252-18/+20
| | | | | | | | | unwanted ProgramState checker data propagation from an operand of the logical operation to operation result. The patch also simplifies an assume of a constraint of the form: "(exp comparison_op expr) != 0" to true into an assume of "exp comparison_op expr" to true. (And similarly, an assume of the form "(exp comparison_op expr) == 0" to true as an assume of exp comparison_op expr to false.) which improves precision overall. https://reviews.llvm.org/D22862 llvm-svn: 290505
* Factor out duplication between partial ordering for class template partialRichard Smith2016-12-241-182/+90
| | | | | | specializations and variable template partial specializations. llvm-svn: 290497
* Deduplicate several GD.getDecl() calls into Decl * local variable.Yaron Keren2016-12-241-8/+9
| | | | llvm-svn: 290495
* [ASTMatchers] Add hasInClassInitializer traversal matcher for FieldDecl.Malcolm Parsons2016-12-241-0/+1
| | | | | | | | | | | | | | | Summary: I needed to know whether a FieldDecl had an in-class initializer for D26453. I used a narrowing matcher there, but a traversal matcher might be generally useful. Reviewers: sbenza, bkramer, klimek, aaron.ballman Subscribers: aaron.ballman, Prazek, cfe-commits Differential Revision: https://reviews.llvm.org/D28034 llvm-svn: 290492
* Remove accidentally-left-behind commented out code.Richard Smith2016-12-241-1/+0
| | | | llvm-svn: 290485
* Fix crash if substitution fails during deduction of variable template ↵Richard Smith2016-12-241-13/+24
| | | | | | partial specialization arguments. llvm-svn: 290484
* When producing a name of a partial specialization in a diagnostic, use theRichard Smith2016-12-243-11/+23
| | | | | | | template arguments as written rather than the canonical template arguments, so we print more user-friendly names for template parameters. llvm-svn: 290483
* clangCodeGen: Add LLVMPasses to libdeps. r290450 introduced it.NAKAMURA Takumi2016-12-241-0/+1
| | | | llvm-svn: 290478
* ArrayRefize lists of TemplateArguments in template argument deduction.Richard Smith2016-12-231-48/+33
| | | | llvm-svn: 290461
* [DOXYGEN] Improved doxygen comments for tmmintrin.h intrinsics.Ekaterina Romanova2016-12-231-605/+606
| | | | | | | Added \n commands to insert a line breaks where necessary to make the documentation more readable. Formatted comments to fit into 80 chars. llvm-svn: 290458
* [DOXYGEN] Improved doxygen comments for tmmintrin.h intrinsics.Ekaterina Romanova2016-12-231-14/+14
| | | | | | | | Tagged parameter names with \a doxygen command to display parameters in italics. Added \n commands to insert a line break to make the documentation more readable. Formatted comments to fit into 80 chars. llvm-svn: 290455
* [PM] Introduce options to enable the (still experimental) new passChandler Carruth2016-12-233-4/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | manager, and a code path to use it. The option is actually a top-level option but does contain 'experimental' in the name. This is the compromise suggested by Richard in discussions. We expect this option will be around long enough and have enough users towards the end that it merits not being relegated to CC1, but it still needs to be clear that this option will go away at some point. The backend code is a fresh codepath dedicated to handling the flow with the new pass manager. This was also Richard's suggested code structuring to essentially leave a clean path for development rather than carrying complexity or idiosyncracies of how we do things just to share code with the parts of this in common with the legacy pass manager. And it turns out, not much is really in common even though we use the legacy pass manager for codegen at this point. I've switched a couple of tests to run with the new pass manager, and they appear to work. There are still plenty of bugs that need squashing (just with basic experiments I've found two already!) but they aren't in this code, and the whole point is to expose the necessary hooks to start experimenting with the pass manager in more realistic scenarios. That said, I want to *strongly caution* anyone itching to play with this: it is still *very shaky*. Several large components have not yet been shaken down. For example I have bugs in both the always inliner and inliner that I have already spotted and will be fixing independently. Still, this is a fun milestone. =D One thing not in this patch (but that might be very reasonable to add) is some level of support for raw textual pass pipelines such as what Sean had a patch for some time ago. I'm mostly interested in the more traditional flow of getting the IR out of Clang and then running it through opt, but I can see other use cases so someone may want to add it. And of course, *many* features are not yet supported! - O1 is currently more like O2 - None of the sanitizers are wired up - ObjC ARC optimizer isn't wired up - ... So plenty of stuff still lef to do! Differential Revision: https://reviews.llvm.org/D28077 llvm-svn: 290450
* [OpenCL] Align fake address space map with the SPIR target maps.Egor Churaev2016-12-231-2/+2
| | | | | | | | | | | | | | | Summary: We compile user opencl kernel code with spir triple. But built-ins are written in OpenCL and we compile it with triple x86_64 to be able to use x86 intrinsics. And we need address spaces to match in both cases. So, we change fake address space map in OpenCL for matching with spir. On CPU address spaces are not really important but we'd like to preserve address space information in order to perform optimizations relying on this info like enhanced alias analysis. Reviewers: pekka.jaaskelainen, Anastasia Subscribers: pekka.jaaskelainen, yaxunl, bader, cfe-commits Differential Revision: https://reviews.llvm.org/D28048 llvm-svn: 290436
* Fix problems in "[OpenCL] Enabling the usage of CLK_NULL_QUEUE as compare ↵Egor Churaev2016-12-2313-1/+79
| | | | | | | | | | | | | | operand." Summary: Fixed warnings in commit: https://reviews.llvm.org/rL290171 Reviewers: djasper, Anastasia Subscribers: yaxunl, cfe-commits, bader Differential Revision: https://reviews.llvm.org/D27981 llvm-svn: 290431
* Use after move bug fixesPiotr Padlewski2016-12-235-19/+28
| | | | | | | | | | | | Summary: Bunch of fixed bugs in Clang after running misc-use-after-move in clang-tidy. Reviewers: rsmith, mboehme Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D27752 llvm-svn: 290424
* Add an assert to catch improperly constructed %diff sequences inChandler Carruth2016-12-231-1/+4
| | | | | | | | | | | diagnostics and fix one such diagnostic. Sadly, this assert doesn't catch this bug because we have no tests that emit this diagnostic! Doh! I'm following up on the commit that introduces it to get that fixed. Then this assert will help in a more direct way. llvm-svn: 290417
* Revert changes made by r290413 until regression is fixed.Anton Yartsev2016-12-232-22/+18
| | | | llvm-svn: 290415
* Fix for PR15623. The patch eliminates unwanted ProgramState checker data ↵Anton Yartsev2016-12-232-18/+22
| | | | | | | | | propagation from an operand of the logical operation to operation result. The patch also simplifies an assume of a constraint of the form: "(exp comparison_op expr) != 0" to true into an assume of "exp comparison_op expr" to true. (And similarly, an assume of the form "(exp comparison_op expr) == 0" to true as an assume of exp comparison_op expr to false.) which improves precision overall. https://reviews.llvm.org/D22862 llvm-svn: 290413
* Move generation of injected template arguments for a template parameter listRichard Smith2016-12-232-44/+46
| | | | | | | out of an internal function and into ASTContext; this is needed in template argument deduction for P0522R0. llvm-svn: 290405
* Only substitute into type of non-type template parameter once, rather thanRichard Smith2016-12-231-34/+27
| | | | | | | | | | twice, in finalization of template argument deduction. This is a re-commit of r290310 (reverted in r290329); the bug found by the buildbots was fixed in r290399 (we would sometimes build a deduced template argument with a bogus type). llvm-svn: 290403
* When merging two deduced non-type template arguments for the same parameter,Richard Smith2016-12-233-30/+84
| | | | | | | | | | | | | | | | | | | fail the merge if the arguments have different types (except if one of them was deduced from an array bound, in which case take the type from the other). This is correct because (except in the array bound case) the type of the template argument in each deduction must match the type of the parameter, so at least one of the two deduced arguments must have a mismatched type. This is necessary because we would otherwise lose the type information for the discarded template argument in the merge, and fail to diagnose the mismatch. In order to power this, we now properly retain the type of a deduced non-type template argument deduced from a declaration, rather than giving it the type of the template parameter; we'll convert it to the template parameter type when checking the deduced arguments. llvm-svn: 290399
* Cleanup the handling of noinline function attributes, -fno-inline,Chandler Carruth2016-12-236-82/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -fno-inline-functions, -O0, and optnone. These were really, really tangled together: - We used the noinline LLVM attribute for -fno-inline - But not for -fno-inline-functions (breaking LTO) - But we did use it for -finline-hint-functions (yay, LTO is happy!) - But we didn't for -O0 (LTO is sad yet again...) - We had weird structuring of CodeGenOpts with both an inlining enumeration and a boolean. They interacted in weird ways and needlessly. - A *lot* of set smashing went on with setting these, and then got worse when we considered optnone and other inlining-effecting attributes. - A bunch of inline affecting attributes were managed in a completely different place from -fno-inline. - Even with -fno-inline we failed to put the LLVM noinline attribute onto many generated function definitions because they didn't show up as AST-level functions. - If you passed -O0 but -finline-functions we would run the normal inliner pass in LLVM despite it being in the O0 pipeline, which really doesn't make much sense. - Lastly, we used things like '-fno-inline' to manipulate the pass pipeline which forced the pass pipeline to be much more parameterizable than it really needs to be. Instead we can *just* use the optimization level to select a pipeline and control the rest via attributes. Sadly, this causes a bunch of churn in tests because we don't run the optimizer in the tests and check the contents of attribute sets. It would be awesome if attribute sets were a bit more FileCheck friendly, but oh well. I think this is a significant improvement and should remove the semantic need to change what inliner pass we run in order to comply with the requested inlining semantics by relying completely on attributes. It also cleans up tho optnone and related handling a bit. One unfortunate aspect of this is that for generating alwaysinline routines like those in OpenMP we end up removing noinline and then adding alwaysinline. I tried a bunch of other approaches, but because we recompute function attributes from scratch and don't have a declaration here I couldn't find anything substantially cleaner than this. Differential Revision: https://reviews.llvm.org/D28053 llvm-svn: 290398
* Make '-disable-llvm-optzns' an alias for '-disable-llvm-passes'.Chandler Carruth2016-12-233-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Much to my surprise, '-disable-llvm-optzns' which I thought was the magical flag I wanted to get at the raw LLVM IR coming out of Clang deosn't do that. It still runs some passes over the IR. I don't want that, I really want the *raw* IR coming out of Clang and I strongly suspect everyone else using it is in the same camp. There is actually a flag that does what I want that I didn't know about called '-disable-llvm-passes'. I suspect many others don't know about it either. It both does what I want and is much simpler. This removes the confusing version and makes that spelling of the flag an alias for '-disable-llvm-passes'. I've also moved everything in Clang to use the 'passes' spelling as it seems both more accurate (*all* LLVM passes are disabled, not just optimizations) and much easier to remember and spell correctly. This is part of simplifying how Clang drives LLVM to make it cleaner to wire up to the new pass manager. Differential Revision: https://reviews.llvm.org/D28047 llvm-svn: 290392
* [OPENMP] Fix for PR31417: assert failure when compiling trivial openmpAlexey Bataev2016-12-222-5/+6
| | | | | | | | | | program Offload related code is not quite ready yet, but some simple examples must not crash the compiler. Patch fixes the problem in offloading code with exceptions. llvm-svn: 290364
* Fix warning introduced by r290297.George Burgess IV2016-12-221-1/+1
| | | | llvm-svn: 290356
* [analyzer] Update GTestChecker to tighten API detectionDevin Coughlin2016-12-221-36/+48
| | | | | | | | | Update the GTestChecker to tighten up the API detection and make it cleaner in response to post-commit feedback. Also add tests for when temporary destructors are enabled to make sure we get the expected behavior when inlining constructors for temporaries. llvm-svn: 290352
* [analyzer] Improve suppress-on-sink behavior in incomplete analyses.Artem Dergachev2016-12-221-0/+26
| | | | | | | | | | | | | | | | | | | | | | | Warnings with suppress-on-sink are discarded during FlushReports when BugReporter notices that all paths in ExplodedGraph that pass through the warning eventually run into a sink node. However, suppress-on-sink fails to filter out false positives when the analysis terminates too early - by running into analyzer limits, such as block count limits or graph size limits - and the interruption hits the narrow window between throwing the leak report and reaching the no-return function call. In such case the report is there, however suppression-on-sink doesn't work, because the sink node was never constructed in the incomplete ExplodedGraph. This patch implements a very partial solution: also suppress reports thrown against a statement-node that corresponds to a statement that belongs to a no-return block of the CFG. rdar://problem/28832541 Differential Revision: https://reviews.llvm.org/D28023 llvm-svn: 290341
* clang-format: Less eagerly try to keep label-value pairs on a line.Daniel Jasper2016-12-221-1/+1
| | | | | | | | | | | | | | | Before: string v = StrCat("aaaaaaaaaaaaaaaaaaaaaaaaaaa: ", SomeFunction(aaaaaaaaaaaa, aaaaaaaaaaaaaaa), bbbbbbbbbbbbbbbbbbbbbbb); After: string v = StrCat("aaaaaaaaaaaaaaaaaaaaaaaaaaa: ", SomeFunction(aaaaaaaaaaaa, aaaaaaaaaaaaaaa), bbbbbbbbbbbbbbbbbbbbbbb); llvm-svn: 290337
OpenPOWER on IntegriCloud