summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* InstrProf: Always emit a coverage region for the condition of an ifJustin Bogner2015-02-191-1/+4
| | | | | | | | When tools like llvm-cov show regions, it's much easier to understand what's happening if the condition of an if shows a counter as well as the body. llvm-svn: 229813
* [Headers] Add tests for _mm256_insert_epi64 and fix its definitionFilipe Cabecinhas2015-02-191-1/+1
| | | | | | | | | | | | | | | | Summary: The definition for _mm256_insert_epi64 was taking an int, which would get truncated before being inserted in the vector. Original patch by Joshua Magee! Reviewers: bruno, craig.topper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7179 llvm-svn: 229811
* Itanium ABI: Properly qualify the destructor-nameDavid Majnemer2015-02-191-206/+169
| | | | | | | We didn't have enough qualificaiton before the scope specifier and we had too much qualification in the destructor name itself. llvm-svn: 229809
* Improve our handling of rtti/sanitize=vptr/sanitize=undefinedFilipe Cabecinhas2015-02-193-66/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the huge blob of code that is dealing with rtti/exceptions/sanitizers and replaces it with: A ToolChain function which, for a given set of Args, figures out if rtti should be: - enabled - disabled implicitly - disabled explicitly A change in the way SanitizerArgs figures out what sanitizers to enable (or if it should error out, or warn); And a check for exceptions/rtti interaction inside addExceptionArgs. The RTTIMode algorithm is: - If -mkernel, -fapple-kext, or -fno-rtti are passed, rtti was disabled explicitly; - If -frtti was passed or we're not targetting the PS4, rtti is enabled; - If -fexceptions or -fcxx-exceptions was passed and we're targetting the PS4, rtti was enabled implicitly; - If we're targetting the PS4, rtti is disabled implicitly; - Otherwise, rtti is enabled; Since the only flag needed to pass to -cc1 is -fno-rtti if we want to disable it, there's no problem in saying rtti is enabled if we're compiling C code, so we don't look at the input file type. addExceptionArgs now looks at the RTTIMode and warns that rtti is being enabled implicitly if targetting the PS4 and exceptions are on. It also errors out if, targetting the PS4, -fno-rtti was passed, and exceptions were turned on. SanitizerArgs now errors out if rtti was disabled explicitly and the vptr sanitizer was enabled implicitly, but just turns off vptr if rtti is disabled but -fsanitize=undefined was passed. Also fixed tests, removed duplicate name from addExceptionArgs comment, and added one or two surrounding lines when running clang-format. This changes test/Driver/fsanitize.c to make it not expect a warning when passed -fsanitize=undefined -fno-rtti, but expect vptr to not be on. Removed all users and definition of SanitizerArgs::sanitizesVptr(). Reviewers: samsonov Subscribers: llvm-commits, samsonov, rsmith Differential Revision: http://reviews.llvm.org/D7525 llvm-svn: 229801
* PR22566: a conversion from a floating-point type to bool is a narrowing ↵Richard Smith2015-02-191-7/+13
| | | | | | conversion. llvm-svn: 229792
* Allow errors on use of a private module header to be disabled, to better ↵Richard Smith2015-02-191-3/+3
| | | | | | support incremental transition to modules. llvm-svn: 229788
* clang-format: Space and triple angle braces.Jacques Pienaar2015-02-182-35/+82
| | | | | | Committing patch http://reviews.llvm.org/D6800. llvm-svn: 229783
* InstrProf: Rewrite most of coverage mapping generation in a simpler wayJustin Bogner2015-02-181-660/+516
| | | | | | | | | | | | | | | | | | | | | | | The coverage mapping generation code previously generated a large number of redundant coverage regions and then tried to merge similar ones back together. This then relied on some awkward heuristics to prevent combining of regions that were importantly different but happened to have the same count. The end result was inefficient and hard to follow. Now, we more carefully create the regions we actually want. This makes it much easier to create regions at precise locations as well as making the basic approach quite a bit easier to follow. There's still a fair bit of complexity here dealing with included code and macro expansions, but that's pretty hard to avoid without significantly reducing the quality of data we provide. I had to modify quite a few tests where the source ranges became more precise or the old ranges seemed to be wrong anyways, and I've added quite a few new tests since a large number of constructs didn't seem to be tested before. llvm-svn: 229748
* Itanium ABI: Write a character instead of a string literalDavid Majnemer2015-02-181-1/+1
| | | | | | No functional change intended. llvm-svn: 229726
* Itanium ABI: Properly mangle extern "C" template argumentsDavid Majnemer2015-02-181-0/+8
| | | | | | | | | extern "C" declarations should be considered like global declarations for mangling purposes. Differential Revision: http://reviews.llvm.org/D7718 llvm-svn: 229724
* Driver: Fix use of dangling std::string temporaryBenjamin Kramer2015-02-181-1/+2
| | | | | | | | | | | What's going on here is that the ternary operator produces a std::string rvalue that the StringRef points to. I'd hoped bugs like this were a thing of the past with our asan testing but apparently this code path is only used when LLVM is configured with a custom --with-c-include-dirs setting. Unbreaks bootstrapping with GCC5 on Fedora (PR22625), patch by Jonathan Wakely! llvm-svn: 229719
* Sema: Allow 'constexpr' variables in range loopsMeador Inge2015-02-181-2/+0
| | | | | | | | This fixes PR22492, which is in response to CWG issue #1204. Per the CWG issue 'contexpr' variables are now allowed in for range loops. llvm-svn: 229716
* clang-format: [JS] support AtScript style annotations for JS.Daniel Jasper2015-02-181-1/+7
| | | | | | | | Based on Java annotation support and style. Patch by Martin Probst. llvm-svn: 229703
* clang-format: [JS] Support classes.Daniel Jasper2015-02-182-4/+10
| | | | | | | | | | This adds support for JavaScript class definitions (again following TypeScript & AtScript style). This only required support for visibility modifiers in JS, everything else was already working. Patch by Martin Probst, thank you. llvm-svn: 229701
* clang-format: [JS] Support type annotations.Daniel Jasper2015-02-182-7/+16
| | | | | | | | | | This patch adds support for type annotations that follow TypeScript's, Flow's, and AtScript's syntax style. Patch by Martin Probst, thank you. Review: http://reviews.llvm.org/D7721 llvm-svn: 229700
* Change representation of member function pointers for MIPS targetsZoran Jovanovic2015-02-185-1/+10
| | | | | | Differential Revision: http://reviews.llvm.org/D7148 llvm-svn: 229680
* Prevent use after free caused by accessing a member into a dense set.Daniel Jasper2015-02-181-1/+2
| | | | | | | | The member gets invalidated as elements are added to the dense set. Directly access the underlying pointer instead. Not sure how to create a test case for this :-(. Maybe Richard can help. llvm-svn: 229673
* [ARM] Add missing M/R class CPUsBradley Smith2015-02-183-13/+15
| | | | | | | | | | | | Add some of the missing M and R class Cortex CPUs, namely: Cortex-M0+ (called Cortex-M0plus for GCC compatibility) Cortex-M1 SC000 SC300 Cortex-R5 llvm-svn: 229661
* Itanium ABI: Mangle <mangled-name> according to the ABIDavid Majnemer2015-02-181-12/+6
| | | | | | | | | | | | | | | We attempted to be compatible with GCC's buggy mangling for templates with a declaration for a template argument. However, we weren't completely successful in copying their bug in cases like: char foo; template <char &C> decltype(C) f() { return foo; }; template char &f<foo>(); Instead, just follow the ABI specification. This fixes PR22621. llvm-svn: 229644
* Port r163224 to C++.Nico Weber2015-02-181-1/+4
| | | | | | | | | | | | | | | | | | | | The motivation is to fix a crash on struct S {} s; Foo S::~S() { s.~S(); } What was happening here was that S::~S() was marked as invalid since its return type is invalid, and as a consequence CheckFunctionDeclaration() wasn't called and S::~S() didn't get merged into S's implicit destructor. This way, the class ended up with two destructors, which confused the overload printer when it suddenly had to print two possible destructors for `s.~S()`. In addition to fixing the crash, this change also seems to improve diagnostics in a few other places, see test changes. Crash found by SLi's bot. llvm-svn: 229639
* Wrap to 80 columns. No behavior change.Nico Weber2015-02-182-11/+15
| | | | llvm-svn: 229637
* Sema: partially address post-commit commentsSaleem Abdulrasool2015-02-181-2/+1
| | | | | | | Un-parameterize the warning as there is exactly one attribute added in C++14. Partially addresses post-commit review comments from Richard Smith. llvm-svn: 229636
* Sema: size_t is available in C when -fms-compatibility is enabledDavid Majnemer2015-02-181-2/+3
| | | | llvm-svn: 229616
* Itanium ABI: Improve our mangling of <destructor-name>David Majnemer2015-02-181-42/+90
| | | | | | | | | | | | | Our mangling of <destructor-name> wasn't quite right: we'd introduce mangling substitutions where one shouldn't be possible. We also didn't correctly handle the case where the destroyed type was not dependent but still a TemplateSpecializationType. N.B. There isn't a mangling for a template-template parameter showing up as the destroyed type. We do the 'obvious' thing and mangle the index of the parameter. llvm-svn: 229615
* Rename flags and options to match current naming: from -fdef-sized-delete to ↵Larisse Voufo2015-02-184-7/+7
| | | | | | -fdefine-sized-deallocation, and from DefaultSizedDelete to DefineSizedDeallocation. llvm-svn: 229597
* [analyzer] Refactoring: clarified the way the proper check kind is chosen.Anton Yartsev2015-02-181-64/+86
| | | | llvm-svn: 229593
* Sema: Replace some push_backs of expensive to move objects with emplace_back.Benjamin Kramer2015-02-173-10/+5
| | | | | | NFC. llvm-svn: 229557
* Revert r229543.Meador Inge2015-02-171-0/+2
| | | | | | Reverting this while build bot failures are investigated. llvm-svn: 229550
* Sema: Allow 'constexpr' variables in range loopsMeador Inge2015-02-171-2/+0
| | | | | | | | This fixes PR22492, which is in response to CWG issue #1204. Per the CWG issue 'contexpr' variables are now allowed in for range loops. llvm-svn: 229543
* Remove a recovery attempt that was untested and crashed when used.Nico Weber2015-02-171-7/+1
| | | | | | Found by SLi's bot. llvm-svn: 229532
* Remove the ABI from the target features. It's obsoleted byEric Christopher2015-02-171-3/+0
| | | | | | the -target-abi use and those features don't exist anymore. llvm-svn: 229526
* Revert accidental commit.Benjamin Kramer2015-02-171-2/+3
| | | | llvm-svn: 229510
* Prefer SmallVector::append/insert over push_back loops. Clang edition.Benjamin Kramer2015-02-1711-35/+16
| | | | | | Same functionality, but hoists the vector growth out of the loop. llvm-svn: 229508
* Append -fno-assume-sane-operator-new in ASan builds.Sergey Matveev2015-02-171-2/+7
| | | | | | | This should help LSan detect leaks where operator new would otherwise be optimized out. llvm-svn: 229498
* clang-format: Don't force a break after "endl" if everything fits on one line.Daniel Jasper2015-02-172-3/+4
| | | | llvm-svn: 229486
* clang-format: Fix crasher.Daniel Jasper2015-02-171-1/+1
| | | | llvm-svn: 229485
* [X86] Convert palignr builtin handling to use shuffle form of right shift ↵Craig Topper2015-02-171-35/+16
| | | | | | instead of intrinsics. This should allow the instrinsics to removed from the backend. llvm-svn: 229474
* [X86] Merge the 2 separate builtin handlers for PALIGNR into a single one ↵Craig Topper2015-02-171-52/+39
| | | | | | that handles both. llvm-svn: 229469
* [X86] Remove code that does custom handling of the builtin for MMX palignr. ↵Craig Topper2015-02-171-31/+0
| | | | | | This code is unreachable since its already marked for non-custom handling in llvm's IntrinsicsX86.td file. llvm-svn: 229468
* [Objctive-C sema]. Do not do the unused-getter-return-valueFariborz Jahanian2015-02-162-7/+1
| | | | | | | warning when property getter is used in direct method call and return value of property is unused. rdar://19773512 llvm-svn: 229458
* Minor tweaks to r229447 to ensure the attribute is properly quoted when ↵Aaron Ballman2015-02-161-1/+1
| | | | | | diagnosed. llvm-svn: 229454
* Wrap to 80 columns. No behavior change.Nico Weber2015-02-161-4/+5
| | | | llvm-svn: 229450
* For variables with dependent type, don't crash on `var->::new` or `var->__super`Nico Weber2015-02-161-6/+8
| | | | | | | | | | | | | | | | | | | | | ParsePostfixExpressionSuffix() for '->' (or '.') postfixes first calls ActOnStartCXXMemberReference() to inform sema that a member reference is about to start, and that function lets the parser know if sema thinks that the base expression's type could allow a pseudo destructor from a semantic point of view (for example, if the the base expression has a dependent type). ParsePostfixExpressionSuffix() then calls ParseOptionalCXXScopeSpecifier() and passes MayBePseudoDestructor on to that function, expecting the function to set it to false if a pseudo destructor is impossible from a syntactic point of view (due to a lack of '~' sigil). However, ParseOptionalCXXScopeSpecifier() had early-outs for ::new and __super, so MayBePseudoDestructor stayed true, so we tried to parse a pseudo dtor, and then became confused since we couldn't find a '~'. Move the snippet in ParseOptionalCXXScopeSpecifier() that sets MayBePseudoDestructor to false above the early exits. Parts of this found by SLi's bot. llvm-svn: 229449
* Sema: diagnose use of unscoped deprecated prior to C++14Saleem Abdulrasool2015-02-161-0/+7
| | | | | | | | | The deprecated attribute was adopted as part of the C++14, however, there is a GNU version available in C++11. When using C++ earlier than C++14, diagnose the use of the attribute without the GNU scope, but only when using the generalised attribute syntax. llvm-svn: 229447
* Parse: return true from ParseCXX11AttributeArgs if an attribute was addedSaleem Abdulrasool2015-02-161-2/+0
| | | | | | | | | | | | | | | | | | In the case that we diagnosed an invalid attribute due to missing or present arguments, we would return false, indicating to the caller that the parsing failed. However, we would have added the attribute in ParseAttributeArgsCommon (which may have been called indirectly through ParseGNUAttributeArgs). Returning true in this case ensures that a second copy of the attribute is not added. I haven't added a test case for this as the existing test will cover this with the next commit which diagnoses a C++14 attribute applied in C++11 mode. Rather than duplicating the existing test case, allow the tree to remain without a test between this and the next change. We would see double warnings in the [[deprecated()]] applied to a declaration in C++11 mode, which will cause an error in the cxx0x-attributes test. llvm-svn: 229446
* [X86] Remove completely unnecessary switch statement.Craig Topper2015-02-161-12/+2
| | | | llvm-svn: 229435
* InstrProf: Update for LLVM API changeJustin Bogner2015-02-161-2/+4
| | | | | | Update for the API change in r229433 llvm-svn: 229434
* Fix typo in comment.Nico Weber2015-02-161-2/+2
| | | | llvm-svn: 229432
* Enhance printing SizeOfPackExpr in dump.Serge Pavlov2015-02-161-0/+8
| | | | llvm-svn: 229428
* x86-64 ABI: unwrap single element structs / arrays of 256-bit vectors to ↵Sanjay Patel2015-02-161-11/+7
| | | | | | | | | | | | | | pass and return in registers This is a patch for PR22563 ( http://llvm.org/bugs/show_bug.cgi?id=22563 ). We were not correctly unwrapping a single 256-bit AVX vector that was defined as an array of 1 inside a struct. We would generate a <4 x float> param/return value instead of <8 x float> and lose half of the vector. Differential Revision: http://reviews.llvm.org/D7614 llvm-svn: 229408
OpenPOWER on IntegriCloud