Commit Graph

158725 Commits

Author SHA1 Message Date
Benjamin Kramer 0f01d4e309 Plug a memory leak in a unit test. Stack allocation is sufficient here.
llvm-svn: 191638
2013-09-29 11:29:20 +00:00
Benjamin Kramer 41fe88e7b4 Deallocate type units when destroying a DWARFContext.
llvm-svn: 191637
2013-09-29 11:24:02 +00:00
Benjamin Kramer c3c807b3bf Allocate AtomicSDNode operands in SelectionDAG's allocator to stop leakage.
SDNode destructors are never called. As an optimization use AtomicSDNode's
internal storage if we have a small number of operands.

llvm-svn: 191636
2013-09-29 11:18:56 +00:00
Sylvestre Ledru fbf4a54a43 Update the build documentation for Debian & Ubuntu
llvm-svn: 191635
2013-09-29 10:46:25 +00:00
Faisal Vali 571df12581 Implement conversion to function pointer for generic lambdas without captures.
The general strategy is to create template versions of the conversion function and static invoker and then during template argument deduction of the conversion function, create the corresponding call-operator and static invoker specializations, and when the conversion function is marked referenced generate the body of the conversion function using the corresponding static-invoker specialization.  Similarly, Codegen does something similar - when asked to emit the IR for a specialized static invoker of a generic lambda, it forwards emission to the corresponding call operator. 

This patch has been reviewed in person both by Doug and Richard.  Richard gave me the LGTM.

A few minor changes:
  - per Richard's request i added a simple check to gracefully inform that captures (init, explicit or default) have not been added to generic lambdas just yet (instead of the assertion violation).
  - I removed a few lines of code that added the call operators instantiated parameters to the currentinstantiationscope. Not only did it not handle parameter packs, but it is more relevant in the patch for nested lambdas which will follow this one, and fix that problem more comprehensively.
  - Doug had commented that the original implementation strategy of using the TypeSourceInfo of the call operator to create the static-invoker was flawed and allowed const as a member qualifier to creep into the type of the static-invoker.  I currently kludge around it - but after my initial discussion with Doug, with a follow up session with Richard, I have added a FIXME so that a more elegant solution that involves the use of TrivialTypeSourceInfo call followed by the correct wiring of the template parameters to the functionprototypeloc is forthcoming.

Thanks! 
 

llvm-svn: 191634
2013-09-29 08:45:24 +00:00
Craig Topper c047fe3b5a Revert accidental commit.
llvm-svn: 191633
2013-09-29 08:35:51 +00:00
Craig Topper 3aef88b1c7 Change type of XOP flag in code emitters to a bool. Remove a some unneeded cases from switch.
llvm-svn: 191632
2013-09-29 08:33:34 +00:00
Ed Schouten d062146896 Add character set related __STDC_* definitions.
Clang uses UTF-16 and UTF-32 for its char16_t's and char32_t's
exclusively. This means that we can define __STDC_UTF_16__ and
__STDC_UTF_32__ unconditionally.

While there, define __STDC_MB_MIGHT_NEQ_WC__ for FreeBSD. FreeBSD's
wchar_t's don't encode characters as ISO-10646; the encoding depends on
the locale used. Because the character set used might not be a superset
of ASCII, we must define __STDC_MB_MIGHT_NEQ_WC__.

llvm-svn: 191631
2013-09-29 07:54:52 +00:00
Craig Topper e75666f47a Add comments for XOPA map introduced with TBM instructions.a
llvm-svn: 191630
2013-09-29 06:31:18 +00:00
Richard Smith 1cdec019e8 Implement C++1y sized deallocation (n3778). This is not enabled by -std=c++1y;
instead, it's enabled by the -cc1 flag -fsized-deallocation, until we sort out
the backward-compatibility issues.

llvm-svn: 191629
2013-09-29 04:40:38 +00:00
Benjamin Kramer d75c8ebdd1 Add a test that large offsets on GEPs on 32 bits targets are handled correctly.
llvm-svn: 191628
2013-09-28 21:27:49 +00:00
Richard Smith ee84919175 Remove commented-out entry for ARBs, they're not in C++1y any more.
llvm-svn: 191627
2013-09-28 19:09:34 +00:00
Marshall Clow 3d5134dd52 Implement n3789; constexpr support in named function objects
llvm-svn: 191626
2013-09-28 19:06:12 +00:00
Marshall Clow 8392ab209e Add a set of macros for using the new '[[[deprecated]]' attribute. No code changes (yet)
llvm-svn: 191625
2013-09-28 18:35:31 +00:00
Chandler Carruth 408b4fa472 Enable libcxx as part of the top level CMake build when it is checked
out in projects. This appears to be working on my system, and I will be
watching build bots to see if there are any issues on other platforms.

