Commit Graph

106317 Commits

Author SHA1 Message Date
Evan Cheng 97c9f84f68 Add iOS test
llvm-svn: 132203
2011-05-27 19:04:21 +00:00
Dan Gohman c6f2ddfc04 Update this comment.
llvm-svn: 132202
2011-05-27 18:42:33 +00:00
Eli Friedman 942e1c10f6 Don't sink or hoist debug info instrinsics; it isn't useful. This also prevents LICM sinking from erasing debug intrinsics which don't dominate any exit block of the loop.
rdar://9143943 .

llvm-svn: 132201
2011-05-27 18:37:52 +00:00
John McCall bd04b74bb2 Fix the inliner to maintain the current de facto invoke semantics:
- the selector for the landing pad must provide all available information
    about the handlers, filters, and cleanups within that landing pad
  - calls to _Unwind_Resume must be converted to branches to the enclosing
    lpad so as to avoid re-entering the unwinder when the lpad claimed it
    was going to handle the exception in some way
This is quite specific to libUnwind-based unwinding.  In an effort to not
interfere too badly with other unwinders, and with existing hacks in frontends,
this only triggers on _Unwind_Resume (not _Unwind_Resume_or_Rethrow) and does
nothing with selectors if it cannot find a selector call for either lpad.

llvm-svn: 132200
2011-05-27 18:34:38 +00:00
Jakob Stoklund Olesen 6019944901 Delete MethodBodies that only filtered reserved registers.
The register allocators know to filter reserved registers from the allocation
orders, so we don't need all of this boilerplate.

llvm-svn: 132199
2011-05-27 18:27:13 +00:00
Devang Patel f1d04706fb Handle signed types gracefully.
This fixes regressions reported by buildbots as a fallout of r132193.

llvm-svn: 132197
2011-05-27 18:15:52 +00:00
Eli Friedman 3a8d9625b0 And fix the test in r132194.
llvm-svn: 132196
2011-05-27 18:14:28 +00:00
Eli Friedman b868c83e67 Oops, wasn't intending to commit this. Partial revert of r132194.
llvm-svn: 132195
2011-05-27 18:04:04 +00:00
Eli Friedman fe84bd659c Fix a silly mistake (which trips over an assertion) in r132099. rdar://9515076
llvm-svn: 132194
2011-05-27 18:02:04 +00:00
Devang Patel 3c6aed2d98 Select DW_AT_const_value size based on variable size.
llvm-svn: 132193
2011-05-27 16:45:18 +00:00
Rafael Espindola 0373d007e9 Remove DwarfRegNum from the individual bits of the condition register.
These should be DW_OP_bit_piece of CR (64).

llvm-svn: 132192
2011-05-27 16:15:27 +00:00
Douglas Gregor 27d0c44524 Update the jump-scope checker for local variables with initializers,
so that it looks at the initializer of a local variable of class type
(or array thereof) to determine whether it's just an implicit
invocation of the trivial default constructor. Fixes PR10034.

llvm-svn: 132191
2011-05-27 16:05:29 +00:00
Rafael Espindola ecb5573047 Remove DwarfRegNum from CARRY. I should be encoded with DW_OP_bit_piece.
llvm-svn: 132190
2011-05-27 16:01:08 +00:00
Charles Davis ea5dc3a67b Assorted fixes for Win64 EH unwind info emission:
- Flip order of bitfields. This gets our output matching GAS.
- Handle case where the end of the prolog wasn't specified.
- If the resulting unwind info struct is less than 8 bytes, pad to 8 bytes.

Add a test for the latter two.

llvm-svn: 132188
2011-05-27 15:10:25 +00:00
Rafael Espindola 2daba3380d Remove dwarf numbers from subregs. We should use DW_OP_bit_piece to
refer to them.

I tested this with both check-all and the gdb testsuite.

llvm-svn: 132187
2011-05-27 15:08:24 +00:00
Howard Hinnant a676f7d36a noexcept for <utility>. This included a little repair on pair, and some noexcept workarounds.
llvm-svn: 132186
2011-05-27 15:04:19 +00:00
Benjamin Kramer 749ef5f420 InstCombine: Make switch folding with equality compares more aggressive by trying instsimplify on the arm where we know the compared value.
Stuff like "x == y ? y : x&y" now folds into "x&y".

