Commit Graph

149204 Commits

Author SHA1 Message Date
Ben Langmuir 3b4c30b7e7 CodeGen for CapturedStmts
EmitCapturedStmt creates a captured struct containing all of the captured
variables, and then emits a call to the outlined function.  This is similar in
principle to EmitBlockLiteral.

GenerateCapturedFunction actually produces the outlined function.  It is based
on GenerateBlockFunction, but is much simpler.  The function type is determined
by the parameters that are in the CapturedDecl.

Some changes have been added to this patch that were reviewed as part of the
serialization patch and moving the parameters to the captured decl.

Differential Revision: http://llvm-reviews.chandlerc.com/D640

llvm-svn: 181536
2013-05-09 19:17:11 +00:00
Jyotsna Verma 00681dc1f0 Hexagon: Remove switch cases from GetDotNewPredOp and isPostIncrement functions.
No functionality change.

llvm-svn: 181535
2013-05-09 19:16:07 +00:00
Joerg Sonnenberger 8a5a9dfb5d Initialize codecvt explicitly with the C locale, which might not be 0.
llvm-svn: 181534
2013-05-09 19:00:18 +00:00
Richard Smith f2f6e114fd Switch C++1y paper links back to the canonical location at open-std.org now that the post-Bristol mailing has shipped.
llvm-svn: 181533
2013-05-09 18:53:17 +00:00
Shuxin Yang 1d8d7e4d38 [GVN] Split critical-edge on the fly, instead of postpone edge-splitting to next
iteration.
  
  This on step toward non-iterative GVN. My local hack suggests that getting rid
of iteration will speedup GVN by 30%+ on a medium sized input (2k LOC, C++).
I cannot explain why not 2x or more at this moment.

llvm-svn: 181532
2013-05-09 18:34:27 +00:00
Richard Smith 8797d39fd9 Add testcase missed from r181527.
llvm-svn: 181531
2013-05-09 18:33:50 +00:00
Jyotsna Verma 978e972ff9 Hexagon: Use relation map for getMatchingCondBranchOpcode() and
getInvertedPredicatedOpcode() functions instead of switch cases.

llvm-svn: 181530
2013-05-09 18:25:44 +00:00
Bill Wendling 98d5c52d2e Simplify the code a bit.
The compact unwind registers were defined in two different
places. It's better just to place them in the function that uses them
and specify that this is a 64-bit or 32-bit machine.

No functionality change.

llvm-svn: 181529
2013-05-09 18:21:45 +00:00
Ariel J. Bernal 3429028a81 Use 'auto const&' for iterators whose deref operator return a const var
This patch fixes PR15601.
- Added check for whether the loop variable and the initializer have the same
type.
- Added tests.

llvm-svn: 181528
2013-05-09 17:46:20 +00:00
Richard Smith 0646c86dcb Fix the return type of the complex creal functions. Patch by YunZhong Gao, modified to use _Static_assert and to check __STDC_HOSTED__ by me.
llvm-svn: 181527
2013-05-09 17:41:19 +00:00
Daniel Malea e347243061 Revert r181482 as it causes occasional hangs in LLDB buildbots
llvm-svn: 181526
2013-05-09 17:34:40 +00:00
David Blaikie e4a5588bcb Remove trailing whitespace
llvm-svn: 181525
2013-05-09 17:29:54 +00:00
Rafael Espindola 007521673b Don't replace an alias in llvm.used with its target.
When we replace an internal alias with its target, be careful not to
replace the entry in llvm.used (and llvm.compiler_used).

llvm-svn: 181524
2013-05-09 17:22:59 +00:00
Fariborz Jahanian 0321b8ffd6 [doc parsing]: make single character command impostures
warn in pedantic mode.

llvm-svn: 181523
2013-05-09 17:18:52 +00:00
Edwin Vane fc4f7dc0a6 Adding isConst() ASTMatcher for CXXMethodDecl nodes
Updated reference and unit tests.

llvm-svn: 181522
2013-05-09 17:00:17 +00:00
Fariborz Jahanian 395a6d4878 [doc parsing]: So, in this patch, single character
'commands' will not go through typo fixit logic,
preserving the old behavior (no typo, no diagnostics).
// rdar://12381408

llvm-svn: 181521
2013-05-09 16:44:02 +00:00
Richard Osborne 1333fa3d68 [XCore] Fix handling of functions where only the LR is spilled.
Previously we only checked if the LR required saving if the frame size was
non zero. However because the caller reserves 1 word for the callee to use
that doesn't count towards our frame size it is possible for the LR to need
saving and for the frame size to be 0.

We didn't hit when the LR needed saving because of a function calls because
the 1 word of stack we must allocate for our callee means the frame size
is always non zero in this case. However we can hit this case if the LR is
clobbered in inline asm.

