Commit Graph

120011 Commits

Author SHA1 Message Date
Eli Friedman 9a766c4043 A few minor improvements to error recovery trying to access member of a function. In particular, this restores the cool error recovery for the example from http://blog.llvm.org/2010/04/amazing-feats-of-clang-error-recovery.html , which regressed a few months back.
llvm-svn: 148089
2012-01-13 02:20:01 +00:00
Richard Smith 90b748e0d1 Don't crash while trying to diagnose a function declared at block scope with an
incomplete return type.

llvm-svn: 148088
2012-01-13 02:14:39 +00:00
Jim Ingham bc2f918200 Don't set breakpoints independently comp unit by comp unit, but look over all the file & line matches
and only pick the "best" ones.
<rdar://problem/10685990>

llvm-svn: 148087
2012-01-13 02:04:05 +00:00
Evan Cheng fa8326334b DAGCombine's logic for forming pre- and post- indexed loads / stores were being
overly conservative. It was concerned about cases where it would prohibit
folding simple [r, c] addressing modes. e.g.
  ldr r0, [r2]
  ldr r1, [r2, #4]
=>
  ldr r0, [r2], #4
  ldr r1, [r2]
Change the logic to look for such cases which allows it to form indexed memory
ops more aggressively.

rdar://10674430

llvm-svn: 148086
2012-01-13 01:37:24 +00:00
Kaelyn Uhrain e31b88833a Fix up the calls to CorrectTypo in Sema*ObjC.cpp to use callback
objects, and add a basic CorrectionCandidateCallback template class
to simplify the fixups.

llvm-svn: 148085
2012-01-13 01:32:50 +00:00
Douglas Gregor 04ea962144 Revert previous commit. Something has gone wonky with my local configuration
llvm-svn: 148084
2012-01-13 01:24:11 +00:00
Howard Hinnant 50f7eeec9d Enclosed is a stress test for dynamic_cast. It stresses both libc++abi, and clang itself. It creates a ridiculously large class hierarchy using variadic templates. You can specify both the width and depth of the class hierarchy. And you can specify whether the cast is to the actual run time type, or to an intermediate layer in the class. About 1/3 of the time I compile this, it crashes the compiler. There seems to be an uninitialized area of memory, and I'm probably blowing past an assumption on class hierarchy size within clang (and understandably so). I can get it work most of the time with a class hierarchy width of 20 and a depth of 7. I'm making timings with both -O3 and -Os, using both cast to root and cast to intermediate, on both libc++abi, and gcc's dynamic_cast. I've put the results in a comment/table at the bottom of the test.
llvm-svn: 148083
2012-01-13 01:22:31 +00:00
Douglas Gregor da4fda7364 When inferring a module map for a framework, add the 'private'
requirement to headers under PrivateHeaders. We don't want to build
them as part of the module (yet).

llvm-svn: 148082
2012-01-13 01:20:43 +00:00
Anna Zaks cb6d4ee793 [analyzer] Unwrap the pointers when ignoring the const cast.
radar://10686991

llvm-svn: 148081
2012-01-13 00:56:55 +00:00
Anna Zaks a31f6b9559 [analyzer] Taint: when looking up a binding, provide the type.
llvm-svn: 148080
2012-01-13 00:56:51 +00:00
Anna Zaks 6228130099 [analyzer] RegionStoreManager::getBinding() should not crash when
looking up value at a CodeTextRegion even when the type is not provided.

llvm-svn: 148079
2012-01-13 00:56:48 +00:00
Anna Zaks bdf42b336d [analyzer] Fix a typo in a warning message.
llvm-svn: 148078
2012-01-13 00:56:44 +00:00
Bill Wendling 9c8456f7ef Fix off-by-one error.
llvm-svn: 148077
2012-01-13 00:41:53 +00:00
Dan Gohman 728db4997a Implement proper ObjC ARC objc_retainBlock "escape" analysis, so that
the optimizer doesn't eliminate objc_retainBlock calls which are needed
for their side effect of copying blocks onto the heap.
This implements rdar://10361249.

llvm-svn: 148076
2012-01-13 00:39:07 +00:00
Johnny Chen fb05d23789 Add some description for this test directory.
llvm-svn: 148075
2012-01-13 00:24:11 +00:00
Fariborz Jahanian 372030b2a1 objc parsing. Fixes a crash when parsing array initialization
inside a class implementation with parse errors. // rdar://10633434

llvm-svn: 148074
2012-01-13 00:14:12 +00:00
Johnny Chen c50af6fdcc rdar://problem/10684459
test_move_and_then_display_source (TestSourceManager.py) never works in LLDB test suite

Forgot to svn ci the "hidden" directory. :-( 

llvm-svn: 148073
2012-01-13 00:02:46 +00:00
Richard Smith 8d06f42448 Improve 0-argument -Wvexing-parse diagnostic by adding notes with fix-its:
- If the declarator is at the start of a line, and the previous line contained
   another declarator and ended with a comma, then that comma was probably a
   typo for a semicolon:

   int n = 0, m = 1, l = 2, // k = 5;
   myImportantFunctionCall(); // oops!

 - If removing the parentheses would correctly initialize the object, then
   produce a note suggesting that fix.

 - Otherwise, if there is a simple initializer we can suggest which performs
   value-initialization, then provide a note suggesting a correction to that
   initializer.

Sema::Declarator now tracks the location of the comma prior to the declarator in
the declaration, if there is one, to facilitate providing the note. The code to
determine an appropriate initializer from the -Wuninitialized warning has been
factored out to allow use in both that and -Wvexing-parse.

llvm-svn: 148072
2012-01-12 23:53:29 +00:00
Johnny Chen 7840c81df2 Modify a couple of Makefiles to use clang instead of gcc, since gcc is being deprecated.
llvm-svn: 148071
2012-01-12 23:50:28 +00:00
Eli Friedman 2e108376d5 Recommit r148056 with fixes to deal with weirdness with bitfields in unions.
Original message: Make sure adding a field to a struct never reduces its size.  PR11745.

llvm-svn: 148070
2012-01-12 23:48:56 +00:00
Howard Hinnant c37917f309 Fix http://llvm.org/bugs/show_bug.cgi?id=11752
llvm-svn: 148069
2012-01-12 23:37:51 +00:00
Eli Friedman 43f1834fad Revert r148056 while I investigate failures.
llvm-svn: 148068
2012-01-12 23:27:03 +00:00
Pete Cooper 9bcb72136e Added MVT::v2f16
llvm-svn: 148067
2012-01-12 23:14:13 +00:00
Johnny Chen fe14162e71 rdar://problem/10680957
Need a test case that tests DWARF with .o in .a files

test/functionalities/archives:

Produces libfoo.a from a.o and b.o.  Test breaking inside functions defined
inside the libfoo.a BSD Archive.

test/make/makefile.rules:

Some additional rules to sepcify archive building.  For example:

ARCHIVE_NAME := libfoo.a
ARCHIVE_C_SOURCES := a.c b.c

llvm-svn: 148066
2012-01-12 23:09:42 +00:00
Bill Wendling 49c4dfb534 Revert accidental commit.
llvm-svn: 148065
2012-01-12 23:06:28 +00:00
Bill Wendling ee5eaebc58 Fix the code that was WRONG.
The registers are placed into the saved registers list in the reverse order,
which is why the original loop was written to loop backwards.

llvm-svn: 148064
2012-01-12 23:05:03 +00:00
Jim Ingham 18f4629c78 Discriminate between the lldb_private::Type's for ObjC Classes that come from debug info, and those that
are made up from the ObjC runtime symbols.  For now the latter contain nothing but the fact that the name
describes an ObjC class, and so are not useful for things like dynamic types.

llvm-svn: 148059
2012-01-12 22:45:31 +00:00
Eli Friedman 3c502aca18 Revert accidental commit.
llvm-svn: 148058
2012-01-12 22:43:19 +00:00
Jim Ingham 5cfbe4aa53 Fix a comment typo.
llvm-svn: 148057
2012-01-12 22:42:34 +00:00
Eli Friedman 8c89d125ff Make sure adding a field to a struct never reduces its size. PR11745.
llvm-svn: 148056
2012-01-12 22:41:25 +00:00
Ted Kremenek 52acee87f4 Adjust set of default checkers.
llvm-svn: 148055
2012-01-12 22:41:10 +00:00
Jim Ingham 50b3d507bd Let the Module FindType do the stripping of namespace components, that's not expensive
and doing it both at the ModuleList and Module levels means we look 4 times for a negative
search.  Also, don't do the search for the stripped name if that is the same as the original
one.

llvm-svn: 148054
2012-01-12 22:35:29 +00:00
Argyrios Kyrtzidis 0037e08811 If an ObjCMessageExpr is implicit, there are no source locations for the
selector identifiers.

It was difficult to form a test case for it unfortunately.

llvm-svn: 148053
2012-01-12 22:34:19 +00:00
Kaelyn Uhrain fb96ec76ff Convert SemaCXXScopeSpec.cpp to pass a callback object to CorrectTypo,
improvng the typo correction results in certain situations.

llvm-svn: 148052
2012-01-12 22:32:39 +00:00
Fariborz Jahanian e74d47ed03 objc: do not warn when converting to a const id qualfied by its
list of protools. // rdar://10669694

llvm-svn: 148051
2012-01-12 22:12:08 +00:00
Pete Cooper 99415fea87 Added FPOW, FEXP, FLOG to PromoteNode so that custom actions can be set to Promote for those operations.
Sorry, no test case yet

llvm-svn: 148050
2012-01-12 21:46:18 +00:00
Rafael Espindola 0506cd8cfc Revert 148045 to fix the bots.
llvm-svn: 148049
2012-01-12 21:17:34 +00:00
Anton Korobeynikov 48cfd55c5d Add some basic mingw support.
Patch by Ruben Van Boxem! 

llvm-svn: 148048
2012-01-12 21:13:48 +00:00
Howard Hinnant b1ca881191 Oops, forgot to svn add the new test.
llvm-svn: 148047
2012-01-12 21:08:25 +00:00
Howard Hinnant b7d59ec6e1 Put debug print statments under a flag so that I can get a first glimpse at performance. So far I haven't noticed any performance difference between this new __dynamic_cast and gcc's implementation. But I've barely started looking. Also adding a couple of tests which come straight out of the standard.
llvm-svn: 148046
2012-01-12 21:06:12 +00:00
Rafael Espindola 9479c1b42a Add a SONAME to the libclang library.
Patch by Sylvestre Ledru.

llvm-svn: 148045
2012-01-12 21:04:54 +00:00
Elena Demikhovsky 060f6ccdb8 Fixed a bug in LowerVECTOR_SHUFFLE caused assertion failure
lc: X86ISelLowering.cpp:6480: llvm::SDValue llvm::X86TargetLowering::LowerVECTOR_SHUFFLE(llvm::SDValue, llvm::SelectionDAG&) const: Assertion `V1.getOpcode() != ISD::UNDEF&&  "Op 1 of shuffle should not be undef"' failed.
Added a test.

llvm-svn: 148044
2012-01-12 20:33:10 +00:00
Evan Cheng 5c03a6b8f5 When hoisting common code, watch out for uses which are marked "kill". If the
killed registers are needed below the insertion point, then unset the kill
marker.

Sorry I'm not able to find a reduced test case.

rdar://10660944

llvm-svn: 148043
2012-01-12 20:31:24 +00:00
Rafael Espindola 9a167eeaff Add error-reporting tests for platforms that don't support segmented stacks.
Patch by Brian Anderson.

llvm-svn: 148042
2012-01-12 20:26:13 +00:00
Rafael Espindola 00e861ed57 Support segmented stacks on 64-bit FreeBSD.
This patch uses tcb_spare field in the tcb structure to store info.
Patch by Jyun-Yan You.

llvm-svn: 148041
2012-01-12 20:24:30 +00:00
Rafael Espindola 10745d3381 Support segmented stacks on win32.
Uses the pvArbitrary slot of the TIB, which is reserved for applications. We
only support frames with a static size.

llvm-svn: 148040
2012-01-12 20:22:08 +00:00
Devang Patel b04a09a515 Remove test case, as Chris suggested.
llvm-svn: 148039
2012-01-12 19:54:02 +00:00
Howard Hinnant af07bfdb67 Fixed a couple of bugs, updated many comments, and am including a comprehensive test for when there are only 3 types in place. I need to do something similar for 4 and maybe more types, but I'm not sure how comprehensive I can make the test at 4 and above types.
llvm-svn: 148038
2012-01-12 19:48:14 +00:00
Kaelyn Uhrain b02c5e9356 Convert SemaInit.cpp to pass a callback object to CorrectTypo.
And once again improve the typo correction results in certain
situations just by moving the existing checks on the correction.

llvm-svn: 148037
2012-01-12 19:27:05 +00:00
Ted Kremenek 3d3aea9374 [analyzer] fix inlining's handling of mapping actual to formal arguments and limit the call stack depth. The analyzer can now accurately simulate factorial for limited depths.
llvm-svn: 148036
2012-01-12 19:25:46 +00:00