llvm-svn: 132185
2011-05-27 13:00:16 +00:00
Cameron Zwarich 34ef49dc74 Fix PR10029 - VerifyCoalescing failure on patterns_dfa.c of 445.gobmk.
llvm-svn: 132181
2011-05-27 05:04:51 +00:00
Charles Davis 43a421e3d5 Add a test for Win64 EH unwind information emission.
llvm-svn: 132180
2011-05-27 03:54:43 +00:00
Eric Christopher 9b67db8ea7 Make the branch encoding for tBcc more obvious that it's a 4-byte opcode
followed by a conditional and imm8.

llvm-svn: 132179
2011-05-27 03:50:53 +00:00
Eric Christopher bd59e89331 Fix comment.
llvm-svn: 132178
2011-05-27 03:46:51 +00:00
Charles Davis 6d1c4c73a9 Start keeping track of where the various unwind instructions are in the prolog.
Use them to calculate the offset inside the prolog. Emit this value when
emitting the unwind codes.

llvm-svn: 132177
2011-05-27 03:25:01 +00:00
Charles Davis 761313b28d Add missing break statements. Align UNWIND_INFO and RUNTIME_FUNCTION structs
to 4 bytes.

I'm surprised no one caught the missing break statements.

llvm-svn: 132176
2011-05-27 02:43:19 +00:00
Richard Trieu 0cbb131d8b Add an additional check for null pointer before accessing PatternDecl.
llvm-svn: 132175
2011-05-27 02:08:53 +00:00
Charles Davis a60cd577fd My attempt at fixing the leak reported by the valgrind buildbots. Valgrind will
still report leaks, but they're spurious now. Valgrind cannot peer into
std::vector objects--or any dynamic array, for that matter--because it doesn't
know how big the array is.

llvm-svn: 132174
2011-05-27 02:01:08 +00:00
Charles Davis 9dcee31aab Fix inverted conditional in SaveReg and SaveXMM. Err when the frame pointer is
already defined, and err when the PushMachFrame operation isn't the first
operation (if specified at all).

llvm-svn: 132173
2011-05-27 01:42:17 +00:00
Chandler Carruth 7c430c0ec2 Enhance Clang to start instantiating static data member definitions
within class templates when they are necessary to complete the type of
the member. The canonical example is code like:

  template <typename T> struct S {
    static const int arr[];
    static const int x;
    static int f();
  };

  template <typename T> const int S<T>::arr[] = { 1, 2, 3 };
  template <typename T> const int S<T>::x = sizeof(arr) / sizeof(arr[0]);
  template <typename T> int S<T>::f() { return x; }

  int x = S<int>::f();

We need to instantiate S<T>::arr's definition to pick up its initializer
and complete the array type. This involves new code to specially handle
completing the type of an expression where the type alone is
insufficient. It also requires *updating* the expression with the newly
completed type. Fortunately, all the other infrastructure is already in
Clang to do the instantiation, do the completion, and prune out the
unused bits of code that result from this instantiation.

This addresses the initial bug in PR10001, and will be a step to
fleshing out other cases where we need to work harder to complete an
expression's type. Who knew we still had missing C++03 "features"?

llvm-svn: 132172
2011-05-27 01:33:31 +00:00
Douglas Gregor a9d8493310 Objective-C doesn't consider the use of incomplete types as method
parameter types to be ill-formed. However, it relies on the
completeness of method parameter types when producing metadata, e.g.,
for a protocol, leading IR generating to crash in such cases.

Since there's no real way to tighten down the semantics of Objective-C
here without breaking existing code, do something safe but lame:
suppress the generation of metadata when this happens.

Fixes <rdar://problem/9123036>.