llvm-svn: 191624
2013-09-28 18:17:10 +00:00
Benjamin Kramer 5352717508 The second parameter of nexttoward is always long double.
llvm-svn: 191623
2013-09-28 17:41:03 +00:00
James Dennett 0f7691ad20 Documentation: minor fixes/improvements to documentation of DependentScopeDeclRefExpr.
llvm-svn: 191622
2013-09-28 16:30:01 +00:00
Sylvestre Ledru 789cefb83c Display the errno error message instead of the id
llvm-svn: 191621
2013-09-28 16:01:26 +00:00
Sylvestre Ledru faa63ce2a2 * Improve the wording (thanks to Ed Maste for the suggestion)
* Add a TODO item

llvm-svn: 191620
2013-09-28 15:57:37 +00:00
Sylvestre Ledru 6c9530b808 Fix a memory leak. Found by both scan-build and coverity. Close CID 1096442
llvm-svn: 191619
2013-09-28 15:50:23 +00:00
Sylvestre Ledru 77c87c0510 If setgid fails for any reason, exit lldb.
scan-build was complaining about:
The return value from the call to 'setgid' is not checked. If an error occurs in 'setgid', the following code may execute with unexpected privileges

llvm-svn: 191618
2013-09-28 15:47:38 +00:00
Sylvestre Ledru 30eff98e7e Remove useless declaration. If match_type == eNameMatchIgnore, we already left this function at the beginning of the method. Found by coverity. Fixes CID 1094188
llvm-svn: 191617
2013-09-28 15:35:02 +00:00
Sylvestre Ledru d28b99374f * mktemp is insecure as it always creates or uses insecure temporary file.
Switch to mkstemp.

* Get and display the error message when an error occurs while creating the temporary file

llvm-svn: 191616
2013-09-28 15:23:41 +00:00
Benjamin Kramer 602623f9ae Make helper function static.
llvm-svn: 191615
2013-09-28 15:08:41 +00:00
Benjamin Kramer 20c28bebf9 Refactor comment merging.
- We scan for whitespace between comments anyways, remember any newlines seen
  along the way.
- Use this newline number to decide whether two comments are adjacent.
- Since the newline check is now free remove the caching and unused code.
- Remove unnecessary boolean state from the comment list.
- No behavioral change.

llvm-svn: 191614
2013-09-28 15:06:27 +00:00
Sylvestre Ledru b027bd212b Remove trailing spaces
llvm-svn: 191613
2013-09-28 14:35:00 +00:00
Simon Atanasyan ee1accf14e Separate construction of bi-arch path suffix from construction of
multi-library path suffix.

The code calculates MIPS toolchain specific multi-lib path suffixes like
mips16/soft-float/el is moved to the separate function
findMultiLibSuffix(). This function called during GCC installation
detection and result is stored for the future using.

The patch reviewed by Rafael Espindola.
http://llvm-reviews.chandlerc.com/D1738

llvm-svn: 191612
2013-09-28 13:45:11 +00:00
Robert Wilhelm 2788d3ec99 Even more spelling fixes for "instruction".
llvm-svn: 191611
2013-09-28 13:42:22 +00:00
Robert Wilhelm f0cfb83bb4 Fix spelling intruction -> instruction.
llvm-svn: 191610
2013-09-28 11:46:15 +00:00
Richard Smith 5b013f5050 Add compat/extension warnings for init captures.
llvm-svn: 191609
2013-09-28 05:38:27 +00:00
Richard Smith 846f13ca14 Add extra testing for init-captures.
llvm-svn: 191608
2013-09-28 05:23:21 +00:00
Richard Smith b438e62aba Mark lambda init-captures as complete.
llvm-svn: 191607
2013-09-28 04:37:56 +00:00
Richard Smith 75e3f695fb Switch from putting init capture VarDecls in the surrounding DeclContext to
putting them in the call operator's DeclContext. This better matches the
language wording and avoids some cases where code gets confused by them for
namespace-scope lambdas and the like.

llvm-svn: 191606
2013-09-28 04:31:26 +00:00
Richard Smith bb13c9a49d Per latest drafting, switch to implementing init-captures as if by declaring
and capturing a variable declaration, and complete the implementation of them.

llvm-svn: 191605
2013-09-28 04:02:39 +00:00
Tom Stellard 45015d9796 SelectionDAG: Silence unused variable warning on release builds
llvm-svn: 191604
2013-09-28 03:10:17 +00:00
Tom Stellard 0351ea2010 R600: Fix handling of NAN in comparison instructions
We were completely ignoring the unorder/ordered attributes of condition
codes and also incorrectly lowering seto and setuo.