llvm-svn: 181520
2013-05-09 16:43:42 +00:00
Edwin Vane c50e730d6e Updating LibASTMatchersReference to include namespaceDecl()
The namespaceDecl() ASTMatcher was added in r179027.

llvm-svn: 181519
2013-05-09 16:42:37 +00:00
Benjamin Kramer 21b972ae94 InstCombine: Don't just copy known bits from the first operand of an srem.
That's obviously wrong. Conservatively restrict it to the sign bit, which
matches the original intention of this analysis. Fixes PR15940.

llvm-svn: 181518
2013-05-09 16:32:32 +00:00
Fariborz Jahanian e46dd48e9f [doc parsing]: don't attempt to fix single character
commands (\t \n are common). \\ rdar://12381408 

llvm-svn: 181517
2013-05-09 16:22:31 +00:00
Rafael Espindola 90a4c23274 Avoid runtime type checks.
In most cases the relocation type implies the object word size and
endianness.

llvm-svn: 181515
2013-05-09 15:10:36 +00:00
Benjamin Kramer 4baf67a61b xopintrin.h: Add wrappers for all flavors of _mm_com.
GCC defines only the wrappers, MSVC defines both, we define both now too.
PR15844.

llvm-svn: 181514
2013-05-09 15:07:46 +00:00
Benjamin Kramer fd57b195a3 Add include guards to prfchwintrin.h.
llvm-svn: 181513
2013-05-09 15:07:39 +00:00
Ashok Thirumurthi 582133e88e Skipping a test that asserts with gcc and icc to allow the test suite to run to completion on the gcc buildbot.
llvm-svn: 181512
2013-05-09 14:46:01 +00:00
Ashok Thirumurthi a91a561571 Fixed a build failure introduced by r181501.
Patch by Yao Qi.

llvm-svn: 181511
2013-05-09 13:58:54 +00:00
Benjamin Kramer 3acc065b63 libDebugInfo depends on libObject nowadays.
llvm-svn: 181510
2013-05-09 13:48:26 +00:00
Rafael Espindola 2f44bf236e Introduce convenience typedefs for the 4 ELF object types.
llvm-svn: 181509
2013-05-09 13:13:28 +00:00
Kai Nacke 852e242b70 Test commit.
Add one of my contributions to CREDITS.TXT.

llvm-svn: 181508
2013-05-09 12:32:36 +00:00
Richard Smith 7525ff67f1 Implement C++1y constant initializer rules: in a constant initializer for an
object x, x's subobjects can be constructed by constexpr constructor even if
they are of non-literal type, and can be read and written even though they're
not members of a constexpr object or temporary.

llvm-svn: 181506
2013-05-09 07:14:00 +00:00
Ted Kremenek 399980acf5 [analyzer; alternate arrows] for "loop back" edges add back the extra edge to the closing '}'
llvm-svn: 181505
2013-05-09 06:55:41 +00:00
Ted Kremenek b5999f6321 [analyzer;alternate arrows] adapt 'for' loop aesthetic cleanup to 'while' loops.
llvm-svn: 181504
2013-05-09 06:55:35 +00:00
Rui Ueyama 90b3b92a8b [lld] Use range based for loop instead of explicit iterators (no functionality change)
llvm-svn: 181503
2013-05-09 04:00:44 +00:00
Rafael Espindola 0d15f7313f Change getRelocationAdditionalInfo to be ELF only.
It was only implemented for ELF where it collected the Addend, so this
patch also renames it to getRelocationAddend.

llvm-svn: 181502
2013-05-09 03:39:05 +00:00
Greg Clayton 6e0ff1a3cb Changed the formerly pure virtual function:
namespace lldb_private {
    class Thread
    {
        virtual lldb::StopInfoSP
        GetPrivateStopReason() = 0;
    };
}

To not be virtual. The lldb_private::Thread now handles the correct caching and will call a new pure virtual function:

namespace lldb_private {
    class Thread
    {
        virtual bool
        CalculateStopInfo() = 0;
    }
}

This function must be overridden by thead lldb_private::Thread subclass and the only thing it needs to do is to set the Thread::StopInfo() with the current stop reason and return true, or return false if there is no stop reason. The  lldb_private::Thread class will take care of calling this function only when it is required. This allows lldb_private::Thread subclasses to be a bit simpler and not all need to duplicate the cache and invalidation settings.

Also renamed:

lldb::StopInfoSP
lldb_private::Thread::GetPrivateStopReason();

To:

lldb::StopInfoSP
lldb_private::Thread::GetPrivateStopInfo();

Also cleaned up a case where the ThreadPlanStepOverBreakpoint might not re-set its breakpoint if the thread disappears (which was happening due to a bug when using the OperatingSystem plug-ins with memory threads and real threads).

llvm-svn: 181501
2013-05-09 01:55:29 +00:00
Enrico Granata 083fcdb414 Providing a more interesting command template for LLDB
This one actually exploits the SB API to obtain information about your inferior process