llvm-svn: 132171
2011-05-27 01:19:52 +00:00
Eli Friedman e217f89420 One more debug line number miss in instcombine (although the code in question isn't actually in instcombine).
llvm-svn: 132170
2011-05-27 01:00:36 +00:00
Dan Gohman e635c529a0 Fix copy+pastos.
llvm-svn: 132168
2011-05-27 00:36:31 +00:00
Eli Friedman 35211c6091 Final step of instcombine debuginfo; switch a couple more places over to InsertNewInstWith, and use setDebugLoc for the cases which can't be easily handled by the automated mechanisms.
llvm-svn: 132167
2011-05-27 00:19:40 +00:00
Chandler Carruth 07f5b65e63 Fix warning about || and && without explicit grouping.
This looks like it flagged an actual bug. Devang, please review. I added
the parentheses that change behavior, but make the behavior more closely
match commit log's intent.

llvm-svn: 132165
2011-05-26 23:37:58 +00:00
Devang Patel bf22998f21 Do not insert anything after terminator.
llvm-svn: 132164
2011-05-26 23:16:48 +00:00
Chad Rosier b362884ca9 Renamed llvm.x86.sse42.crc32 intrinsics; crc64 doesn't exist.
crc32.[8|16|32] have been renamed to .crc32.32.[8|16|32] and
crc64.[8|16|32] have been renamed to .crc32.64.[8|64].

llvm-svn: 132163
2011-05-26 23:13:19 +00:00
Eric Christopher 017b959ad5 Comment cleanup.
llvm-svn: 132162
2011-05-26 22:54:27 +00:00
Devang Patel 252f0079a9 Do not move DBG_VALUE in middle of PHI nodes.
llvm-svn: 132161
2011-05-26 22:43:14 +00:00
Johnny Chen f5801f8d11 Remove extra '.' in the comment.
llvm-svn: 132160
2011-05-26 22:01:50 +00:00
Johnny Chen 75ec159da5 Add comment.
llvm-svn: 132152
2011-05-26 21:53:05 +00:00
Devang Patel 0da5250bcd If llvm.dbg.value and the value instruction it refers to are far apart then iSel may not be able to find corresponding Node for llvm.dbg.value during DAG construction. Make iSel's life easier by removing this distance between llvm.dbg.value and its value instruction.
llvm-svn: 132151
2011-05-26 21:51:06 +00:00
Johnny Chen 792ed4c616 Comment change.
llvm-svn: 132150
2011-05-26 21:50:47 +00:00
Devang Patel cdec11413b Add comment.
llvm-svn: 132149
2011-05-26 21:49:28 +00:00
Devang Patel 42ddaa10d3 During branch folding avoid inserting redundant DBG_VALUE machine instructions.
llvm-svn: 132148
2011-05-26 21:47:59 +00:00
Johnny Chen 0c0f977840 Simplify test setup; there's no need to pass a customized dictionary here.
llvm-svn: 132147
2011-05-26 21:43:19 +00:00
Benjamin Kramer f546f411b0 Silence sign compare warning.
llvm-svn: 132146
2011-05-26 21:32:30 +00:00
Richard Trieu 17afcbe5de Change the include stack of "instantiated from" notes to fall under the control of f/fno-diagnostics-show-note-include-stack flags. This should help with reducing diagnostic spew from macros instantiations.
llvm-svn: 132143
2011-05-26 20:49:16 +00:00
Jim Ingham 46fbc60f63 regexp-break -> _regexp-break in command string.
llvm-svn: 132141
2011-05-26 20:39:01 +00:00
Akira Hatanaka 077964a03c Use MachineFrameInfo::hasCalls instead of MipsFunctionInfo::hasCall to check if
a function has any function calls.

llvm-svn: 132140
2011-05-26 20:30:31 +00:00
Richard Trieu 61384cb8bd Add a fix-it and better error recovery for improperly nested namespaces. This will give a better error message for cases such as "namespace foo::bar::baz {}" and a suggested fix-it of "namespace foo { namespace bar { namespace baz {} } }"
llvm-svn: 132138
2011-05-26 20:11:09 +00:00
Howard Hinnant a62f28994c Applied noexcept to everything in [diagnostics] (Chapter 19)
llvm-svn: 132137
2011-05-26 19:48:01 +00:00
Rafael Espindola e3a07a3b42 Fix some dwarf register numbers.
llvm-svn: 132136
2011-05-26 19:25:47 +00:00