Reviewed-by: Vincent Lejeune<vljn at ovi.com>
llvm-svn: 191603
2013-09-28 02:50:50 +00:00
Tom Stellard 5694d3090a SelectionDAG: Improve legalization of SELECT_CC with illegal condition codes
SelectionDAG will now attempt to inverse an illegal conditon in order to
find a legal one and if that doesn't work, it will attempt to swap the
operands using the inverted condition.

There are no new test cases for this, but a nubmer of the existing R600
tests hit this path.

llvm-svn: 191602
2013-09-28 02:50:43 +00:00
Tom Stellard cd42818d86 SelectionDAG: Try to expand all condition codes using getCCSwappedOperands()
This is useful for targets like R600, which only support GT, GE, NE, and EQ
condition codes as it removes the need to handle unsupported condition
codes in target specific code.

There are no tests with this commit, but R600 has been updated to take
advantage of this new feature, so its existing selectcc tests are now
testing the swapped operands path.

llvm-svn: 191601
2013-09-28 02:50:38 +00:00
Tom Stellard 08690a146f SelectionDAG: Clean up LegalizeSetCCCondCode() function
Interpreting the results of this function is not very intuitive, so I
cleaned it up to make it more clear whether or not a SETCC op was
legalized and how it was legalized (either by swapping LHS and RHS or
replacing with AND/OR).

This patch does change functionality in the LHS and RHS swapping case,
but unfortunately there are no in-tree tests for this.  However, this
patch is a prerequisite for R600 to take advantage of the LHS and RHS
swapping, so tests will be added in subsequent commits.

llvm-svn: 191600
2013-09-28 02:50:32 +00:00
Jordan Rose 3553bb384b [analyzer] Make inlining decisions based on the callee being variadic.
...rather than trying to figure it out from the call site, and having
people complain that we guessed wrong and that a prototype-less call is
the same as a variadic call on their system. More importantly, fix a
crash when there's no decl at the call site (though we could have just
returned a default value).

<rdar://problem/15037033>

llvm-svn: 191599
2013-09-28 02:04:19 +00:00
Marshall Clow ba132bb198 Fixed bad link for n3789; thanks to Chip Davis for the catch
llvm-svn: 191598
2013-09-28 01:52:18 +00:00
NAKAMURA Takumi 3fddccfa43 MipsMachineFunction.cpp: Add missing #include <raw_ostream.h>
llvm-svn: 191597
2013-09-28 01:35:07 +00:00
Marshall Clow 66a49bd240 Updated my role
llvm-svn: 191596
2013-09-28 01:25:55 +00:00
Matt Arsenault 5200fdf077 Fix typo
llvm-svn: 191595
2013-09-28 01:08:00 +00:00
Nick Kledzik 0932c004a9 [mach-o] Add support for -mllvm to darwin driver
llvm-svn: 191594
2013-09-28 00:29:33 +00:00
Manman Ren 209b17cdaa AutoUpgrade: upgrade from scalar TBAA format to struct-path aware TBAA format.
We treat TBAA tags as struct-path aware TBAA format when the first operand
is a MDNode and the tag has 3 or more operands.

llvm-svn: 191593
2013-09-28 00:22:27 +00:00
Warren Hunt 41a993f6f8 Typo correction: _int64 -> __int64.
llvm-svn: 191592
2013-09-28 00:15:41 +00:00
Akira Hatanaka af4211ad94 [mips] Make sure loads from lazy-binding entries do not get CSE'd or hoisted out
of loops.

Previously, two consecutive calls to function "func" would result in the
following sequence of instructions:

1. load $16, %got(func)($gp) // load address of lazy-binding stub.
2. move $25, $16
3. jalr $25                  // jump to lazy-binding stub.
4. nop
5. move $25, $16
6. jalr $25                  // jump to lazy-binding stub again.

With this patch, the second call directly jumps to func's address, bypassing
the lazy-binding resolution routine:

1. load $25, %got(func)($gp) // load address of lazy-binding stub.
2. jalr $25                  // jump to lazy-binding stub.
3. nop
4. load $25, %got(func)($gp) // load resolved address of func.
5. jalr $25                  // directly jump to func.

llvm-svn: 191591
2013-09-28 00:12:32 +00:00
Warren Hunt d6ffae91d5 Implements some of the more commonly used intrinsics in Intrin.h
Differential Revision: http://llvm-reviews.chandlerc.com/D1766

llvm-svn: 191590
2013-09-27 23:57:26 +00:00
Kaelyn Uhrain 30943ce6fd Don't suggest namespaces if the next token is a '.'
llvm-svn: 191589
2013-09-27 23:54:23 +00:00