summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [SEH] Re-land r234532, but use internal linkage for all SEH helpersReid Kleckner2015-04-1010-371/+362
| | | | | | | | | | Even though these symbols are in a comdat group, the Microsoft linker really wants them to have internal linkage. I'm planning to tweak the mangling in a follow-up change. This is a straight revert with a 1-line fix. llvm-svn: 234613
* [Frontend] Close open file handles before renaming output filesReid Kleckner2015-04-101-10/+12
| | | | | | | | | | | | The placement of the 'delete' call that was removed in the unique_ptr migration in r234597 was not an accident. The raw_ostream has to be destroyed before you do the rename on Windows, otherwise you get ERROR_ACCESS_DENIED. We can still use unique_ptr, we just need to do a manual reset(). Also, range-for-loop-ify this code. llvm-svn: 234612
* Don't rely on implicit CallSite construction.Benjamin Kramer2015-04-101-1/+1
| | | | llvm-svn: 234600
* Try to make MSVC happy.Rafael Espindola2015-04-101-0/+3
| | | | llvm-svn: 234599
* Return std::unique_ptr to avoid a release and recreate.Rafael Espindola2015-04-102-5/+5
| | | | llvm-svn: 234598
* Use a std::unique_ptr to make it easier to see who owns the stream.Rafael Espindola2015-04-102-14/+15
| | | | llvm-svn: 234597
* Return a pointer instead of having a pointer outparam and a bool return.Rafael Espindola2015-04-102-20/+19
| | | | llvm-svn: 234592
* Initializing an uninitialized data member; should be NFC.Aaron Ballman2015-04-101-3/+3
| | | | llvm-svn: 234591
* Return a pointer instead of having a pointer outparam and a bool return.Rafael Espindola2015-04-103-21/+20
| | | | llvm-svn: 234590
* Reduce dyn_cast<> to isa<> or cast<> where possible. Clang edition.Benjamin Kramer2015-04-103-10/+8
| | | | | | No functional change intended. llvm-svn: 234587
* [OPENMP] Codegen for 'reduction' clause in 'parallel' directive.Alexey Bataev2015-04-1024-420/+1886
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Emit a code for reduction clause. Next code should be emitted for reductions: static kmp_critical_name lock = { 0 }; void reduce_func(void *lhs[<n>], void *rhs[<n>]) { ... *(Type<i> *)lhs[i] = RedOp<i>(*(Type<i> *)lhs[i], *(Type<i> *)rhs[i]); ... } ... void *RedList[<n>] = {&<RHSExprs>[0], ..., &<RHSExprs>[<n> - 1]}; switch (__kmpc_reduce{_nowait}(<loc>, <gtid>, <n>, sizeof(RedList), RedList, reduce_func, &<lock>)) { case 1: ... <LHSExprs>[i] = RedOp<i>(*<LHSExprs>[i], *<RHSExprs>[i]); ... __kmpc_end_reduce{_nowait}(<loc>, <gtid>, &<lock>); break; case 2: ... Atomic(<LHSExprs>[i] = RedOp<i>(*<LHSExprs>[i], *<RHSExprs>[i])); ... break; default: ; } Reduction variables are a kind of a private variables, they have private copies, but initial values are chosen in accordance with the reduction operation. Differential Revision: http://reviews.llvm.org/D8915 llvm-svn: 234583
* Remove threshold for inserting lifetime markers for named temporariesArnaud A. de Grandmaison2015-04-1023-50/+419
| | | | | | | | | | | | | | | | | | | Now that TailRecursionElimination has been fixed with r222354, the threshold on size for lifetime marker insertion can be removed. This only affects named temporary though, as the patch for unnamed temporaries is still in progress. My previous commit (r222993) was not handling debuginfo correctly, but this could only be seen with some asan tests. Basically, lifetime markers are just instrumentation for the compiler's usage and should not affect debug information; however, the cleanup infrastructure was assuming it contained only destructors, i.e. actual code to be executed, and was setting the breakpoint for the end of the function to the closing '}', and not the return statement, in order to show some destructors have been called when leaving the function. This is wrong when the cleanups are only lifetime markers, and this is now fixed. llvm-svn: 234581
* Reverting test commit.Szabolcs Sipos2015-04-101-1/+0
| | | | llvm-svn: 234578
* Test commit.Szabolcs Sipos2015-04-101-0/+1
| | | | llvm-svn: 234577
* [OPENMP] Fixed cleanup of OpenMP code.Alexey Bataev2015-04-101-28/+15
| | | | llvm-svn: 234575
* Fix typo in test. There is no %clangcxx, but there is %clangxx.Nick Lewycky2015-04-101-1/+1
| | | | llvm-svn: 234574
* [OPENMP] Fixing troubles with lambdas in cleanups.Alexey Bataev2015-04-101-20/+23
| | | | llvm-svn: 234572
* [OPENMP] Fixed incompatibility with MSVC, NFC.Alexey Bataev2015-04-101-8/+17
| | | | llvm-svn: 234568
* [Sema] Don't assume that an initializer list has an initializerDavid Majnemer2015-04-102-5/+6
| | | | | | | | Given something like 'int({}, 1)', we would try to emit a diagnostic regarding the excess element in the scalar initializer. However, we assumed that the initializer list had an element in it. llvm-svn: 234565
* [OPENMP] Refactoring of codegen for OpenMP directives.Alexey Bataev2015-04-109-372/+498
| | | | | | | Refactored API of OpenMPRuntime for compatibility with combined directives. Differential Revision: http://reviews.llvm.org/D8859 llvm-svn: 234564
* Revert r234532 for a bit, it very likely caused http://crbug.com/475768Nico Weber2015-04-1010-360/+369
| | | | llvm-svn: 234563
* _mm256_blend_epi16 is being cast to __m256d instead of __m256i. Fixing this. Ekaterina Romanova2015-04-101-1/+1
| | | | llvm-svn: 234560
* [modules] Remove unused MACRO_TABLE record.Richard Smith2015-04-103-44/+3
| | | | llvm-svn: 234555
* Add Clang support for remaining integer divide and permute instructions from ↵Nemanja Ivanovic2015-04-096-1/+144
| | | | | | | | | | | ISA 2.06 This patch corresponds to review: http://reviews.llvm.org/D8398 It adds some builtin functions to access the extended divide and bit permute instructions. llvm-svn: 234547
* [Objective-C Sema] It is permissable to bridge cast to 'id'Fariborz Jahanian2015-04-092-5/+15
| | | | | | | of a CFType bridged to some unknown Objective-C type. rdar://20113785 llvm-svn: 234545
* Update test case for r234543.Benjamin Kramer2015-04-091-1/+1
| | | | llvm-svn: 234544
* [CodeGen] Do a more principled fix for PR231653, always use the inner type.Benjamin Kramer2015-04-093-14/+22
| | | | | | | We were still using the MaterializeTemporaryExpr's type to check if the transform is legal. Always use the inner Expr type. llvm-svn: 234543
* Propagate usage of std:unique_ptr a bit. NFC.Rafael Espindola2015-04-091-5/+5
| | | | llvm-svn: 234538
* Update for LLVM api changes.Rafael Espindola2015-04-092-19/+13
| | | | llvm-svn: 234536
* Use Linux sysroot in Driver test case from r234521Reid Kleckner2015-04-091-0/+1
| | | | | | | | We don't actually need a real Mac sysroot to make the test pass, just a linker. This makes the test pass in environments where no ld is on PATH. llvm-svn: 234533
* [SEH] Outline finally blocks using the new variable capture supportReid Kleckner2015-04-0910-369/+360
| | | | | | | | | | | | | | | WinEHPrepare was going to have to pattern match the control flow merge and split that the old lowering used, and that wasn't really feasible. Now we can teach WinEHPrepare to pattern match this, which is much simpler: %fp = call i8* @llvm.frameaddress(i32 0) call void @func(iN [01], i8* %fp) This prototype happens to match the prototype used by the Win64 SEH personality function, so this is really simple. llvm-svn: 234532
* [Sema] Diagnose references to unbound arrays in function definitionsDavid Majnemer2015-04-092-0/+7
| | | | | | | | A [*] is only allowed in a declaration for a function, not in its definition. We didn't correctly recurse on reference types while looking for it, causing us to crash in CodeGen instead of rejecting it. llvm-svn: 234528
* Properly implement warn_unused_result checking for classes/structs.Kaelyn Takata2015-04-096-18/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation would copy the attribute from the class to functions that have the class as their return type when the functions are first declared. This proved to have two flaws: 1) if the class is forward-declared without the attribute and a function or method with the class as a its return type is declared, and afterward the class is defined with warn_unused_result, the function or method would never inherit the attribute, and 2) the check simply failed for functions and methods that are part of a template instantiation, regardless of whether the class with warn_unused_result is part of a specific instantiation or part of the template itself (presumably because those function/method declaration does not hit the same code path as a non-template one and so never inherits the attribute). The new approach is to instead modify the two places where a function or method call is checked for the warn_unused_result attribute on the decl by extending the checks to also look for the attribute on the decl's return type. Additionally, the check for return types that have the warn_unused_result now excludes pointers and references to such types, as such return types do not necessarily imply a transfer of ownership for the underlying object being referred to by the return value. This does not change the behavior of functions that are directly given the warn_unused_result attribute. llvm-svn: 234526
* [ASan] Don't link against libc++abi when not using libc++Hans Wennborg2015-04-092-3/+14
| | | | | | | This is a follow-up to r233860 which added -lc++abi when using ASan on Mac, and broke Chromium's ASan build which doesn't use libc++. llvm-svn: 234521
* [Objective-C modern translation]. Patch to fix type ofFariborz Jahanian2015-04-095-119/+119
| | | | | | | objc_msgSend's first argument to "Class" because objc_getClass is passed. rdar://20477025 llvm-svn: 234520
* Added flag to disable isel instruction on PPC target. Using regular branches ↵Olivier Sallenave2015-04-092-0/+8
| | | | | | instead of isel is more efficient in some cases. llvm-svn: 234509
* [CodeGen] When promoting a reference temporary to a global use the inner ↵Benjamin Kramer2015-04-092-3/+25
| | | | | | | | | type to fold it. The MaterializeTemporaryExpr can have a different type than the inner expression, miscompiling the constant. PR23165. llvm-svn: 234499
* Process the -freciprocal-math optimization flag (PR20912)Sanjay Patel2015-04-097-2/+29
| | | | | | | | | | | | | | | | | | | | | | | The driver currently accepts but ignores the -freciprocal-math flag. This patch passes the flag through and enables 'arcp' fast-math-flag generation in IR. Note that this change does not actually enable the optimization for any target. The reassociation optimization that this flag specifies was implemented by http://reviews.llvm.org/D6334 : http://llvm.org/viewvc/llvm-project?view=revision&revision=222510 Because the optimization is done in the backend rather than IR, the backend must be modified to understand instruction-level fast-math-flags or a new function-level attribute must be created. Also note that -freciprocal-math is independent of any target-specific usage of reciprocal estimate hardware instructions. That requires its own flag ('-mrecip'). https://llvm.org/bugs/show_bug.cgi?id=20912 llvm-svn: 234493
* [ARM] add support for Cortex-R4/R4FJaved Absar2015-04-095-5/+31
| | | | | | | | Adds ARM Cortex-R4 and R4F support and tests in Clang. Though Cortex-R4 support was present, the support for hwdiv in thumb-mode was not defined or tested properly. This has also been added. llvm-svn: 234488
* clang-cl: Support the /fp options (PR23112)Hans Wennborg2015-04-082-2/+23
| | | | | | | | | | | This hooks up the /fp options as aliases for -f[no-]fast-math and -f[no]-trapping-math. It probably doesn't match cl.exe's behaviour completely (e.g. LLVM is currently never as precise as /fp:precise), but it's close enough. Differential revision: http://reviews.llvm.org/D8909 llvm-svn: 234449
* [WinEH] Don't wrap cleanups in terminate actionsReid Kleckner2015-04-082-4/+34
| | | | | | | | _CxxFrameHandler3 calls terminate if a cleanup action throws, regardless of what bits you put in the xdata tables. There's no need to model this in the IR, since we just have to take it out later. llvm-svn: 234448
* Reland "[SEH] Implement filter capturing in CodeGen"Reid Kleckner2015-04-084-20/+213
| | | | | | | | | | | The test should be fixed. It was failing in NDEBUG builds due to a missing '*' character in a regex. In asserts builds, the pattern matched a single digit value, which became a double digit value in NDEBUG builds. Go figure. This reverts commit r234261. llvm-svn: 234447
* [Objective-C Sema] Use canonical type of properties when comparing Fariborz Jahanian2015-04-082-3/+20
| | | | | | | redeclaration of property in class extension and to avoid bogus error. rdar://20469452 llvm-svn: 234440
* Remove redundant virtual on member functions marked 'override'.David Blaikie2015-04-081-1/+1
| | | | llvm-svn: 234417
* [OPENMP] Allow redeclaration of variables as threadprivate.Alexey Bataev2015-04-084-34/+36
| | | | | | No need to emit an error message if the variable is redeclared as threadprivate. llvm-svn: 234402
* Appease build bots that cannot find a viable conversion through CanQualType.Aaron Ballman2015-04-081-1/+2
| | | | llvm-svn: 234376
* Generate a diagnostic when a catch handler cannot execute due to class ↵Aaron Ballman2015-04-087-66/+239
| | | | | | hierarchy inversion with regards to other catch handlers for the same block. llvm-svn: 234375
* Use the most recent previous decl to check if inline is added after a definitionReid Kleckner2015-04-082-1/+18
| | | | | | | | | | | | | | | | | | | | | | | This affects this test case: void foo(); template <typename T> class C { friend inline void foo(); }; inline void foo() {} C<int> c; Here, we instantiate the foo friend decl and add it to foo's redecl chain. However, our previous decl pointer happens to reference the first declaration of foo, which is not marked inline. When we check to see if foo was already defined, we implicitly search all previous decls. We should do the same for the inline check, instead of just checking this particular previous decl. Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D8872 llvm-svn: 234374
* [Sema] Correctly recurse when looking for [*] in function definitionsDavid Majnemer2015-04-072-9/+31
| | | | | | | | | | A [*] is only allowed in a declaration for a function, not in its definition. We didn't correctly recurse while looking for it, causing us to crash in CodeGen instead of rejecting it. This fixes PR23151. llvm-svn: 234363
* Revert "Mark instantiated function decls as inline specified if any pattern is"Reid Kleckner2015-04-072-48/+5
| | | | | | | | | | | | | | | | | | | It breaks down on this test case: void foo(); template <typename T> class C { friend void foo(); }; inline void foo() {} C<int> c; We shouldn't be marking the instantiation of the friend decl of foo as inline-specified. It may be possible to fix this by determining if the full definition is part of the current template, but it seems better to rever tot green until we come up with a full solution. This reverts commit r233817, as well as follow-ups r233820 and r233821. llvm-svn: 234355
OpenPOWER on IntegriCloud