llvm-svn: 181500
2013-05-09 01:32:24 +00:00
Sean Callanan 04b2bfa3a9 Add all Decls found through FindExternalLexicalDecls
to the DeclContext.  This fulfils the contract that
we make with Clang by returning ELR_AlreadyLoaded.

This is a little aggressive in that it does not allow
the ASTImporter to import the child decls with any
lexical parent other than the Decl that reported them
as children.

<rdar://problem/13517713>

llvm-svn: 181498
2013-05-09 01:09:49 +00:00
Enrico Granata da144dc216 Changing the std::map test case to use source breakpoints instead of relying on the nexting always "getting it right" to stop at the locations of interest
This should make us more robust in the face of changing compiler line tables and other library modifications

llvm-svn: 181497
2013-05-09 01:04:59 +00:00
Eric Christopher f20ff979e9 Revert "Make sure debug info contains linkage names (DW_AT_MIPS_linkage_name)"
temporarily while investigating gdb.cp/templates.exp.

This reverts commit r181471.

llvm-svn: 181496
2013-05-09 00:42:33 +00:00
Arnold Schwaighofer 2e8c69cf97 LoopVectorizer: Don't assert on the absence of induction variables
A computable loop exit count does not imply the presence of an induction
variable. Scalar evolution can return a value for an infinite loop.

Fixes PR15926.

llvm-svn: 181495
2013-05-09 00:32:18 +00:00
Ted Kremenek b613dfadcb Put some diagnostics in DiagnosticCommonKinds.td in a category, mirroring what they are in other .td files.
I really dislike the copy-pasting of the category strings.  If there is a better
way to do this with TableGen, please advise.

llvm-svn: 181494
2013-05-09 00:07:27 +00:00
Jim Ingham 77e82d1ebd Fix the error reporting for ProcessKDP::DoDetach.
llvm-svn: 181493
2013-05-09 00:05:35 +00:00
Rui Ueyama 60f5f30687 [lld] Add comments to InputFiles::searchLibraries() arguments.
llvm-svn: 181492
2013-05-08 23:54:10 +00:00
Nico Weber 4e8626f708 Objective-C: Correctly encode 'retain' and 'copy' for readonly properties.
clang would omit 'C' for 'copy' properties and '&' for 'retain' properties if
the property was also 'readonly'. Fix this, which makes clang match gcc4.2's
behavior.

Fixes PR15928.

llvm-svn: 181491
2013-05-08 23:47:40 +00:00
Argyrios Kyrtzidis 1054bbf08d [PCH] Remove the ASTReaderListener::ReadHeaderFileInfo callback.
This made sense in pre-module era, before merging of HeaderFileInfos was introduced.

Final part of rdar://13840148.

llvm-svn: 181490
2013-05-08 23:46:55 +00:00
Argyrios Kyrtzidis 6f722b4eb9 [modules] When building a module, make sure we don't serialize out HeaderFileInfo for headers not belonging to the module.
After r180934 we may initiate module map parsing for modules not related to the module what we are building,
make sure we ignore the header file info of headers from such modules.

First part of rdar://13840148

llvm-svn: 181489
2013-05-08 23:46:46 +00:00
Greg Clayton 65c163529d Fixed the process attach by name test to get the target _after_ doing process attach. Otherwise the target isn't valid. This fixes 2 test suite failures on darwin.
llvm-svn: 181488
2013-05-08 23:45:06 +00:00
Fariborz Jahanian d3d3d27003 put noisy "unknown command tag name" warning
under -Wdocumentation-unknown-command and off by default.
patch by Dmitri Gribenko.

llvm-svn: 181487
2013-05-08 23:38:56 +00:00
Greg Clayton dbe445fdd8 Remove debug print statement.
llvm-svn: 181486
2013-05-08 23:37:59 +00:00
Adrian Prantl c20237d21f typo
llvm-svn: 181485
2013-05-08 23:37:22 +00:00
Rui Ueyama 980e52d7ae [lld][Core] Fix latch synchronization bug.
We need to acquire a lock before signal a condition.
Otherwise threads waiting on a condition variable can
miss a signal.

Consider two threads: Thread A executing dec() and thread
B executing sync(). The initial value of _count is 1. If
these two threads are interleaved in the following order,
thread B misses the signal sent by thread A, because at the
time thread A sends a signal, B is not waiting for it.

  Thread A                 |   Thread B
                           |   std::unique_lock<std::mutex> lock(_condMut);
                           |   while (!(_count == 0)) {
  if (--_count == 0)       |
    _cond_notify_all()     |
                           |     _cond.wait();
                           |   }

Note that "wait(lock, pred)" is equivalent to "while(!pred())
wait(lock)", so I expanded it in the above example.

Reviewers: Bigcheese

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D764

llvm-svn: 181484
2013-05-08 23:29:24 +00:00